From 57158f75c845161ecef266b42871ab1a9fceb7f8 Mon Sep 17 00:00:00 2001 From: Gregoo Date: Sat, 18 Jan 2025 22:23:20 +0100 Subject: [PATCH] Remove total and unique counters from accordion headers because they are wrong and misleading --- templates/macro/accordion.html | 16 ++++++---------- templates/set/card.html | 4 ++-- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/templates/macro/accordion.html b/templates/macro/accordion.html index 1830ca4..c622c86 100644 --- a/templates/macro/accordion.html +++ b/templates/macro/accordion.html @@ -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 @@ {% 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 %} @@ -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) }}
{% for item in card_collection %}
@@ -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 %}

{% if image %} diff --git a/templates/set/card.html b/templates/set/card.html index 1469fd0..d639516 100644 --- a/templates/set/card.html +++ b/templates/set/card.html @@ -40,7 +40,7 @@ {% if solo %}

{% 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') }}
{% if item.instructions | length %} {% for instruction in item.instructions %} @@ -54,7 +54,7 @@ {% endif %}
{{ 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 %}