Refine planner filters and compact selection cards

This commit is contained in:
2026-04-14 09:15:46 +02:00
parent c5dea16c53
commit 6f6269c66d
13 changed files with 451 additions and 108 deletions
+38 -3
View File
@@ -51,11 +51,46 @@
<h3>{{ group["title"] }}</h3>
<span>{{ group["items"]|length }} Einträge</span>
</div>
<div class="checkbox-grid">
<div class="checkbox-grid package-option-grid">
{% for item in group["items"] %}
<label class="check-option" data-filter-label="{{ item.name|lower }} {{ item.category|default('', true)|lower }}">
{% if item.kind == 'meal' %}
{% set item_icon_class = {
'breakfast': 'icon-daypart-breakfast',
'lunch': 'icon-daypart-lunch',
'dinner': 'icon-daypart-dinner',
'snack': 'icon-daypart-afternoon-snack',
}.get(item.meal_type, 'icon-utensils') %}
{% else %}
{% set item_icon_class = {
'protein': 'icon-component-protein',
'carb': 'icon-component-carb',
'veg': 'icon-component-veg',
'fruit': 'icon-component-fruit',
'dairy': 'icon-component-dairy',
'nuts': 'icon-component-nuts',
'seeds': 'icon-component-seeds',
'neutral': 'icon-component-neutral',
}.get(item.primary_builder_key or item.base_type, 'icon-component-neutral') %}
{% endif %}
<label class="set-item-option" data-filter-label="{{ item.name|lower }} {{ item.category|default('', true)|lower }}">
<input type="checkbox" name="item_ids" value="{{ item.id }}" {% if item.id in form_data.item_ids %}checked{% endif %}>
<span>{{ item.name }} · {{ item_kind_labels[item.kind] }} · {{ item.visibility_label }} · {{ item.for_label }}</span>
<span class="set-item-option-card">
<span class="set-item-option-visual">
{% if item.photo_filename %}
<img
src="{{ image_url(item.photo_filename, 'md') }}"
srcset="{{ image_srcset(item.photo_filename) }}"
sizes="{{ image_sizes('grid') }}"
alt="{{ item.name }}"
loading="lazy">
{% else %}
<span class="set-item-option-fallback">
<span class="ui-icon {{ item_icon_class }}"></span>
</span>
{% endif %}
</span>
<span class="set-item-option-label">{{ item.name }}</span>
</span>
</label>
{% endfor %}
</div>