{% import 'macro/accordion.html' as accordion %} {% import 'macro/form.html' as form %} {% import 'macro/table.html' as table %}
{% for bag in sidecar_bags %} {% set bag_title = bag.number if bag.is_extra else 'Bag ' ~ bag.number %} {% set bag_accordion_id = 'bag-' ~ loop.index %} {{ accordion.header(bag_title, bag_accordion_id, 'bags-list', quantity=bag.parts | length, icon='archive-line', class='p-0') }}
{% if bag.note %}{{ bag.note }}{% endif %} Spare parts are not included in bag inventories.
{{ table.header(color=true, quantity=true, missing=true, damaged=false, checked=true, hamburger_menu=g.login.is_authenticated(), accordion_id=bag_accordion_id, filters=true) }} {% for p in bag.parts %} {% if p.image_url %} {{ table.image(p.image_url, caption=p.name, alt=p.name) }} {% else %} {% endif %} {% if not config['HIDE_TABLE_MISSING_PARTS'] %} {% endif %} {% if not config['HIDE_TABLE_CHECKED_PARTS'] %} {% endif %} {% if g.login.is_authenticated() and (not config['HIDE_TABLE_MISSING_PARTS'] or not config['HIDE_TABLE_CHECKED_PARTS'] or (not config['DISABLE_QUICK_ADD_INDIVIDUAL_PARTS'] and not config['HIDE_INDIVIDUAL_PARTS'])) %} {# Filler cell under the hamburger column so row/header cell counts match #} {% endif %} {% endfor %}
{% if p.url %}{{ p.name }}{% else %}{{ p.name }}{% endif %} {% if p.spare %} Spare{% endif %} {% if p.color_rgb %}{% endif %} {{ p.color_name }} {{ p.quantity }} {% if p.url_missing %} {{ form.input('Missing', item.fields.id, p.prefix_missing, p.url_missing, p.missing) }} {% endif %} {% if p.url_checked %}
{{ form.checkbox('', item.fields.id, p.prefix_checked, p.url_checked, p.checked) }}
{% endif %}
{{ accordion.footer() }} {% endfor %}