50 lines
2.4 KiB
HTML
50 lines
2.4 KiB
HTML
{% import 'macro/form.html' as form %}
|
|
{% import 'macro/table.html' as table %}
|
|
|
|
<div class="table-responsive-sm">
|
|
<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 %}>
|
|
{{ table.header(color=true, quantity=not no_quantity, missing=not no_missing, sets=all, minifigures=all) }}
|
|
<tbody>
|
|
{% for item in table_collection %}
|
|
<tr>
|
|
{{ table.image(item.url_for_image(), caption=item.fields.name, alt=item.fields.part, accordion=solo) }}
|
|
<td data-sort="{{ item.fields.name }}">
|
|
<a class="text-reset" href="{{ item.url() }}">{{ item.fields.name }}</a>
|
|
{% if item.fields.spare %}<span class="badge rounded-pill text-bg-warning fw-normal"><i class="ri-loop-left-line"></i> Spare</span>{% endif %}
|
|
{% if all %}
|
|
{{ table.rebrickable(item) }}
|
|
{{ table.bricklink(item) }}
|
|
{% endif %}
|
|
</td>
|
|
<td data-sort="{{ item.fields.color_name }}">
|
|
{% 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 %}
|
|
<span class="align-middle">{{ item.fields.color_name }}</span>
|
|
</td>
|
|
{% if not no_quantity %}
|
|
{% if all %}
|
|
<td>{{ item.fields.total_quantity }}</td>
|
|
{% else %}
|
|
<td>{% if quantity %}{{ item.fields.quantity * quantity }}{% else %}{{ item.fields.quantity }}{% endif %}</td>
|
|
{% endif %}
|
|
{% endif %}
|
|
{% if not no_missing %}
|
|
<td {% if not all %}id="sort-part-{{ item.fields.id }}-{{ item.html_id() }}" data-sort="{{ item.fields.total_missing }}"{% endif %} class="table-td-missing">
|
|
{% if all or read_only_missing %}
|
|
{{ item.fields.total_missing }}
|
|
{% else %}
|
|
<div class="input-group">
|
|
{{ form.input(item.fields.id, item.html_id(), item.url_for_missing(), item.fields.total_missing) }}
|
|
</div>
|
|
{% endif %}
|
|
</td>
|
|
{% endif %}
|
|
{% if all %}
|
|
<td>{{ item.fields.total_sets }}</td>
|
|
<td>{{ item.fields.total_minifigures }}</td>
|
|
{% endif %}
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|