2025-01-29 15:12:10 +01:00
{% import 'macro/form.html' as form %}
2025-01-17 11:03:00 +01:00
{% import 'macro/table.html' as table %}
< div class = "table-responsive-sm" >
2025-01-24 15:55:15 +01:00
< table data-table = "{% if all %}true{% endif %}" class = "table table-striped align-middle {% if not all %}sortable mb-0{% endif %}" { % if all % } id = "parts" { % endif % } >
2025-01-17 11:03:00 +01:00
{{ table.header(color=true, quantity=not no_quantity, missing=not no_missing, sets=all, minifigures=all) }}
< tbody >
{% for item in table_collection %}
< tr >
2025-01-28 19:18:51 +01:00
{{ table.image(item.url_for_image(), caption=item.fields.name, alt=item.fields.part, accordion=solo) }}
2025-01-29 10:37:22 +01:00
< td data-sort = "{{ item.fields.name }}" >
2025-01-17 11:03:00 +01:00
< a class = "text-reset" href = "{{ item.url() }}" > {{ item.fields.name }}< / a >
2025-01-28 19:18:51 +01:00
{% if item.fields.spare %}< span class = "badge rounded-pill text-bg-warning fw-normal" > < i class = "ri-loop-left-line" > < / i > Spare< / span > {% endif %}
2025-01-17 11:03:00 +01:00
{% if all %}
{{ table.rebrickable(item) }}
{{ table.bricklink(item) }}
{% endif %}
< / td >
2025-01-29 10:37:22 +01:00
< td data-sort = "{{ item.fields.color_name }}" >
2025-01-29 11:43:18 +01:00
{% if item.fields.color_rgb %}< span class = "color-rgb color-rgb-table {% if item.fields.color == 9999 %}color-any{% endif %} align-middle border border-black" { % if item . fields . color ! = 9999 % } style = "background-color: #{{ item.fields.color_rgb }};" { % endif % } > < / span > {% endif %}
2025-01-29 10:36:43 +01:00
< span class = "align-middle" > {{ item.fields.color_name }}< / span >
< / td >
2025-01-17 11:03:00 +01:00
{% if not no_quantity %}
2025-01-17 15:35:23 +01:00
{% if all %}
< td > {{ item.fields.total_quantity }}< / td >
{% else %}
< td > {% if quantity %}{{ item.fields.quantity * quantity }}{% else %}{{ item.fields.quantity }}{% endif %}< / td >
{% endif %}
2025-01-17 11:03:00 +01:00
{% endif %}
{% if not no_missing %}
2025-01-28 19:18:51 +01:00
< td { % if not all % } id = "sort-part-{{ item.fields.id }}-{{ item.html_id() }}" data-sort = "{{ item.fields.total_missing }}" { % endif % } class = "table-td-missing" >
2025-01-17 11:03:00 +01:00
{% if all or read_only_missing %}
{{ item.fields.total_missing }}
{% else %}
< div class = "input-group" >
2025-01-29 15:12:10 +01:00
{{ form.input(item.fields.id, item.html_id(), item.url_for_missing(), item.fields.total_missing) }}
2025-01-17 11:03:00 +01:00
< / div >
{% endif %}
< / td >
{% endif %}
{% if all %}
< td > {{ item.fields.total_sets }}< / td >
< td > {{ item.fields.total_minifigures }}< / td >
{% endif %}
< / tr >
{% endfor %}
< / tbody >
< / table >
< / div >