feat: Added price updating

This commit is contained in:
2026-04-20 13:44:39 +01:00
parent d292791614
commit 2c89ab5e62
4 changed files with 51 additions and 4 deletions

View File

@@ -11,7 +11,7 @@
<div class="card">
<h2>{{ drink.name }}</h2>
<p>Price: {{ drink.price }}€</p>
<p>Price: {{ "%.2f"|format(drink.price) }}€</p>
<p>Stock: {{ drink.stock }}</p>
</div>
@@ -26,6 +26,17 @@
</form>
</div>
<div class="card">
<h3>Adjust price</h3>
<form method="POST" action="/drink/{{ drink.id }}/price">
<label>
New price:
<input type="number" step="0.01" name="price" required>
</label>
<button class="button" type="submit">Change price</button>
</form>
</div>
<div class="card">
<h3>Danger zone</h3>
<form method="POST" action="/drink/{{ drink.id }}/delete" onsubmit="return confirm('Delete this drink?');">