Improve inventory editing and shared equipment views
This commit is contained in:
1 parent
a85de26ee7
commit
84ed7da07f
19 files changed
+631
-206
No files matched your search
@@ -36,6 +36,14 @@
|
||||
</div>
|
||||
{% if groups %}
|
||||
{% include "filament/stock_table.html" with groups=groups columns=columns editable=True search=search only %}
|
||||
<dialog class="consume-dialog inventory-dialog" aria-labelledby="inventory-edit-title" data-inventory-dialog>
|
||||
<div class="inventory-dialog-heading">
|
||||
<h2 id="inventory-edit-title">Bestand bearbeiten</h2>
|
||||
<form method="dialog"><button class="button secondary" type="submit">Schließen</button></form>
|
||||
</div>
|
||||
<p data-inventory-dialog-status role="status"></p>
|
||||
<div data-inventory-dialog-content></div>
|
||||
</dialog>
|
||||
<dialog class="consume-dialog" aria-labelledby="consume-title" data-consume-dialog>
|
||||
<h2 id="consume-title">Spule verbraucht</h2>
|
||||
<p class="muted" data-consume-variant></p>
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}Bestand bearbeiten · Fil-A-Management{% endblock %}
|
||||
{% block content %}
|
||||
<a class="back-link" href="{% url 'inventory' %}">← Zurück zum Bestand</a>
|
||||
<div class="page-heading"><h1>Bestand bearbeiten</h1></div>
|
||||
<section class="panel form-panel variant-panel">
|
||||
{% include "filament/inventory_edit_form.html" %}
|
||||
</section>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,4 @@
|
||||
<div data-inventory-editor>
|
||||
<p class="muted">{{ item.stock_description }}</p>
|
||||
{% include "filament/variant_form.html" %}
|
||||
</div>
|
||||
@@ -5,11 +5,11 @@
|
||||
<span class="badge">{{ printer.manufacturer }}</span>
|
||||
<h3>{{ printer.model }}</h3>
|
||||
{% if printer.name %}<p class="muted">{{ printer.name }}</p>{% endif %}
|
||||
<div class="actions">
|
||||
{% if editable %}<div class="actions">
|
||||
<a href="{% url 'printer_edit' printer.pk %}">Bearbeiten</a>
|
||||
<a class="danger-link" href="{% url 'printer_delete' printer.pk %}">Entfernen</a>
|
||||
</div>
|
||||
{% include "filament/printer_equipment.html" with printer=printer only %}
|
||||
</div>{% endif %}
|
||||
{% include "filament/printer_equipment.html" with printer=printer editable=editable only %}
|
||||
</section>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
<div class="printer-equipment">
|
||||
<div class="printer-equipment-heading">
|
||||
{% if editable or printer.addons.all %}<div class="printer-equipment-heading">
|
||||
<h4>Zubehör</h4>
|
||||
<a href="{% url 'printer_equipment_add' printer.pk 'zubehoer' %}">+ Zubehör</a>
|
||||
</div>
|
||||
{% if editable %}<a href="{% url 'printer_equipment_add' printer.pk 'zubehoer' %}">+ Zubehör</a>{% endif %}
|
||||
</div>{% endif %}
|
||||
{% if printer.addons.all %}
|
||||
<ul class="printer-equipment-list">
|
||||
{% for item in printer.addons.all %}
|
||||
<li>
|
||||
<span>{{ item.quantity }} × {{ item.name }}</span>
|
||||
<div class="actions">
|
||||
{% if editable %}<div class="actions">
|
||||
<a href="{% url 'printer_equipment_edit' printer.pk 'zubehoer' item.pk %}" aria-label="{{ item.name }} bearbeiten">Bearbeiten</a>
|
||||
<a class="danger-link" href="{% url 'printer_equipment_delete' printer.pk 'zubehoer' item.pk %}" aria-label="{{ item.name }} entfernen">Entfernen</a>
|
||||
</div>
|
||||
</div>{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
<div class="printer-equipment-heading">
|
||||
{% if editable or printer.nozzles.all %}<div class="printer-equipment-heading">
|
||||
<h4>Düsen</h4>
|
||||
<a href="{% url 'printer_equipment_add' printer.pk 'duesen' %}">+ Düse</a>
|
||||
</div>
|
||||
{% if editable %}<a href="{% url 'printer_equipment_add' printer.pk 'duesen' %}">+ Düse</a>{% endif %}
|
||||
</div>{% endif %}
|
||||
{% if printer.nozzles.all %}
|
||||
<ul class="printer-equipment-list">
|
||||
{% for item in printer.nozzles.all %}
|
||||
@@ -29,10 +29,10 @@
|
||||
<span class="badge">{{ item.get_hotend_type_display }}</span>
|
||||
{% if item.description %}<small class="muted">{{ item.description }}</small>{% endif %}
|
||||
</div>
|
||||
<div class="actions">
|
||||
{% if editable %}<div class="actions">
|
||||
<a href="{% url 'printer_equipment_edit' printer.pk 'duesen' item.pk %}" aria-label="{{ item }} bearbeiten">Bearbeiten</a>
|
||||
<a class="danger-link" href="{% url 'printer_equipment_delete' printer.pk 'duesen' item.pk %}" aria-label="{{ item }} entfernen">Entfernen</a>
|
||||
</div>
|
||||
</div>{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
@@ -7,6 +7,6 @@
|
||||
<h1>Meine Drucker</h1>
|
||||
<a class="button" href="{% url 'printer_add' %}">+ Drucker hinzufügen</a>
|
||||
</div>
|
||||
{% include "filament/printer_cards.html" with printers=printers only %}
|
||||
{% include "filament/printer_cards.html" with printers=printers editable=True only %}
|
||||
</section>
|
||||
{% endblock %}
|
||||
@@ -32,6 +32,6 @@
|
||||
<h2>Meine Drucker</h2>
|
||||
<a class="button" href="{% url 'printer_add' %}">+ Drucker hinzufügen</a>
|
||||
</div>
|
||||
{% include "filament/printer_cards.html" with printers=printers only %}
|
||||
{% include "filament/printer_cards.html" with printers=printers editable=True only %}
|
||||
</section>
|
||||
{% endblock %}
|
||||
@@ -1,44 +1,6 @@
|
||||
{% extends "base.html" %}{% block title %}{{ title }} · Fil-A-Management{% endblock %}{% block content %}
|
||||
<a class="back-link" href="{% url back_name %}">← Zurück</a><div class="page-heading"><div><p class="eyebrow">AUS DEM GEMEINSAMEN KATALOG</p><h1>{{ title }}</h1><p class="muted">Wähle eine Variante für {{ destination }} oder suche nach ihrer Artikelnummer.</p></div></div>
|
||||
<section class="panel form-panel variant-panel"><form method="post" data-catalog-form>{% csrf_token %}{{ form.non_field_errors }}
|
||||
<details class="article-search"{% if lookup.is_bound %} open{% endif %}>
|
||||
<summary>Nach Artikelnummer suchen <span class="muted">(optional)</span></summary>
|
||||
<div class="field">
|
||||
{{ lookup.article_number.label_tag }}
|
||||
<div class="article-lookup">
|
||||
{{ lookup.article_number }}
|
||||
<button class="button secondary" type="submit" name="action" value="lookup" formnovalidate data-article-lookup>Variante suchen</button>
|
||||
</div>
|
||||
{{ lookup.article_number.errors }}
|
||||
</div>
|
||||
{% if matches %}
|
||||
<div class="field">
|
||||
<label for="article-variant">Mehrere Varianten gefunden</label>
|
||||
<div class="article-lookup">
|
||||
<select id="article-variant" name="article_variant">
|
||||
<option value="">Variante auswählen</option>
|
||||
{% for variant in matches %}
|
||||
<option value="{{ variant.pk }}">{{ variant }}{% if variant.net_weight_g %} · {{ variant.net_weight_g }} g{% endif %}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<button class="button secondary" type="submit" name="action" value="pick" formnovalidate>Auswahl übernehmen</button>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</details>
|
||||
<div class="form-grid">{% for field in form %}<div class="field">{{ field.label_tag }}{{ field }}{{ field.errors }}{% if field.help_text %}<small>{{ field.help_text }}</small>{% endif %}</div>{% endfor %}</div>
|
||||
<p class="hint">{% if form.for_inventory %}Wähle bei der Spulenausführung, wie die Rolle bei dir vorliegt.{% else %}Jede Auswahl grenzt die folgenden Optionen ein. Nur aktive, angelegte Varianten sind wählbar.{% endif %}</p>
|
||||
<div class="form-actions">
|
||||
<button class="button secondary"
|
||||
type="submit"
|
||||
name="action"
|
||||
value="filter"
|
||||
formnovalidate
|
||||
data-filter-button>Auswahl aktualisieren</button><button class="button" type="submit">Hinzufügen</button>
|
||||
</div>
|
||||
<noscript>
|
||||
<p>Nach jeder Dropdown-Auswahl bitte „Auswahl aktualisieren“ drücken.</p>
|
||||
</noscript>
|
||||
</form>
|
||||
<section class="panel form-panel variant-panel">
|
||||
{% include "filament/variant_form.html" %}
|
||||
</section>
|
||||
{% endblock %}
|
||||
@@ -6,16 +6,12 @@
|
||||
<section class="panel shared-member">
|
||||
<div class="panel-heading"><h2>{{ member.username }}</h2></div>
|
||||
{% if member.groups %}
|
||||
{% include "filament/stock_table.html" with groups=member.groups only %}
|
||||
{% include "filament/stock_table.html" with groups=member.groups columns=columns only %}
|
||||
{% endif %}
|
||||
{% if member.printers %}
|
||||
<div class="shared-printers">
|
||||
<h3>Drucker</h3>
|
||||
<ul>
|
||||
{% for printer in member.printers %}
|
||||
<li>{{ printer.manufacturer }} {{ printer.model }}{% if printer.name %} <small>· {{ printer.name }}</small>{% endif %}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% include "filament/printer_cards.html" with printers=member.printers only %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</section>
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
<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 %}
|
||||
<a href="{% url 'inventory_edit' item.pk %}">Bearbeiten</a>
|
||||
<a href="{% url 'inventory_edit' item.pk %}" data-inventory-edit>Bearbeiten</a>
|
||||
</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
<form method="post"{% if editing %} action="{% url 'inventory_edit' item.pk %}"{% endif %}{% if not legacy %} data-catalog-form{% endif %}>
|
||||
{% csrf_token %}
|
||||
{{ form.non_field_errors }}
|
||||
{% for field in form.hidden_fields %}{{ field }}{{ field.errors }}{% endfor %}
|
||||
{% if not legacy %}
|
||||
{% if form.for_inventory %}
|
||||
<div class="article-search article-search-visible">
|
||||
{% else %}
|
||||
<details class="article-search"{% if lookup.is_bound %} open{% endif %}>
|
||||
<summary>Nach Artikelnummer suchen <span class="muted">(optional)</span></summary>
|
||||
{% endif %}
|
||||
<div class="field">
|
||||
{{ lookup.article_number.label_tag }}
|
||||
<div class="article-lookup">
|
||||
{{ lookup.article_number }}
|
||||
<button class="button secondary" type="submit" name="action" value="lookup" formnovalidate data-article-lookup>Variante suchen</button>
|
||||
</div>
|
||||
{{ lookup.article_number.errors }}
|
||||
</div>
|
||||
{% if matches %}
|
||||
<div class="field">
|
||||
<label for="article-variant">Mehrere Varianten gefunden</label>
|
||||
<div class="article-lookup">
|
||||
<select id="article-variant" name="article_variant">
|
||||
<option value="">Variante auswählen</option>
|
||||
{% for variant in matches %}
|
||||
<option value="{{ variant.pk }}">{{ variant }}{% if variant.net_weight_g %} · {{ variant.net_weight_g }} g{% endif %}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<button class="button secondary" type="submit" name="action" value="pick" formnovalidate>Auswahl übernehmen</button>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if form.for_inventory %}</div>{% else %}</details>{% endif %}
|
||||
{% endif %}
|
||||
<div class="form-grid">
|
||||
{% for field in form.visible_fields %}
|
||||
<div class="field">{{ field.label_tag }}{{ field }}{{ field.errors }}{% if field.help_text %}<small>{{ field.help_text }}</small>{% endif %}</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% if not legacy %}
|
||||
<p class="hint">{% if form.for_inventory %}Wähle bei der Spulenausführung, wie die Rolle bei dir vorliegt.{% else %}Jede Auswahl grenzt die folgenden Optionen ein. Nur aktive, angelegte Varianten sind wählbar.{% endif %}</p>
|
||||
{% endif %}
|
||||
<div class="form-actions">
|
||||
{% if not legacy %}
|
||||
<button class="button secondary" type="submit" name="action" value="filter" formnovalidate data-filter-button>Auswahl aktualisieren</button>
|
||||
{% endif %}
|
||||
<button class="button" type="submit" data-catalog-save>{% if editing %}Speichern{% else %}Hinzufügen{% endif %}</button>
|
||||
</div>
|
||||
{% if not legacy %}
|
||||
<noscript><p>Nach jeder Dropdown-Auswahl bitte „Auswahl aktualisieren“ drücken.</p></noscript>
|
||||
{% endif %}
|
||||
</form>
|
||||
Reference in new issue
Block a user