checkbox behaviour

This commit is contained in:
Khaïs COLIN 2025-10-24 22:57:21 +02:00
parent d1585409a2
commit f5d758ed2d
Signed by: logistic-bot
SSH key fingerprint: SHA256:RlpiqKeXpcPFZZ4y9Ou4xi2M8OhRJovIwDlbCaMsuAo
4 changed files with 43 additions and 4 deletions

View file

@ -20,17 +20,17 @@
{% if loop.index as i32 <= food.target_servings %}
<label class="ok">
{% if loop.index as i32 <= food.actual_servings %}
<input type="checkbox" checked>
<input type="checkbox" checked hx-post="/set/{{ food.id }}/to/{{ loop.index as i32 - 1}}" hx-target="#card-{{ food.id }}">
{% else %}
<input type="checkbox">
<input type="checkbox" hx-post="/set/{{ food.id }}/to/{{ loop.index as i32 }}" hx-target="#card-{{ food.id }}">
{% endif %}
</label>
{% else %}
<label class="bad">
{% if loop.index as i32 <= food.actual_servings %}
<input type="checkbox" checked>
<input type="checkbox" checked hx-post="/set/{{ food.id }}/to/{{ loop.index as i32 - 1}}" hx-target="#card-{{ food.id }}">
{% else %}
<input type="checkbox">
<input type="checkbox" hx-post="/set/{{ food.id }}/to/{{ loop.index as i32 }}" hx-target="#card-{{ food.id }}">
{% endif %}
</label>
{% endif %}