Manage free spools individually and allow discarding empties
This commit is contained in:
1 parent
fedd019854
commit
8ebfaa7e2a
15 files changed
+317
-162
No files matched your search
@@ -1,13 +1,13 @@
|
||||
{% extends "base.html" %}{% block title %}Entfernen · Fil-A-Management{% endblock %}
|
||||
{% block content %}
|
||||
<a class="back-link" href="{% if back_url %}{{ back_url }}{% else %}{% url back_name %}{% endif %}">← Zurück</a>
|
||||
<h1>Position wirklich entfernen?</h1>
|
||||
<h1>{{ heading|default:"Position wirklich entfernen?" }}</h1>
|
||||
<section class="panel form-panel">
|
||||
<p>{{ item }}</p>
|
||||
<p class="muted">Diese Position wird vollständig aus deiner Liste entfernt. Andere Personen sind nicht betroffen.</p>
|
||||
<form method="post" class="form-actions">
|
||||
{% csrf_token %}
|
||||
<button class="button danger" type="submit">Ja, entfernen</button>
|
||||
<button class="button danger" type="submit">{{ submit_label|default:"Ja, entfernen" }}</button>
|
||||
<a class="button secondary" href="{% if back_url %}{{ back_url }}{% else %}{% url back_name %}{% endif %}">Abbrechen</a>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
<p>Aktueller Bestand: <strong data-consume-count>{{ item.quantity }}</strong>. Eine Rolle wird abgezogen.</p>
|
||||
<p data-return-spool-note{% if not item.bambu_spool %} hidden{% endif %}>Eine Bambu-Lab-Leerrolle wird zurückgebucht.</p>
|
||||
<form method="post" data-consume-form>
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="quantity" value="{{ item.quantity|default:'' }}">
|
||||
<div class="discard-spool-option" data-discard-spool{% if item.spool_type != "spool" %} hidden{% endif %}>
|
||||
<label class="sharing-option"><input type="checkbox" name="discard_spool" value="1"{% if item.spool_type != "spool" %} disabled{% endif %}> Leerrolle wegwerfen</label>
|
||||
</div>
|
||||
<div class="consume-options">
|
||||
<button class="button secondary" type="submit" name="action" value="consume" autofocus>Keine neue Bestellung</button>
|
||||
<button class="button" type="submit" name="action" value="reorder" {% if item and not item.variant.is_active %}disabled{% endif %}>Neue Spule in die Bestellung legen</button>
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
{% block content %}
|
||||
<div class="page-heading">
|
||||
<div><h1>Mein Bestand</h1></div>
|
||||
<a class="button" href="{% url 'empty_spool_add' %}">+ Leerrolle hinzufügen</a>
|
||||
</div>
|
||||
{% include "filament/inventory_tabs.html" with active="spools" empty_count=quantity only %}
|
||||
<section class="panel" aria-labelledby="spool-stock-title">
|
||||
@@ -11,7 +12,7 @@
|
||||
<div class="spool-totals">
|
||||
<span class="badge">{{ quantity }} frei</span>
|
||||
<span class="badge">{{ in_use }} in Benutzung</span>
|
||||
<span class="badge">{{ total }} gesamt · {{ bambu_total }} Bambu Lab</span>
|
||||
<span class="badge">{{ total }} gesamt</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-wrap">
|
||||
@@ -23,16 +24,20 @@
|
||||
<th scope="col">Farbe</th>
|
||||
<th scope="col">Status</th>
|
||||
<th scope="col">Stück</th>
|
||||
<th scope="col"><span class="sr-only">Aktionen</span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Bambu Lab</td>
|
||||
{% for spool in free %}
|
||||
<tr class="spool-row--free">
|
||||
<td>{{ spool.brand_name }}</td>
|
||||
<td>–</td>
|
||||
<td>–</td>
|
||||
<td><span class="badge">Frei</span></td>
|
||||
<td class="quantity">{{ quantity }}</td>
|
||||
<td class="quantity">1</td>
|
||||
<td><a class="danger-link" href="{% url 'empty_spool_discard' spool.pk %}" aria-label="Leerrolle {{ spool.pk }} wegwerfen">Wegwerfen</a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% for item in mounted %}
|
||||
<tr class="spool-row--in-use">
|
||||
<td>{% if item.bambu_spool %}Bambu Lab{% else %}Andere Spule{% endif %}</td>
|
||||
@@ -43,21 +48,14 @@
|
||||
</div></td>
|
||||
<td><span class="badge">In Benutzung</span></td>
|
||||
<td class="quantity">{{ item.quantity }}</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% if not free and not mounted %}
|
||||
<tr><td colspan="6">Du hast noch keine Spulen im Bestand.</td></tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<details class="spool-stock-editor"{% if form.errors %} open{% endif %}>
|
||||
<summary>Freie Bambu-Lab-Spulen bearbeiten</summary>
|
||||
<form method="post" class="empty-spool-form">
|
||||
{% csrf_token %}{{ form.non_field_errors }}{{ form.expected_quantity }}{{ form.expected_quantity.errors }}
|
||||
<div class="field">
|
||||
{{ form.quantity.label_tag }}{{ form.quantity }}{{ form.quantity.errors }}
|
||||
</div>
|
||||
<button class="button" type="submit">Bestand speichern</button>
|
||||
</form>
|
||||
</details>
|
||||
</section>
|
||||
<p class="hint">Bambu-Lab-Spulen werden beim Verbrauch automatisch frei und können zum Aufziehen verwendet werden.</p>
|
||||
{% endblock %}
|
||||
@@ -6,16 +6,22 @@
|
||||
<div><h1>Auf Leerrolle aufziehen</h1><p class="muted">{{ item.stock_description }}</p></div>
|
||||
</div>
|
||||
<section class="panel form-panel">
|
||||
<p>Eine Bambu-Lab-Leerrolle wird abgebucht. Das Filament erscheint anschließend im Bestand <strong>Mit Spule</strong>.</p>
|
||||
<p>Die gewählte Leerrolle wird deinem Filament zugeordnet. Das Filament erscheint anschließend im Bestand <strong>Mit Spule</strong>.</p>
|
||||
<p>Verfügbare Leerrollen <strong>{{ empty_count }}</strong></p>
|
||||
<form method="post" class="form-actions">
|
||||
<form method="post">
|
||||
{% csrf_token %}{{ form.quantity }}{{ form.quantity.errors }}{{ form.non_field_errors }}
|
||||
{% if empty_count %}
|
||||
<div class="field">{{ form.spool.label_tag }}{{ form.spool }}{{ form.spool.errors }}</div>
|
||||
{% endif %}
|
||||
<div class="form-actions">
|
||||
{% if empty_count %}
|
||||
<button class="button" type="submit">Eine Rolle aufziehen</button>
|
||||
{% else %}
|
||||
<a class="button" href="{% url 'empty_spools' %}">Leerrollen erfassen</a>
|
||||
{{ form.spool.errors }}
|
||||
<a class="button" href="{% url 'empty_spool_add' %}">Leerrolle hinzufügen</a>
|
||||
{% endif %}
|
||||
<a class="button secondary" href="{% url 'inventory' %}">Abbrechen</a>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
{% endblock %}
|
||||
@@ -30,7 +30,7 @@
|
||||
{% 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.bambu_spool %} data-return-spool{% endif %}{% if not item.variant.is_active %} data-inactive{% endif %}>Spule verbraucht</a>
|
||||
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>
|
||||
|
||||
Reference in new issue
Block a user