47 lines
1.4 KiB
HTML
47 lines
1.4 KiB
HTML
<!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>
|