change layout settings for lebensmittel

This commit is contained in:
2026-04-14 11:04:38 +02:00
parent 6f6269c66d
commit 216dde1414
5 changed files with 168 additions and 14 deletions
+55
View File
@@ -38,6 +38,61 @@
{% endfor %}
</div>
{% if selected_items %}
<fieldset>
<legend>Schon ausgewählt</legend>
{% for item_id in form_data.item_ids %}
<input type="hidden" name="item_ids" value="{{ item_id }}">
{% endfor %}
<div class="selected-components-grid">
{% for item in selected_items %}
{% 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 %}
<article class="selected-component-card">
<button class="selected-component-remove" type="submit" name="remove_item_id" value="{{ item.id }}">
<span aria-hidden="true">×</span>
<span class="sr-only">{{ item.name }} entfernen</span>
</button>
<div class="selected-component-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="selected-component-fallback">
<span class="ui-icon {{ item_icon_class }}"></span>
</span>
{% endif %}
</div>
<div class="selected-component-main">
<strong>{{ item.name }}</strong>
</div>
</article>
{% endfor %}
</div>
</fieldset>
{% endif %}
<fieldset>
<legend>Einträge auswählen</legend>
<label>