42 lines
2.7 KiB
HTML
42 lines
2.7 KiB
HTML
<div class="table-wrap"><table class="inventory-table">
|
||
<thead><tr>
|
||
{% if columns %}
|
||
{% for column in columns %}
|
||
<th scope="col"{% if column.title %} title="{{ column.title }}"{% endif %}{% if column.direction %} aria-sort="{{ column.direction }}"{% endif %}>
|
||
<a class="stock-sort-link" href="?sort={{ column.key }}&direction={{ column.next_direction }}{% if search %}&q={{ search|urlencode:'' }}{% endif %}">
|
||
{{ column.label }}
|
||
<span aria-hidden="true">{% if column.direction == "ascending" %}↑{% elif column.direction == "descending" %}↓{% else %}↕{% endif %}</span>
|
||
<span class="sr-only">{% if column.next_direction == "asc" %}aufsteigend{% else %}absteigend{% endif %} sortieren</span>
|
||
</a>
|
||
</th>
|
||
{% endfor %}
|
||
{% else %}
|
||
<th>Hersteller</th><th>Produktart</th><th>Farbe</th><th>Spulenausführung</th><th title="Hersteller-Farbcode">Artikelnr.</th><th>Stück</th>
|
||
{% endif %}
|
||
{% if editable %}<th scope="col"><span class="sr-only">Aktionen</span></th>{% endif %}
|
||
</tr></thead>
|
||
{% for group in groups %}
|
||
<tbody class="stock-group">
|
||
{% for item in group %}
|
||
<tr>
|
||
{% if forloop.first %}
|
||
<td rowspan="{{ group|length }}">{{ item.variant.manufacturer }}</td>
|
||
<td rowspan="{{ group|length }}">{{ item.variant.product_type.name }}</td>
|
||
<th class="stock-color" scope="rowgroup" rowspan="{{ group|length }}"><div class="variant-preview">{% include "filament/variant_thumbnail.html" with variant=item.variant only %}<strong>{{ item.variant.color }}</strong></div></th>
|
||
{% endif %}
|
||
<td><span class="badge">{{ item.get_spool_type_display }}</span>{% if not item.variant.is_active %}<small class="warning">Deaktiviert</small>{% endif %}</td>
|
||
<td class="article-number">{{ item.variant.manufacturer_color_code|default:"–" }}</td>
|
||
<td class="quantity">{{ item.quantity }}</td>
|
||
{% if editable %}
|
||
<td class="actions">
|
||
<a class="button secondary consume-button" href="{% url 'inventory_consume' item.pk %}"
|
||
data-consume data-variant="{{ item.stock_description }}" data-quantity="{{ item.quantity }}" data-reorder-note="{{ item.reorder_spool_note }}"{% if not item.variant.is_active %} data-inactive{% endif %}>Spule verbraucht</a>
|
||
<a href="{% url 'inventory_edit' item.pk %}">Stückzahl ändern</a>
|
||
</td>
|
||
{% endif %}
|
||
</tr>
|
||
{% endfor %}
|
||
</tbody>
|
||
{% endfor %}
|
||
</table></div>
|