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?');">

View File

@@ -19,6 +19,7 @@
<th>Drink</th>
<th>User</th>
<th>Qty</th>
<th>Value</th>
<th>Time</th>
</tr>
</thead>
@@ -28,6 +29,7 @@
<td>{{ t.drink_name }}</td>
<td>{{ t.user_name }}</td>
<td>{{ t.quantity }}</td>
<td>{{ "%.2f"|format(t.cost) }}€</td>
<td class="muted">
{{ t.timestamp.strftime("%Y-%m-%d %H:%M") }}
</td>