food-tracker/templates/index.html

47 lines
1.3 KiB
HTML
Raw Normal View History

2025-10-18 20:54:23 +02:00
<!DOCTYPE html>
<html lang="en">
2025-10-18 21:21:58 +02:00
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Food Tracker</title>
</head>
<body>
<main>
2025-10-18 22:12:51 +02:00
<table>
2025-10-18 21:21:58 +02:00
<tr>
<th>Portion</th>
<th>Lebensmittel</th>
<th>kc.</th>
<th>Servings (target)</th>
</tr>
{% for food in foods %}
<tr>
<td>{{ food.portion }}</td>
<td>{{ food.name }}</td>
<td style="text-align: right;">{{ food.kc_per_serving }}</td>
<td>
<progress max="{{food.target_servings}}" value="{{food.actual_servings}}" {% if food.actual_servings>
2025-10-18 22:12:51 +02:00
food.target_servings %}
style="accent-color: red;"
{% endif %}>
</progress>
2025-10-18 21:21:58 +02:00
{{ food.actual_servings }}/{{ food.target_servings }}
2025-10-18 22:12:51 +02:00
<form method="post" style="display: inline;">
<button formaction="/increase/{{ food.id }}">+</button>
<button formaction="/decrease/{{ food.id }}">-</button>
</form>
2025-10-18 21:21:58 +02:00
</td>
</tr>
2025-10-18 20:54:23 +02:00
{% endfor %}
2025-10-18 22:12:51 +02:00
<tr>
<th colspan=3 style="text-align: right;">kc.:</th>
<th style="text-align: left;">{{ sum }}</th>
</tr>
2025-10-18 21:21:58 +02:00
</table>
</main>
</body>
</html>