show correct checkbox status
This commit is contained in:
parent
9238366137
commit
c5b21d1cef
3 changed files with 18 additions and 25 deletions
|
|
@ -16,36 +16,25 @@
|
|||
<button class="decrease">-</button>
|
||||
</div>
|
||||
<div class="checkboxes">
|
||||
{% 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 %}
|
||||
<input type="checkbox" checked>
|
||||
</label>
|
||||
<label class="ok">
|
||||
{% else %}
|
||||
<input type="checkbox">
|
||||
{% endif %}
|
||||
</label>
|
||||
<label class="ok">
|
||||
{% else %}
|
||||
<label class="bad">
|
||||
{% if loop.index as i32 <= food.actual_servings %}
|
||||
<input type="checkbox" checked>
|
||||
</label>
|
||||
<label class="bad">
|
||||
<input type="checkbox" checked>
|
||||
</label>
|
||||
<label class="bad">
|
||||
<input type="checkbox" checked>
|
||||
</label>
|
||||
<label class="bad">
|
||||
<input type="checkbox">
|
||||
</label>
|
||||
<label class="bad">
|
||||
<input type="checkbox">
|
||||
</label>
|
||||
<label class="bad">
|
||||
<input type="checkbox">
|
||||
</label>
|
||||
<label class="bad">
|
||||
<input type="checkbox">
|
||||
</label>
|
||||
<label class="bad">
|
||||
{% else %}
|
||||
<input type="checkbox">
|
||||
{% endif %}
|
||||
</label>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue