Release Nouri 1.3.3 with shopping articles

This commit is contained in:
2026-05-01 14:32:30 +02:00
parent 6b2c495cf2
commit aff40eff49
10 changed files with 334 additions and 40 deletions
+28 -11
View File
@@ -13,11 +13,12 @@
<form method="post" class="shopping-add-form">
{{ csrf_input() }}
<label>
Lebensmittel suchen
Lebensmittel oder Artikel suchen
<input
type="text"
name="item_search"
placeholder="Nach Lebensmitteln suchen"
id="shopping-item-search"
placeholder="Nach Lebensmitteln oder Artikeln suchen"
autocomplete="off"
data-filter-input
data-filter-target="#shopping-food-options"
@@ -46,12 +47,15 @@
'seeds': 'icon-component-seeds',
'neutral': 'icon-component-neutral',
}.get(item.primary_builder_key or item.base_type, 'icon-component-neutral') %}
{% if item.kind == 'shopping' %}
{% set item_icon_class = 'icon-cart-shopping' %}
{% endif %}
<button
class="shopping-add-card"
type="submit"
name="item_id"
value="{{ item.id }}"
data-filter-label="{{ item.name|lower }} {{ item.category|default('', true)|lower }} {{ item.base_type_label|lower }} {{ item.availability_label|lower }}"
data-filter-label="{{ item.name|lower }} {{ item.category|default('', true)|lower }} {{ item.base_type_label|lower }} {{ item.availability_label|lower }} {% if item.kind == 'shopping' %}einkaufsartikel artikel drogerie haushalt{% endif %}"
>
<span class="shopping-add-card-visual">
{% if item.photo_filename %}
@@ -69,11 +73,17 @@
</span>
<span class="shopping-add-card-copy">
<strong>{{ item.name }}</strong>
<small>{{ item.availability_label }}</small>
<small>{% if item.kind == 'shopping' %}Einkaufsartikel{% else %}{{ item.availability_label }}{% endif %}</small>
</span>
</button>
{% endfor %}
</div>
<div class="shopping-create-actions" data-create-from="#shopping-item-search" hidden>
<input type="hidden" name="create_item_name" data-create-name>
<p class="muted">Kein passender Treffer? Direkt aus dem Suchbegriff anlegen:</p>
<button class="ghost-button" type="submit" name="create_as" value="food">Als Lebensmittel anlegen</button>
<button class="ghost-button" type="submit" name="create_as" value="shopping">Als Einkaufsartikel anlegen</button>
</div>
<button type="submit">Auf die Liste</button>
</form>
</section>
@@ -97,6 +107,9 @@
'seeds': 'icon-component-seeds',
'neutral': 'icon-component-neutral',
}.get(entry.primary_builder_key or entry.base_type, 'icon-component-neutral') %}
{% if entry.item_kind == 'shopping' %}
{% set entry_icon_class = 'icon-cart-shopping' %}
{% endif %}
<article class="shopping-entry-card">
<div class="shopping-entry-row">
<div
@@ -165,6 +178,8 @@
{% elif entry.needed_for_label %}
Für {{ entry.needed_for_label }}
{% if entry.needed_daypart_name %} · {{ entry.needed_daypart_name }}{% endif %}
{% elif entry.item_kind == 'shopping' %}
Einkaufsartikel
{% elif entry.is_home %}
Zuhause vorhanden
{% else %}
@@ -175,7 +190,7 @@
<button class="ghost-button" type="button" data-dialog-close>Schließen</button>
</div>
<div class="shopping-entry-dialog-actions">
{% if entry.can_edit %}
{% if entry.can_edit and entry.item_kind != 'shopping' %}
<a class="ghost-button" href="{{ url_for('main.item_edit', item_id=entry.item_id) }}">Bearbeiten</a>
{% endif %}
<form method="post" action="{{ url_for('main.shopping_check', entry_id=entry.id) }}">
@@ -201,21 +216,23 @@
{{ csrf_input() }}
<button class="ghost-button" type="submit">Von Einkaufsliste nehmen</button>
</form>
{% if entry.is_home %}
{% if entry.item_kind != 'shopping' and entry.is_home %}
<form method="post" action="{{ url_for('main.item_set_not_home', item_id=entry.item_id) }}">
{{ csrf_input() }}
<button class="ghost-button" type="submit">Nicht mehr da</button>
</form>
{% else %}
{% elif entry.item_kind != 'shopping' %}
<form method="post" action="{{ url_for('main.item_set_home', item_id=entry.item_id) }}">
{{ csrf_input() }}
<button class="ghost-button" type="submit">Als zuhause markieren</button>
</form>
{% endif %}
<form method="post" action="{{ url_for('main.item_archive', item_id=entry.item_id) }}">
{{ csrf_input() }}
<button class="ghost-button" type="submit">Archivieren</button>
</form>
{% if entry.item_kind != 'shopping' %}
<form method="post" action="{{ url_for('main.item_archive', item_id=entry.item_id) }}">
{{ csrf_input() }}
<button class="ghost-button" type="submit">Archivieren</button>
</form>
{% endif %}
{% endif %}
</div>
</div>