46 lines
3.5 KiB
HTML
46 lines
3.5 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 %}{% if shared_member_id %}&member={{ shared_member_id }}#bestand-{{ shared_member_id }}{% 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 }}{% if editable and item.reserved_quantity %}<small class="stock-marketplace-note"><a href="{% url 'marketplace' %}">{{ item.reserved_quantity }} auf Marktplatz reserviert</a><br>{{ item.available_quantity }} frei verfügbar</small>{% endif %}</td>
|
||
{% if editable %}
|
||
<td class="actions">
|
||
{% if item.available_quantity %}
|
||
<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.reorder_variant %} data-inactive{% endif %}>Spule verbraucht</a>
|
||
{% if item.spool_type == "refill" %}<a href="{% url 'inventory_mount' item.pk %}">Auf Leerrolle aufziehen</a>{% endif %}
|
||
{% endif %}
|
||
<a href="{% url 'inventory_edit' item.pk %}" data-inventory-edit>Bearbeiten</a>
|
||
{% if item.available_quantity %}<a href="{% url 'marketplace_offer' item.pk %}">Auf Marktplatz anbieten</a>{% endif %}
|
||
</td>
|
||
{% endif %}
|
||
</tr>
|
||
{% endfor %}
|
||
</tbody>
|
||
{% endfor %}
|
||
</table></div>
|