Add article copy icons to individual order lists

This commit is contained in:
Mikei386 committed 2026-11-26 21:50:29 +01:00
1 parent 6f2e322b74
commit 552a17fbc9
8 files changed
+79 -73

No files matched your search

@@ -0,0 +1,8 @@
{% if article %}
<div class="article-copy">
<span data-article-code>{{ article }}</span>
<button type="button" class="button secondary{% if icon_only %} article-copy-icon-button{% endif %}" data-copy-article aria-label="Artikelnummer {{ article }} kopieren" title="Artikelnummer kopieren" hidden>
{% if icon_only %}<span class="article-copy-icon" aria-hidden="true"></span>{% else %}<span data-copy-label>Kopieren</span>{% endif %}
</button>
</div>
{% else %}–{% endif %}
+2 -19
View File
@@ -7,14 +7,6 @@
<div><h1>Konsolidierte Bestellliste</h1><p class="muted">Offene Bestellwünsche aller Personen, zusammengezählt pro Variante.</p></div>
</div>
{% include "filament/list_search.html" with search_url="order_shopping_list" search_label="Nach einer oder mehreren Artikelnummern suchen" placeholder="Artikelnummern, z. B. 10100, 10604" %}
{% if shop_searches %}
<div class="order-shop-links" role="group" aria-label="Bambu-Lab-Shop-Suche">
{% for url in shop_searches %}
<a class="button secondary" href="{{ url }}" target="_blank" rel="noreferrer">Im Bambu-Shop suchen{% if shop_searches|length > 1 %} ({{ forloop.counter }}/{{ shop_searches|length }}){% endif %} ↗</a>
{% endfor %}
</div>
<p class="hint">Prüfe im Shop Farbe, Spulenausführung und Stückzahl anhand dieser Liste.</p>
{% endif %}
{% if variants %}
<section class="panel" aria-label="Offene Bestellwünsche">
<div class="panel-heading">
@@ -26,7 +18,6 @@
<thead><tr><th scope="col">Stück</th><th scope="col">Produktart</th><th scope="col">Farbe</th><th scope="col">Spulenausführung</th><th scope="col">Artikelnr.</th></tr></thead>
<tbody>
{% for variant in variants %}
{% with article=variant.manufacturer_color_code.strip %}
<tr>
<td class="quantity">{{ variant.order_quantity }}</td>
<td>{{ variant.product_type.name }}<small>{{ variant.manufacturer }}</small></td>
@@ -36,23 +27,15 @@
{% if variant.net_weight_g or variant.diameter_mm %}<small>{% if variant.net_weight_g %}{{ variant.net_weight_g }} g{% endif %}{% if variant.net_weight_g and variant.diameter_mm %} · {% endif %}{% if variant.diameter_mm %}{{ variant.diameter_mm }} mm{% endif %}</small>{% endif %}
{% if not variant.is_active %}<small class="warning">Katalogvariante deaktiviert</small>{% endif %}
</td>
<td class="article-number">
{% if article %}
<div class="article-copy">
<span id="order-article-{{ variant.pk }}">{{ article }}</span>
<button type="button" class="button secondary" data-copy-article="order-article-{{ variant.pk }}" aria-label="Artikelnummer {{ article }} kopieren" hidden>Kopieren</button>
</div>
{% else %}–{% endif %}
</td>
<td class="article-number">{% include "filament/order_article_number.html" with article=variant.manufacturer_color_code.strip only %}</td>
</tr>
{% endwith %}
{% endfor %}
</tbody>
</table>
</div>
<p class="sr-only" role="status" data-copy-status></p>
</section>
<script src="{% static 'filament/order_shopping_list.js' %}" defer></script>
<script src="{% static 'filament/order_article_copy.js' %}" defer></script>
{% else %}
<section class="panel"><div class="empty"><h2>{% if search %}Keine offenen Wünsche zu diesen Artikelnummern{% else %}Keine offenen Bestellwünsche{% endif %}</h2></div></section>
{% endif %}
+6 -1
View File
@@ -1,4 +1,5 @@
{% extends "base.html" %}
{% load static %}
{% block title %}Sammelbestellung · Fil-A-Management{% endblock %}
{% block content %}
<div class="page-heading">
@@ -27,7 +28,7 @@
<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 class="article-number">{% include "filament/order_article_number.html" with article=entry.variant.manufacturer_color_code.strip icon_only=True only %}</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 %}">
@@ -60,4 +61,8 @@
{% 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 %}
{% if groups %}
<p class="sr-only" role="status" data-copy-status></p>
<script src="{% static 'filament/order_article_copy.js' %}" defer></script>
{% endif %}
{% endblock %}