61 lines
3.9 KiB
HTML
61 lines
3.9 KiB
HTML
{% extends "base.html" %}
|
||
{% block title %}Sammelbestellung · Fil-A-Management{% endblock %}
|
||
{% block content %}
|
||
<div class="page-heading">
|
||
<div><h1>Sammelbestellung</h1><p class="muted">Bestellwünsche und Lieferstatus pro Person.</p></div>
|
||
<a class="button" href="{% url 'order_add' %}">+ Bestellwunsch hinzufügen</a>
|
||
</div>
|
||
<div class="stats">
|
||
<section class="stat"><span>Rollen insgesamt</span><strong>{{ total }}</strong></section>
|
||
<section class="stat"><span>Verschiedene Varianten</span><strong>{{ variant_count }}</strong></section>
|
||
<section class="stat"><span>Personen mit Bestellwünschen</span><strong>{{ groups|length }}</strong></section>
|
||
</div>
|
||
{% for username, entries in groups %}
|
||
<section class="panel">
|
||
<div class="panel-heading"><h2 id="order-person-{{ forloop.counter }}">Bestellwunsch · {{ username }}</h2></div>
|
||
<div class="table-wrap">
|
||
<table class="order-table" aria-labelledby="order-person-{{ forloop.counter }}">
|
||
<thead>
|
||
<tr><th>Stück</th><th>Produktart</th><th>Farbe</th><th title="Hersteller-Farbcode">Artikelnr.</th><th>Spulenausführung</th><th>Status</th>{% if entries.0.owner_id == user.pk %}<th><span class="sr-only">Aktionen</span></th>{% endif %}</tr>
|
||
</thead>
|
||
<tbody>
|
||
{% for entry in entries %}
|
||
<tr class="order-row order-row--{{ entry.status }}">
|
||
<td class="quantity">{{ entry.quantity }}</td>
|
||
<td>{{ entry.variant.product_type.name }}<small>{{ entry.variant.manufacturer }}</small></td>
|
||
<td><div class="variant-preview">{% include "filament/variant_thumbnail.html" with variant=entry.variant only %}<strong>{{ entry.variant.color_label }}</strong></div></td>
|
||
<td class="article-number">{{ entry.variant.manufacturer_color_code|default:"–" }}</td>
|
||
<td><span class="badge">{{ entry.variant.get_spool_type_display }}</span>{% if not entry.variant.is_active %}<small class="warning">Deaktiviert · Katalogvariante</small>{% endif %}</td>
|
||
<td>
|
||
<form class="order-status-form" method="post" action="{% url 'order_status' entry.pk %}">
|
||
{% csrf_token %}
|
||
<input type="hidden" name="expected_status" value="{{ entry.status }}">
|
||
<input type="hidden" name="expected_quantity" value="{{ entry.quantity }}">
|
||
<label class="sr-only" for="order-status-{{ entry.pk }}">Status für {{ username }} · {{ entry.variant }}</label>
|
||
<select id="order-status-{{ entry.pk }}" name="status">
|
||
{% for value, label in status_choices %}
|
||
<option value="{{ value }}"{% if value == entry.status %} selected{% endif %}>{% if value == "handed_over" %}Übergeben und einbuchen{% else %}{{ label }}{% endif %}</option>
|
||
{% endfor %}
|
||
</select>
|
||
<button class="button secondary" type="submit">Speichern</button>
|
||
</form>
|
||
</td>
|
||
{% if entry.owner_id == user.pk %}
|
||
<td class="actions">
|
||
{% if entry.is_pending %}
|
||
<a href="{% url 'order_edit' entry.pk %}">Ändern</a>
|
||
<a class="danger-link" href="{% url 'order_delete' entry.pk %}">Entfernen</a>
|
||
{% endif %}
|
||
</td>
|
||
{% endif %}
|
||
</tr>
|
||
{% endfor %}
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</section>
|
||
{% empty %}
|
||
<section class="panel"><div class="empty"><h2>Keine laufenden Bestellwünsche</h2><p>Neue Wünsche erscheinen hier nach Person sortiert.</p><a class="button" href="{% url 'order_add' %}">Bestellwunsch hinzufügen</a></div></section>
|
||
{% endfor %}
|
||
{% endblock %}
|