implement basic multi-day support

This commit is contained in:
Khaïs COLIN 2025-10-28 20:26:30 +01:00
parent 4a3ffb5ac6
commit d7fc530201
Signed by: logistic-bot
SSH key fingerprint: SHA256:RlpiqKeXpcPFZZ4y9Ou4xi2M8OhRJovIwDlbCaMsuAo
10 changed files with 98 additions and 44 deletions

View file

@ -20,7 +20,7 @@
{% for counter in self::range(10) %}
{% if loop.index as i32 <= food.target_servings %}
<label class="ok">
{% if loop.index as i32 <= food.actual_servings %}
{% if loop.index as i32 <= food.servings_eaten %}
<input type="button" hx-post="/set/{{ food.id }}/to/{{ loop.index as i32 - 1}}" hx-target="#card-{{ food.id }}" value="●" class="checked">
{% else %}
<input type="button" hx-post="/set/{{ food.id }}/to/{{ loop.index as i32 }}" hx-target="#card-{{ food.id }}" value="●" class="unchecked">
@ -28,7 +28,7 @@
</label>
{% else %}
<label class="bad">
{% if loop.index as i32 <= food.actual_servings %}
{% if loop.index as i32 <= food.servings_eaten %}
<input type="button" hx-post="/set/{{ food.id }}/to/{{ loop.index as i32 - 1}}" hx-target="#card-{{ food.id }}" value="●" class="checked">
{% else %}
<input type="button" hx-post="/set/{{ food.id }}/to/{{ loop.index as i32 }}" hx-target="#card-{{ food.id }}" value="●" class="unchecked">