From 5bfcb3ea9a137fb16f359fc90390088ffd0947cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kha=C3=AFs=20COLIN?= Date: Sat, 8 Nov 2025 19:03:58 +0100 Subject: [PATCH 1/3] update food data --- foods.db | Bin 16384 -> 16384 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/foods.db b/foods.db index fe9a9d833d6b0e3a063a27e90081549d823547a3..eea241d3f1cca8cb66bf79051368d31718ed1b3c 100644 GIT binary patch delta 1486 zcmZo@U~Fh$oFL73d!mdp>umQ6$?|dY z{^EVfdz1GB?{?m$yi<6ad5d@xc>Q_pd3AZEdAT+l3OwhY>?(7#p1+Jmk&)BLz{phB z&`{UFf@(0|SFDH#dW{IuoZf6UaUKMhecQ z1#UU1nZ?N&`febS;e>LUS!zmh3d0Ez<`xFtlMFmyuP`t$*m7|*hz3KfhPW`bq-3(O ztb!O+3mfwb2TpDVX-AMR*f}QG$SO}>tINS};~_!B*)~pdQt)b?A#2}fhcmy`bGH}JS@s-2FYm_sYb9!a$pC?l`-RlC^l{e z=~TELlgW8RJfQj#iJ@Q z<%mNQ;EO>MV2?(1m}wN60_I3G0nP|yfqGp76V7mC5nTflj!-lKrVum%u3%JaO#;vq WaQmVOu)Cw`Ftz|I*u2%wn-Ks*z8>iS delta 985 zcmZo@U~Fh$oFL73aiWYf>qQ2=E}@Mn3;3Bu_@+!|7tq|CXducn*;VG~WPM$B$rKU0 z4adGO*!s4Yxg~&$he0%$k&#iFk)3^Vh_0q4Gm~#Bq_+q z!6D7a$iZZ&5L}Y2=bGuQoSbA~Xl|Oq&f=rS%*`Mw4+>vKMkYfAS0A6$%)H{n+|)cd zW|)NxtgIEh2N|S9ZNVmSfJ_SUi7HLbPA$?=Fy-ZD5Vd7wWRYfMWSo3JN3Na$W Date: Sat, 8 Nov 2025 19:23:10 +0100 Subject: [PATCH 2/3] display weight --- src/get_food.sql | 3 ++- src/get_foods.sql | 3 ++- src/main.rs | 2 ++ templates/food.html | 6 +----- templates/index.html | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/get_food.sql b/src/get_food.sql index 1ecae7c..4f82d53 100644 --- a/src/get_food.sql +++ b/src/get_food.sql @@ -5,7 +5,8 @@ SELECT kc_per_serving, target_servings, coalesce(day_serving.servings_eaten, 0), - color + color, + portion_weight FROM food LEFT JOIN diff --git a/src/get_foods.sql b/src/get_foods.sql index d41351a..346cf46 100644 --- a/src/get_foods.sql +++ b/src/get_foods.sql @@ -5,7 +5,8 @@ SELECT food.kc_per_serving, food.target_servings, coalesce(day_serving.servings_eaten, 0) as servings_eaten, - food.color + food.color, + food.portion_weight FROM food LEFT JOIN diff --git a/src/main.rs b/src/main.rs index 91d3f0e..64ac0cf 100644 --- a/src/main.rs +++ b/src/main.rs @@ -58,6 +58,7 @@ struct Food { target_servings: i32, servings_eaten: i32, color: String, + portion_weight: i32, } impl Food { @@ -71,6 +72,7 @@ impl Food { target_servings: row.get(4)?, servings_eaten: row.get(5)?, color: row.get(6)?, + portion_weight: row.get(7)?, }) } } diff --git a/templates/food.html b/templates/food.html index f3656fb..667a042 100644 --- a/templates/food.html +++ b/templates/food.html @@ -6,16 +6,12 @@

- {{ food.portion }} + {{ food.portion }} ({{ food.portion_weight }} g)

{{ food.kc_per_serving }} kc

-
- - -
{% for counter in self::range(10) %} {% if loop.index as i32 <= food.target_servings %} diff --git a/templates/index.html b/templates/index.html index 1bec764..2ffcf50 100644 --- a/templates/index.html +++ b/templates/index.html @@ -92,7 +92,7 @@ } .amounts { - width: 4em; + width: 8em; } .increase { From 4bd605f92a66a3fb4b6f117d8d133f8409367854 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kha=C3=AFs=20COLIN?= Date: Sat, 8 Nov 2025 19:32:07 +0100 Subject: [PATCH 3/3] update name of food --- foods.db | Bin 16384 -> 16384 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/foods.db b/foods.db index eea241d3f1cca8cb66bf79051368d31718ed1b3c..8bd3002f2008be857c371600528167aa6fd6b196 100644 GIT binary patch delta 65 zcmZo@U~Fh$oFL73XQGTV^CY^UqV=D^9#AniDLjjpn+LTX8} io(-FFnptW}a*B