Files
Hellas-Wawi/wawi/templates/edit.html
Bjoern Welker 3dcbfecbe4 feat: add info field to articles for shop display
Added optional info text field to articles that can be managed in the backend and is displayed in the shop only when filled. The info appears in both card view and detail modal with an informative style.

- Added info column to items table with migration
- Updated backend edit form with textarea for info text
- Modified API to include info field in bestand response
- Enhanced shop frontend to display info badge when available

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-11 15:12:12 +01:00

56 lines
2.3 KiB
HTML
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{% extends "base.html" %}
{% block content %}
<div class="card form-card">
<h2>{{ "Artikel bearbeiten" if item else "Neuen Artikel anlegen" }}</h2>
<form method="post" enctype="multipart/form-data">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
<div class="form-grid">
<label>
Artikel
<input type="text" name="artikel" required value="{{ item.artikel if item else '' }}" />
</label>
<label>
Größe
<input type="text" name="groesse" required value="{{ item.groesse if item else '' }}" />
</label>
<label>
Preis (EUR)
<input type="number" name="preis" step="0.01" min="0" value="{{ item.preis if item else 0 }}" />
</label>
<label>
BildURL (optional)
<input type="text" name="bild_url" placeholder="/images/artikel.jpg" value="{{ item.bild_url if item else '' }}" />
</label>
<label>
Bild hochladen (optional)
<input type="file" name="bild_file" accept="image/*" />
</label>
<label style="display: flex; align-items: center; gap: 8px; padding-top: 8px;">
<input type="checkbox" name="sale" value="1" {% if item and item.sale %}checked{% endif %} style="width: auto; height: 18px;" />
<span style="color: var(--text);">Sale / Abverkauf 🔥</span>
</label>
<label style="grid-column: 1 / -1;">
Info-Text für Shop (optional)
<textarea name="info" rows="3" placeholder="z.B. Lieferzeit 2-3 Wochen, limitierte Auflage, etc.">{{ item.info if item and item.info else '' }}</textarea>
</label>
<label>
Soll
<input type="number" name="soll" min="0" value="{{ item.soll if item else 0 }}" />
</label>
<label>
Bestand
<input type="number" name="gezaehlt" min="0" value="{{ item.gezaehlt if item else 0 }}" />
</label>
<label>
Verkäufe
<input type="number" name="verkaeufe" min="0" value="{{ item.verkaeufe if item else 0 }}" />
</label>
</div>
<div class="form-actions">
<button class="btn btn-accent" type="submit">Speichern</button>
<a class="btn ghost" href="{{ url_for('bp.index') }}">Abbrechen</a>
</div>
</form>
</div>
{% endblock %}