63 lines
3.2 KiB
HTML
63 lines
3.2 KiB
HTML
<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 %}
|
|
{% if field.name != "allow_alternative_spool" %}
|
|
<div class="field">{{ field.label_tag }}{{ field }}{{ field.errors }}{% if field.help_text %}<small>{{ field.help_text }}</small>{% endif %}</div>
|
|
{% endif %}
|
|
{% endfor %}
|
|
</div>
|
|
{% if form.for_order %}
|
|
<div class="order-alternative">
|
|
<label>{{ form.allow_alternative_spool }} {{ form.allow_alternative_spool.label }}</label>
|
|
<small>{{ form.allow_alternative_spool.help_text }}</small>
|
|
{{ form.allow_alternative_spool.errors }}
|
|
</div>
|
|
{% endif %}
|
|
{% if not legacy %}
|
|
<p class="hint">{% if form.for_inventory %}Wähle bei der Spulenausführung, wie die Rolle bei dir vorliegt.{% else %}Die gewünschte Spulenausführung ist verbindlich, solange du keine Alternative erlaubst.{% 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>
|