checkbox behaviour
This commit is contained in:
parent
d1585409a2
commit
f5d758ed2d
4 changed files with 43 additions and 4 deletions
|
|
@ -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 %}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue