Files
Fil-A-Management/templates/filament/stock_table.html
T

43 lines
3.0 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<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 }}&amp;direction={{ column.next_direction }}{% if search %}&amp;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_label }}</strong></div></th>
{% endif %}
<td><span class="badge">{{ item.get_spool_type_display }}</span>{% if editable and item.bambu_spool %}<small class="stock-spool-brand">Bambu Lab</small>{% endif %}{% 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 item.spool_type == "spool" %} data-has-spool{% endif %}{% if not item.variant.is_active %} data-inactive{% endif %}>Spule verbraucht</a>
{% if item.spool_type == "refill" %}<a href="{% url 'inventory_mount' item.pk %}">Auf Leerrolle aufziehen</a>{% endif %}
<a href="{% url 'inventory_edit' item.pk %}">Bearbeiten</a>
</td>
{% endif %}
</tr>
{% endfor %}
</tbody>
{% endfor %}
</table></div>