v0.2 planning and ux improvements
This commit is contained in:
@@ -58,20 +58,56 @@
|
||||
{% if kind == 'meal' %}
|
||||
<fieldset>
|
||||
<legend>Bestandteile der Mahlzeitenidee</legend>
|
||||
<div class="checkbox-grid">
|
||||
{% for food in foods %}
|
||||
<label class="check-option">
|
||||
<input type="checkbox" name="component_ids" value="{{ food.id }}" {% if food.id in form_data.component_ids %}checked{% endif %}>
|
||||
<span>{{ food.name }}</span>
|
||||
<p class="muted">Optional: Du kannst eine Mahlzeit frei als Idee anlegen oder sie aus vorhandenen und archivierten Lebensmitteln zusammenklicken.</p>
|
||||
{% if food_groups %}
|
||||
<div class="stack-sections">
|
||||
{% for group in food_groups %}
|
||||
<div class="component-group">
|
||||
<div class="panel-head">
|
||||
<h3>{{ group["title"] }}</h3>
|
||||
<span>{{ group["items"]|length }} Einträge</span>
|
||||
</div>
|
||||
<div class="checkbox-grid">
|
||||
{% for food in group["items"] %}
|
||||
<label class="check-option">
|
||||
<input type="checkbox" name="component_ids" value="{{ food.id }}" {% if food.id in form_data.component_ids %}checked{% endif %}>
|
||||
<span>{{ food.name }}</span>
|
||||
</label>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
<p class="empty-state">Lege zuerst ein paar Lebensmittel an, damit du daraus Mahlzeitenideen bauen kannst.</p>
|
||||
{% endif %}
|
||||
<div class="quick-food-panel">
|
||||
<div class="panel-head">
|
||||
<h3>Neues Lebensmittel direkt anlegen</h3>
|
||||
<span>ohne die Seite zu verlassen</span>
|
||||
</div>
|
||||
<div class="quick-food-grid">
|
||||
<label>
|
||||
Name
|
||||
<input type="text" name="quick_food_name" value="{{ form_data.quick_food_name }}" placeholder="z. B. Hüttenkäse">
|
||||
</label>
|
||||
{% endfor %}
|
||||
<label>
|
||||
Kategorie
|
||||
<input type="text" name="quick_food_category" value="{{ form_data.quick_food_category }}" list="category-list" placeholder="z. B. Milchprodukt">
|
||||
</label>
|
||||
<label class="wide">
|
||||
Notiz
|
||||
<input type="text" name="quick_food_note" value="{{ form_data.quick_food_note }}" placeholder="Optional">
|
||||
</label>
|
||||
<button type="submit" name="form_action" value="quick_add_food" class="secondary">Lebensmittel anlegen und übernehmen</button>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
{% endif %}
|
||||
|
||||
<div class="form-actions">
|
||||
<button type="submit">Speichern</button>
|
||||
<a class="ghost-button" href="{{ url_for('main.item_list', kind=kind) }}">Zurueck</a>
|
||||
<button type="submit" name="form_action" value="save_item">Speichern</button>
|
||||
<a class="ghost-button" href="{{ url_for('main.item_list', kind=kind) }}">Zurück</a>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
@@ -5,11 +5,41 @@
|
||||
<div>
|
||||
<p class="eyebrow">{{ item_kind_labels[kind] }}</p>
|
||||
<h1>{{ item_kind_labels[kind] }}</h1>
|
||||
<p class="lead">Schnell gepflegte Eintraege mit Foto, Tageszeiten und einem ruhigen Status zwischen Idee, Zuhause und Archiv.</p>
|
||||
<p class="lead">Schnell gepflegte Einträge mit Foto, Tageszeiten und einem ruhigen Status zwischen Merkliste, Zuhause und Archiv.</p>
|
||||
</div>
|
||||
<a class="button" href="{{ url_for('main.item_create', kind=kind) }}">Neu anlegen</a>
|
||||
</section>
|
||||
|
||||
<section class="panel compact-form-panel">
|
||||
<form method="get" class="filter-form">
|
||||
<label class="wide">
|
||||
Suche
|
||||
<input type="text" name="q" value="{{ query }}" placeholder="Nach Namen suchen">
|
||||
</label>
|
||||
<label>
|
||||
Status
|
||||
<select name="state">
|
||||
{% for value, label in state_options %}
|
||||
<option value="{{ value }}" {% if selected_state == value %}selected{% endif %}>{{ label }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</label>
|
||||
<label>
|
||||
Tageszeit
|
||||
<select name="daypart_id">
|
||||
<option value="">Alle Tageszeiten</option>
|
||||
{% for daypart in dayparts %}
|
||||
<option value="{{ daypart.id }}" {% if selected_daypart_id == daypart.id %}selected{% endif %}>{{ daypart.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</label>
|
||||
<div class="filter-actions">
|
||||
<button type="submit">Filtern</button>
|
||||
<a class="ghost-button" href="{{ url_for('main.item_list', kind=kind) }}">Zurücksetzen</a>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
{% if items %}
|
||||
<section class="card-grid">
|
||||
{% for item in items %}
|
||||
@@ -47,6 +77,7 @@
|
||||
</div>
|
||||
<div class="item-actions">
|
||||
<a class="ghost-button" href="{{ url_for('main.item_edit', item_id=item.id) }}">Bearbeiten</a>
|
||||
<a class="ghost-button" href="{{ url_for('main.planner_day', date=today.isoformat(), item_id=item.id, daypart_id=item.primary_daypart_id) }}">Im Tagesplan öffnen</a>
|
||||
<form method="post" action="{{ url_for('main.item_add_to_shopping', item_id=item.id) }}">
|
||||
{{ csrf_input() }}
|
||||
<button type="submit">Auf Einkaufsliste</button>
|
||||
@@ -69,9 +100,9 @@
|
||||
</section>
|
||||
{% else %}
|
||||
<section class="panel empty-panel">
|
||||
<h2>Noch keine Eintraege</h2>
|
||||
<p>Der schnellste Start ist ein erstes vertrautes Lebensmittel oder eine einfache Mahlzeitenidee.</p>
|
||||
<a class="button" href="{{ url_for('main.item_create', kind=kind) }}">Ersten Eintrag anlegen</a>
|
||||
<h2>Keine passenden Einträge</h2>
|
||||
<p>Mit einer kleinen Suche oder einem anderen Filter findest du meist schnell wieder das Richtige.</p>
|
||||
<a class="button" href="{{ url_for('main.item_create', kind=kind) }}">Neuen Eintrag anlegen</a>
|
||||
</section>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user