Preis-Eingabe auf europäisches Komma-Format normalisiert

- Neuer Artikel: Textfeld mit Placeholder 4,50 statt Dezimalpunkt
- Artikel bearbeiten: Preise mit Komma anzeigen und akzeptieren
- Backend: Komma vor float()-Konvertierung in Punkt umwandeln

Made-with: Cursor
This commit is contained in:
2026-03-22 17:04:30 +01:00
parent 5c8c4a947e
commit bd4664f23b
2 changed files with 14 additions and 6 deletions

View File

@@ -45,8 +45,8 @@
<td class="align-middle">{{ pos }}</td>
<td><input type="text" class="form-control" name="name_{{ pos }}" value="{{ prod['name'] }}"
required></td>
<td><input type="number" step="0.01" class="form-control" name="price_{{ pos }}"
value="{{ prod['price'] }}" required></td>
<td><input type="text" inputmode="decimal" class="form-control" name="price_{{ pos }}"
value="{{ '{:.2f}'.format(prod['price']).replace('.', ',') }}" required></td>
<td><input type="text" class="form-control" name="icon_{{ pos }}" value="{{ prod['icon'] }}"
required></td>
<td>
@@ -100,8 +100,8 @@
</div>
<div class="form-group col-md-2">
<label for="add_price">Preis (€)</label>
<input type="number" step="0.01" class="form-control" name="add_price" id="add_price" required
placeholder="4.50">
<input type="text" inputmode="decimal" class="form-control" name="add_price" id="add_price" required
placeholder="4,50">
</div>
<div class="form-group col-md-1">
<label for="add_icon">Icon</label>