Remove total and unique counters from accordion headers because they are wrong and misleading
This commit is contained in:
parent
61a1b0ad94
commit
57158f75c8
@ -1,4 +1,4 @@
|
||||
{% macro header(title, id, parent, size=none, total=none, quantity=none, expanded=false, icon=none, class=none, danger=none, image=none, alt=none) %}
|
||||
{% macro header(title, id, parent, quantity=none, expanded=false, icon=none, class=none, danger=none, image=none, alt=none) %}
|
||||
{% if danger %}
|
||||
{% set icon='alert-fill' %}
|
||||
{% endif %}
|
||||
@ -11,12 +11,8 @@
|
||||
<i class="ri-{{ icon }} me-1"></i>
|
||||
{% endif %}
|
||||
{{ title }}
|
||||
{% if size and total %}
|
||||
({{ total }} total | {{ size }} unique)
|
||||
{% elif size and quantity %}
|
||||
(x{{ quantity }} | {{ size }} unique)
|
||||
{% elif size %}
|
||||
({{ size }})
|
||||
{% if quantity %}
|
||||
(x{{ quantity }})
|
||||
{% endif %}
|
||||
</button>
|
||||
</h2>
|
||||
@ -33,7 +29,7 @@
|
||||
{% macro cards(card_collection, title, id, parent, target, icon=none) %}
|
||||
{% set size=card_collection | length %}
|
||||
{% if size %}
|
||||
{{ header(title, id, parent, size=size, icon=icon) }}
|
||||
{{ header(title, id, parent, icon=icon) }}
|
||||
<div class="row">
|
||||
{% for item in card_collection %}
|
||||
<div class="col-md-6 col-xl-3 d-flex align-items-stretch">
|
||||
@ -47,10 +43,10 @@
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro table(table_collection, title, id, parent, target, total=none, quantity=none, icon=none, image=none, alt=none, details=none, no_missing=none, read_only_missing=none) %}
|
||||
{% macro table(table_collection, title, id, parent, target, quantity=none, icon=none, image=none, alt=none, details=none, no_missing=none, read_only_missing=none) %}
|
||||
{% set size=table_collection | length %}
|
||||
{% if size %}
|
||||
{{ header(title, id, parent, size=size, total=total, quantity=quantity, icon=icon, class='p-0', image=image, alt=alt) }}
|
||||
{{ header(title, id, parent, quantity=quantity, icon=icon, class='p-0', image=image, alt=alt) }}
|
||||
{% if details %}
|
||||
<p class="border-top border-bottom p-2 text-center">
|
||||
{% if image %}
|
||||
|
@ -40,7 +40,7 @@
|
||||
{% if solo %}
|
||||
<div class="accordion accordion-flush" id="set-details">
|
||||
{% if not delete %}
|
||||
{{ accordion.header('Instructions', 'instructions', 'set-details', expanded=open_instructions, size=item.instructions | length, icon='file-line', class='p-0') }}
|
||||
{{ accordion.header('Instructions', 'instructions', 'set-details', expanded=open_instructions, quantity=item.instructions | length, icon='file-line', class='p-0') }}
|
||||
<div class="list-group list-group-flush">
|
||||
{% if item.instructions | length %}
|
||||
{% for instruction in item.instructions %}
|
||||
@ -54,7 +54,7 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
{{ accordion.footer() }}
|
||||
{{ accordion.table(item.parts(), 'Parts', 'parts-inventory', 'set-details', 'part/table.html', total=item.fields.num_parts, icon='shapes-line')}}
|
||||
{{ accordion.table(item.parts(), 'Parts', 'parts-inventory', 'set-details', 'part/table.html', icon='shapes-line')}}
|
||||
{% for minifigure in item.minifigures() %}
|
||||
{{ accordion.table(minifigure.parts(), minifigure.fields.name, minifigure.fields.fig_num, 'set-details', 'part/table.html', quantity=minifigure.fields.quantity, icon='group-line', image=minifigure.url_for_image(), alt=minifigure.fields.fig_num, details=minifigure.url())}}
|
||||
{% endfor %}
|
||||
|
Loading…
Reference in New Issue
Block a user