Files
nouri-App/nouri/templates/shopping/list.html
T

69 lines
2.9 KiB
HTML

{% extends "base.html" %}
{% block title %}Einkaufsliste | Nouri{% endblock %}
{% block content %}
<section class="page-intro">
<div>
<p class="eyebrow">Einkaufsliste</p>
<h1>Was noch mitkommen soll</h1>
<p class="lead">Fehlende Lebensmittel aus einer Mahlzeit landen jetzt einzeln hier. So bleibt die Liste konkret und alltagsnah.</p>
</div>
</section>
<section class="panel compact-form-panel">
<form method="post" class="inline-form">
{{ csrf_input() }}
<select name="item_id">
<option value="">Bestehenden Eintrag hinzufügen</option>
{% for item in addable_items %}
<option value="{{ item.id }}">
{{ item.name }} · {{ item_kind_labels[item.kind] }} · {{ item.visibility_label }}
{% if item.availability_state == 'home' %} · zuhause{% endif %}
</option>
{% endfor %}
</select>
<button type="submit">Auf Liste setzen</button>
</form>
</section>
{% if entries %}
<section class="stack-list">
{% for entry in entries %}
<article class="list-row stacked-mobile">
<div>
<strong>{{ entry.item_name }}</strong>
<p class="muted">{{ item_kind_labels[entry.item_kind] }}</p>
<div class="chip-row">
<span class="chip">{{ entry.visibility_label }}</span>
<span class="chip status-soft">{{ entry.owner_label }}</span>
<span class="chip">{{ entry.for_label }}</span>
{% if entry.needed_for_label %}
<span class="chip status-home">
Für {{ entry.needed_for_label }}
{% if entry.needed_daypart_name %} · {{ entry.needed_daypart_name }}{% endif %}
</span>
{% endif %}
</div>
</div>
<div class="row-actions">
<form method="post" action="{{ url_for('main.shopping_check', entry_id=entry.id) }}">
{{ csrf_input() }}
<button type="submit">Eingekauft</button>
</form>
{% if entry.can_edit %}
<form method="post" action="{{ url_for('main.shopping_remove', entry_id=entry.id) }}">
{{ csrf_input() }}
<button class="ghost-button" type="submit">Entfernen</button>
</form>
{% endif %}
</div>
</article>
{% endfor %}
</section>
{% else %}
<section class="panel empty-panel">
<h2>Die Liste ist gerade frei</h2>
<p>Einträge aus Lebensmitteln, Vorlagen oder kleinen Paketen lassen sich jederzeit wieder hinzufügen.</p>
</section>
{% endif %}
{% endblock %}