feat: Probably functional

This commit is contained in:
2026-04-09 14:06:19 +01:00
parent 5cf9895c79
commit 8c3c473ebf
10 changed files with 578 additions and 15 deletions

View File

@@ -0,0 +1,46 @@
<!DOCTYPE html>
<html>
<head>
<title>{{ drink.name }}</title>
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<div class="container">
<div class="card">
<h1>{{ drink.name }}</h1>
<p><strong>{{ "%.2f"|format(drink.price) }}€</strong></p>
<p class="muted">Stock: {{ drink.stock }}</p>
<p><strong>Pay to:</strong> {{ drink.phone_number }}</p>
</div>
{% if drink.stock > 0 %}
<div class="card">
<form method="POST" action="/drink/{{ drink.id }}/buy">
<label>
Your name:
<input list="names" name="name" required>
</label>
<datalist id="names">
{% for n in names %}
<option value="{{ n[0] }}"></option>
{% endfor %}
</datalist>
<label>
Quantity:
<input type="number" name="quantity" value="1" min="1" required>
</label>
<button class="button" type="submit">Take drink</button>
</form>
</div>
{% else %}
<p><strong>Out of stock</strong></p>
{% endif %}
<a class="button" href="/drinks">Back to list</a>
</div>
</body>
</html>