New Year revamp #40
@ -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 %}
|
{% if danger %}
|
||||||
{% set icon='alert-fill' %}
|
{% set icon='alert-fill' %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@ -11,12 +11,8 @@
|
|||||||
<i class="ri-{{ icon }} me-1"></i>
|
<i class="ri-{{ icon }} me-1"></i>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{{ title }}
|
{{ title }}
|
||||||
{% if size and total %}
|
{% if quantity %}
|
||||||
({{ total }} total | {{ size }} unique)
|
(x{{ quantity }})
|
||||||
{% elif size and quantity %}
|
|
||||||
(x{{ quantity }} | {{ size }} unique)
|
|
||||||
{% elif size %}
|
|
||||||
({{ size }})
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</button>
|
</button>
|
||||||
</h2>
|
</h2>
|
||||||
@ -33,7 +29,7 @@
|
|||||||
{% macro cards(card_collection, title, id, parent, target, icon=none) %}
|
{% macro cards(card_collection, title, id, parent, target, icon=none) %}
|
||||||
{% set size=card_collection | length %}
|
{% set size=card_collection | length %}
|
||||||
{% if size %}
|
{% if size %}
|
||||||
{{ header(title, id, parent, size=size, icon=icon) }}
|
{{ header(title, id, parent, icon=icon) }}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
{% for item in card_collection %}
|
{% for item in card_collection %}
|
||||||
<div class="col-md-6 col-xl-3 d-flex align-items-stretch">
|
<div class="col-md-6 col-xl-3 d-flex align-items-stretch">
|
||||||
@ -47,10 +43,10 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% endmacro %}
|
{% 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 %}
|
{% set size=table_collection | length %}
|
||||||
{% if size %}
|
{% 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 details %}
|
||||||
<p class="border-top border-bottom p-2 text-center">
|
<p class="border-top border-bottom p-2 text-center">
|
||||||
{% if image %}
|
{% if image %}
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
{% if solo %}
|
{% if solo %}
|
||||||
<div class="accordion accordion-flush" id="set-details">
|
<div class="accordion accordion-flush" id="set-details">
|
||||||
{% if not delete %}
|
{% 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">
|
<div class="list-group list-group-flush">
|
||||||
{% if item.instructions | length %}
|
{% if item.instructions | length %}
|
||||||
{% for instruction in item.instructions %}
|
{% for instruction in item.instructions %}
|
||||||
@ -54,7 +54,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{{ accordion.footer() }}
|
{{ 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() %}
|
{% 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())}}
|
{{ 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 %}
|
{% endfor %}
|
||||||
|
Loading…
Reference in New Issue
Block a user