101 lines
4.3 KiB
HTML
101 lines
4.3 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">Hier erscheint, was für den nächsten Einkauf wirklich relevant ist. Spätere Bedarfe bleiben erstmal ruhig vorgemerkt.</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="panel compact-form-panel">
|
|
<div class="panel-head">
|
|
<h2>Für den nächsten Einkauf</h2>
|
|
<span>{{ entries|length }} Einträge</span>
|
|
</div>
|
|
</section>
|
|
<section class="stack-list">
|
|
{% for entry in entries %}
|
|
<article class="list-row stacked-mobile roomy-row">
|
|
<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 %}
|
|
|
|
{% if upcoming_entries %}
|
|
<section class="panel">
|
|
<div class="panel-head">
|
|
<h2>Später gebraucht</h2>
|
|
<small>Einkaufstag: {{ shopping_weekday_label }}</small>
|
|
</div>
|
|
<div class="stack-list">
|
|
{% for entry in upcoming_entries %}
|
|
<article class="list-row stacked-mobile roomy-row">
|
|
<div>
|
|
<strong>{{ entry.item_name }}</strong>
|
|
<p class="muted">Wird ab {{ entry.activation_label }} in die Einkaufsliste übernommen</p>
|
|
<div class="chip-row">
|
|
<span class="chip">{{ entry.for_label }}</span>
|
|
<span class="chip">{{ entry.needed_for_label }}</span>
|
|
{% if entry.needed_daypart_name %}
|
|
<span class="chip status-soft">{{ entry.needed_daypart_name }}</span>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</article>
|
|
{% endfor %}
|
|
</div>
|
|
</section>
|
|
{% endif %}
|
|
{% endblock %}
|