From e05a4d0ccd9448495733d7850e8c41af0b1c42fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kha=C3=AFs=20COLIN?= Date: Sun, 19 Oct 2025 13:55:13 +0200 Subject: [PATCH] put food card in separate template --- foods.db | Bin 8192 -> 8192 bytes templates/food.html | 23 +++++++++++++++++++++++ templates/index.html | 24 +----------------------- 3 files changed, 24 insertions(+), 23 deletions(-) create mode 100644 templates/food.html diff --git a/foods.db b/foods.db index 3776fcc0dc237e24ff3a6c008bc05b810260b5f7..218fe6a7f06327c46050635cfae174a626ba2231 100644 GIT binary patch delta 17 YcmZp0XmFSy&6qk-#+fm7W5NP?05dWLxBvhE delta 17 YcmZp0XmFSy&6qq<#+fmBW5NP?05cQ?v;Y7A diff --git a/templates/food.html b/templates/food.html new file mode 100644 index 0000000..348ac28 --- /dev/null +++ b/templates/food.html @@ -0,0 +1,23 @@ +
+
+

+ {{ food.name }} +

+ {{ food.portion }} ({{ food.kc_per_serving }} kc.) +
+ + food.target_servings %} + style="accent-color: red;" + {% endif %}> + + {{ food.actual_servings }}/{{ food.target_servings }} +
+
+
+
+ + +
+
+
\ No newline at end of file diff --git a/templates/index.html b/templates/index.html index 5b6b573..435e279 100644 --- a/templates/index.html +++ b/templates/index.html @@ -12,29 +12,7 @@
{% for food in foods %} -
-
-

- {{ food.name }} -

- {{ food.portion }} ({{ food.kc_per_serving }} kc.) -
- - food.target_servings %} - style="accent-color: red;" - {% endif %}> - - {{ food.actual_servings }}/{{ food.target_servings }} -
-
-
-
- - -
-
-
+ {% include "food.html" %} {% endfor %}
Total: {{ sum }} kc.