diff --git a/foods.db b/foods.db index fe9a9d8..8bd3002 100644 Binary files a/foods.db and b/foods.db differ 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 {