2025-10-24 17:46:19 +02:00
|
|
|
<div class="card" id="card-{{ food.id }}">
|
2025-10-20 14:34:24 +02:00
|
|
|
<p class="food-name">
|
|
|
|
|
{{ food.name }}
|
|
|
|
|
</p>
|
|
|
|
|
<div class="card-inner">
|
|
|
|
|
<div class="amounts">
|
|
|
|
|
<p class="unit">
|
2025-10-24 23:08:23 +02:00
|
|
|
<!-- <sup>1</sup>⁄<sub>4</sub> Cup -->
|
|
|
|
|
{{ food.portion }}
|
2025-10-20 14:34:24 +02:00
|
|
|
</p>
|
|
|
|
|
<p class="kc">
|
|
|
|
|
{{ food.kc_per_serving }} kc
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="buttons">
|
2025-10-24 17:46:19 +02:00
|
|
|
<button class="increase" hx-post="/increase/{{ food.id }}" hx-target="#card-{{ food.id }}">+</button>
|
|
|
|
|
<button class="decrease" hx-post="/decrease/{{ food.id }}" hx-target="#card-{{ food.id }}">-</button>
|
2025-10-19 13:55:13 +02:00
|
|
|
</div>
|
2025-10-20 14:34:24 +02:00
|
|
|
<div class="checkboxes">
|
2025-10-24 17:17:08 +02:00
|
|
|
{% for counter in self::range(10) %}
|
|
|
|
|
{% if loop.index as i32 <= food.target_servings %}
|
2025-10-20 14:34:24 +02:00
|
|
|
<label class="ok">
|
2025-10-24 17:17:08 +02:00
|
|
|
{% if loop.index as i32 <= food.actual_servings %}
|
2025-10-25 13:56:39 +02:00
|
|
|
<input type="button" hx-post="/set/{{ food.id }}/to/{{ loop.index as i32 - 1}}" hx-target="#card-{{ food.id }}" value="●" class="checked">
|
2025-10-24 17:17:08 +02:00
|
|
|
{% else %}
|
2025-10-25 13:56:39 +02:00
|
|
|
<input type="button" hx-post="/set/{{ food.id }}/to/{{ loop.index as i32 }}" hx-target="#card-{{ food.id }}" value="●" class="unchecked">
|
2025-10-24 17:17:08 +02:00
|
|
|
{% endif %}
|
2025-10-20 14:34:24 +02:00
|
|
|
</label>
|
2025-10-24 17:17:08 +02:00
|
|
|
{% else %}
|
2025-10-20 14:34:24 +02:00
|
|
|
<label class="bad">
|
2025-10-24 17:17:08 +02:00
|
|
|
{% if loop.index as i32 <= food.actual_servings %}
|
2025-10-25 13:56:39 +02:00
|
|
|
<input type="button" hx-post="/set/{{ food.id }}/to/{{ loop.index as i32 - 1}}" hx-target="#card-{{ food.id }}" value="●" class="checked">
|
2025-10-24 17:17:08 +02:00
|
|
|
{% else %}
|
2025-10-25 13:56:39 +02:00
|
|
|
<input type="button" hx-post="/set/{{ food.id }}/to/{{ loop.index as i32 }}" hx-target="#card-{{ food.id }}" value="●" class="unchecked">
|
2025-10-24 17:17:08 +02:00
|
|
|
{% endif %}
|
2025-10-20 14:34:24 +02:00
|
|
|
</label>
|
2025-10-24 17:17:08 +02:00
|
|
|
{% endif %}
|
|
|
|
|
{% endfor %}
|
2025-10-20 14:34:24 +02:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-10-24 17:17:08 +02:00
|
|
|
</div>
|