first commit

This commit is contained in:
2026-04-12 10:36:13 +02:00
commit 21014c246e
22 changed files with 2461 additions and 0 deletions
+59
View File
@@ -0,0 +1,59 @@
{% extends "base.html" %}
{% block title %}Archiv | Nouri{% endblock %}
{% block content %}
<section class="page-intro">
<div>
<p class="eyebrow">Archiv</p>
<h1>Fruehere Ideen bleiben greifbar</h1>
<p class="lead">Das Archiv ist ein Erinnerungsspeicher. Von hier aus lassen sich vertraute Dinge leicht wieder auf die Einkaufsliste setzen.</p>
</div>
</section>
{% if items %}
<section class="card-grid">
{% for item in items %}
<article class="item-card">
<div class="item-media">
{% if item.photo_filename %}
<img src="{{ url_for('uploaded_file', filename=item.photo_filename) }}" alt="{{ item.name }}">
{% else %}
<div class="placeholder-tile">{{ item.name[:1] }}</div>
{% endif %}
</div>
<div class="item-body">
<h2>{{ item.name }}</h2>
<p class="muted">{{ item_kind_labels[item.kind] }}{% if item.category %} · {{ item.category }}{% endif %}</p>
{% if item.dayparts %}
<div class="chip-row">
{% for daypart in item.dayparts %}
<span class="chip">{{ daypart }}</span>
{% endfor %}
</div>
{% endif %}
{% if item.components %}
<p class="muted">Mit: {{ item.components|join(', ') }}</p>
{% endif %}
{% if item.note %}
<p>{{ item.note }}</p>
{% endif %}
</div>
<div class="item-actions">
<form method="post" action="{{ url_for('main.item_add_to_shopping', item_id=item.id) }}">
{{ csrf_input() }}
<button type="submit">Wieder einkaufen</button>
</form>
<form method="post" action="{{ url_for('main.item_restore', item_id=item.id) }}">
{{ csrf_input() }}
<button class="ghost-button" type="submit">Zur aktiven Liste</button>
</form>
</div>
</article>
{% endfor %}
</section>
{% else %}
<section class="panel empty-panel">
<h2>Das Archiv ist noch leer</h2>
<p>Sobald etwas als verbraucht markiert wird, bleibt es hier als spaetere Erinnerung erhalten.</p>
</section>
{% endif %}
{% endblock %}
+24
View File
@@ -0,0 +1,24 @@
{% extends "base.html" %}
{% block title %}Anmelden | Nouri{% endblock %}
{% block content %}
<section class="auth-shell">
<div class="auth-card">
<p class="eyebrow">Willkommen zurueck</p>
<h1>Ruhig wieder einsteigen</h1>
<p class="lead">Nouri hilft beim Erinnern, Sichtbar-Machen und Planen. Ohne Zahlen, ohne Druck.</p>
<form method="post" class="stack-form">
{{ csrf_input() }}
<label>
Benutzername
<input type="text" name="username" autocomplete="username" required>
</label>
<label>
Passwort
<input type="password" name="password" autocomplete="current-password" required>
</label>
<button type="submit">Anmelden</button>
</form>
</div>
</section>
{% endblock %}
+32
View File
@@ -0,0 +1,32 @@
{% extends "base.html" %}
{% block title %}Erster Start | Nouri{% endblock %}
{% block content %}
<section class="auth-shell">
<div class="auth-card">
<p class="eyebrow">Erster Start</p>
<h1>Den ersten Haushalt-Zugang anlegen</h1>
<p class="lead">Danach koennt ihr die App gemeinsam nutzen. Die Daten bleiben lokal in dieser Installation.</p>
<form method="post" class="stack-form">
{{ csrf_input() }}
<label>
Benutzername
<input type="text" name="username" autocomplete="username" required>
</label>
<label>
Anzeigename
<input type="text" name="display_name" autocomplete="name" placeholder="z. B. Heinz">
</label>
<label>
Passwort
<input type="password" name="password" autocomplete="new-password" required>
</label>
<label>
Passwort wiederholen
<input type="password" name="password_repeat" autocomplete="new-password" required>
</label>
<button type="submit">Zugang anlegen</button>
</form>
</div>
</section>
{% endblock %}
+55
View File
@@ -0,0 +1,55 @@
<!doctype html>
<html lang="de" data-theme="auto">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{% block title %}Nouri{% endblock %}</title>
<link rel="stylesheet" href="{{ url_for('static', filename='css/styles.css') }}">
<script defer src="{{ url_for('static', filename='js/theme.js') }}"></script>
</head>
<body>
<div class="page-shell">
<header class="site-header">
<a class="brand" href="{{ url_for('main.dashboard') }}">
<span class="brand-mark">N</span>
<span>
<strong>Nouri</strong>
<small>freundliches Essensgedaechtnis</small>
</span>
</a>
{% if g.user %}
<nav class="site-nav">
<a href="{{ url_for('main.dashboard') }}" class="{{ 'active' if request.endpoint == 'main.dashboard' else '' }}">Heute</a>
<a href="{{ url_for('main.item_list', kind='food') }}" class="{{ 'active' if request.endpoint == 'main.item_list' and request.view_args and request.view_args.get('kind') == 'food' else '' }}">Lebensmittel</a>
<a href="{{ url_for('main.item_list', kind='meal') }}" class="{{ 'active' if request.endpoint == 'main.item_list' and request.view_args and request.view_args.get('kind') == 'meal' else '' }}">Mahlzeiten</a>
<a href="{{ url_for('main.shopping_list') }}" class="{{ 'active' if request.endpoint == 'main.shopping_list' else '' }}">Einkaufsliste</a>
<a href="{{ url_for('main.home_view') }}" class="{{ 'active' if request.endpoint == 'main.home_view' else '' }}">Zuhause</a>
<a href="{{ url_for('main.planner') }}" class="{{ 'active' if request.endpoint == 'main.planner' else '' }}">Wochenplan</a>
<a href="{{ url_for('main.archive_view') }}" class="{{ 'active' if request.endpoint == 'main.archive_view' else '' }}">Archiv</a>
</nav>
<div class="header-actions">
<button class="theme-toggle" type="button" data-theme-toggle>Modus</button>
<form method="post" action="{{ url_for('auth.logout') }}">
{{ csrf_input() }}
<button class="ghost-button" type="submit">Abmelden</button>
</form>
</div>
{% endif %}
</header>
<main class="content">
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
<section class="flash-stack" aria-label="Hinweise">
{% for category, message in messages %}
<div class="flash flash-{{ category }}">{{ message }}</div>
{% endfor %}
</section>
{% endif %}
{% endwith %}
{% block content %}{% endblock %}
</main>
</div>
</body>
</html>
+82
View File
@@ -0,0 +1,82 @@
{% extends "base.html" %}
{% block title %}Heute | Nouri{% endblock %}
{% block content %}
<section class="hero">
<div>
<p class="eyebrow">Heute</p>
<h1>Ein ruhiger Blick auf das, was gerade hilft</h1>
<p class="lead">Du siehst auf einen Blick, was zuhause da ist, was noch eingekauft werden soll und was heute schon eingeplant ist.</p>
</div>
<div class="hero-actions">
<a class="button secondary" href="{{ url_for('main.item_create', kind='food') }}">Lebensmittel anlegen</a>
<a class="button secondary" href="{{ url_for('main.item_create', kind='meal') }}">Mahlzeitenidee anlegen</a>
</div>
</section>
<section class="stats-grid">
<article class="stat-card">
<span>Zuhause</span>
<strong>{{ home_count }}</strong>
<small>sichtbare Eintraege</small>
</article>
<article class="stat-card">
<span>Einkaufsliste</span>
<strong>{{ shopping_count }}</strong>
<small>offene Besorgungen</small>
</article>
<article class="stat-card">
<span>Archiv</span>
<strong>{{ archive_count }}</strong>
<small>wiederverwendbare Erinnerungen</small>
</article>
</section>
<section class="two-column">
<article class="panel">
<div class="panel-head">
<h2>Heute im Plan</h2>
<a href="{{ url_for('main.planner') }}">Wochenplan oeffnen</a>
</div>
{% if today_entries %}
<ul class="simple-list">
{% for entry in today_entries %}
<li>
<strong>{{ entry.daypart_name }}</strong>
<span>{{ entry.item_name }}</span>
</li>
{% endfor %}
</ul>
{% else %}
<p class="empty-state">Fuer heute ist noch nichts fest eingeplant. Das ist vollkommen okay.</p>
{% endif %}
</article>
<article class="panel">
<div class="panel-head">
<h2>Kurz griffbereit</h2>
<a href="{{ url_for('main.home_view') }}">Alles unter Zuhause</a>
</div>
{% if home_items %}
<div class="mini-card-grid">
{% for item in home_items %}
<article class="mini-card">
<div class="mini-card-body">
<strong>{{ item.name }}</strong>
<small>{{ item_kind_labels[item.kind] }}</small>
{% if item.dayparts %}
<div class="chip-row">
{% for daypart in item.dayparts %}
<span class="chip">{{ daypart }}</span>
{% endfor %}
</div>
{% endif %}
</div>
</article>
{% endfor %}
</div>
{% else %}
<p class="empty-state">Sobald etwas eingekauft oder manuell auf Zuhause gesetzt wurde, erscheint es hier.</p>
{% endif %}
</article>
</section>
{% endblock %}
+59
View File
@@ -0,0 +1,59 @@
{% extends "base.html" %}
{% block title %}Zuhause | Nouri{% endblock %}
{% block content %}
<section class="page-intro">
<div>
<p class="eyebrow">Zuhause</p>
<h1>Was aktuell da ist</h1>
<p class="lead">Sichtbar, ruhig und nach Tageszeiten sortiert. Wenn etwas aufgebraucht ist, wandert es nicht weg, sondern ins Archiv.</p>
</div>
</section>
{% if grouped %}
<section class="stack-sections">
{% for title, items in grouped.items() %}
<article class="panel">
<div class="panel-head">
<h2>{{ title }}</h2>
<span>{{ items|length }} Eintraege</span>
</div>
<div class="card-grid">
{% for item in items %}
<article class="item-card compact">
<div class="item-media">
{% if item.photo_filename %}
<img src="{{ url_for('uploaded_file', filename=item.photo_filename) }}" alt="{{ item.name }}">
{% else %}
<div class="placeholder-tile">{{ item.name[:1] }}</div>
{% endif %}
</div>
<div class="item-body">
<h3>{{ item.name }}</h3>
<p class="muted">{{ item_kind_labels[item.kind] }}{% if item.category %} · {{ item.category }}{% endif %}</p>
{% if item.components %}
<p class="muted">Mit: {{ item.components|join(', ') }}</p>
{% endif %}
</div>
<div class="item-actions">
<form method="post" action="{{ url_for('main.item_archive', item_id=item.id) }}">
{{ csrf_input() }}
<button class="ghost-button" type="submit">Verbraucht / nicht mehr da</button>
</form>
<form method="post" action="{{ url_for('main.item_add_to_shopping', item_id=item.id) }}">
{{ csrf_input() }}
<button type="submit">Erneut einkaufen</button>
</form>
</div>
</article>
{% endfor %}
</div>
</article>
{% endfor %}
</section>
{% else %}
<section class="panel empty-panel">
<h2>Noch nichts unter Zuhause</h2>
<p>Ein Einkaufseintrag wird nach dem Abhaken automatisch hier sichtbar.</p>
</section>
{% endif %}
{% endblock %}
+78
View File
@@ -0,0 +1,78 @@
{% extends "base.html" %}
{% block title %}{% if item %}Bearbeiten{% else %}Neu{% endif %} | Nouri{% endblock %}
{% block content %}
<section class="page-intro">
<div>
<p class="eyebrow">{{ item_kind_labels[kind] }}</p>
<h1>{% if item %}{{ item.name }} bearbeiten{% else %}Neue{% endif %} {{ item_kind_singular_labels[kind] }}</h1>
<p class="lead">Nur das Nötigste: Name, Bild, Tageszeiten und eine kleine Notiz, wenn sie hilft.</p>
</div>
</section>
<section class="panel form-panel">
<form method="post" enctype="multipart/form-data" class="stack-form">
{{ csrf_input() }}
<label>
Name
<input type="text" name="name" value="{{ form_data.name }}" required>
</label>
<label>
Kategorie
<input type="text" name="category" list="category-list" value="{{ form_data.category }}" placeholder="z. B. Obst, Warmes, Snack">
<datalist id="category-list">
{% for category in categories %}
<option value="{{ category }}"></option>
{% endfor %}
</datalist>
</label>
<label>
Notiz
<textarea name="note" rows="4" placeholder="Optional, wenn eine kleine Erinnerung hilfreich ist.">{{ form_data.note }}</textarea>
</label>
<label>
Foto
<input type="file" name="photo" accept="image/png,image/jpeg,image/gif,image/webp">
</label>
{% if item and item.photo_filename %}
<div class="inline-photo">
<img src="{{ url_for('uploaded_file', filename=item.photo_filename) }}" alt="{{ item.name }}">
</div>
{% endif %}
<fieldset>
<legend>Passende Tageszeiten</legend>
<div class="checkbox-grid">
{% for daypart in dayparts %}
<label class="check-option">
<input type="checkbox" name="daypart_ids" value="{{ daypart.id }}" {% if daypart.id in form_data.daypart_ids %}checked{% endif %}>
<span>{{ daypart.name }}</span>
</label>
{% endfor %}
</div>
</fieldset>
{% 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>
</label>
{% endfor %}
</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>
</div>
</form>
</section>
{% endblock %}
+77
View File
@@ -0,0 +1,77 @@
{% extends "base.html" %}
{% block title %}{{ item_kind_labels[kind] }} | Nouri{% endblock %}
{% block content %}
<section class="page-intro">
<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>
</div>
<a class="button" href="{{ url_for('main.item_create', kind=kind) }}">Neu anlegen</a>
</section>
{% if items %}
<section class="card-grid">
{% for item in items %}
<article class="item-card">
<div class="item-media">
{% if item.photo_filename %}
<img src="{{ url_for('uploaded_file', filename=item.photo_filename) }}" alt="{{ item.name }}">
{% else %}
<div class="placeholder-tile">{{ item.name[:1] }}</div>
{% endif %}
</div>
<div class="item-body">
<div class="item-topline">
<h2>{{ item.name }}</h2>
<span class="status-pill status-{{ item.availability_state }}">{{ availability_labels[item.availability_state] }}</span>
</div>
<p class="muted">
{% if item.category %}{{ item.category }}{% else %}ohne Kategorie{% endif %}
·
{{ item_kind_labels[item.kind] }}
</p>
{% if item.dayparts %}
<div class="chip-row">
{% for daypart in item.dayparts %}
<span class="chip">{{ daypart }}</span>
{% endfor %}
</div>
{% endif %}
{% if item.components %}
<p class="muted">Mit: {{ item.components|join(', ') }}</p>
{% endif %}
{% if item.note %}
<p>{{ item.note }}</p>
{% endif %}
</div>
<div class="item-actions">
<a class="ghost-button" href="{{ url_for('main.item_edit', item_id=item.id) }}">Bearbeiten</a>
<form method="post" action="{{ url_for('main.item_add_to_shopping', item_id=item.id) }}">
{{ csrf_input() }}
<button type="submit">Auf Einkaufsliste</button>
</form>
{% if item.availability_state != 'home' %}
<form method="post" action="{{ url_for('main.item_set_home', item_id=item.id) }}">
{{ csrf_input() }}
<button class="secondary" type="submit">Als Zuhause markieren</button>
</form>
{% endif %}
{% if item.availability_state != 'archived' %}
<form method="post" action="{{ url_for('main.item_archive', item_id=item.id) }}">
{{ csrf_input() }}
<button class="ghost-button" type="submit">Ins Archiv</button>
</form>
{% endif %}
</div>
</article>
{% endfor %}
</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>
</section>
{% endif %}
{% endblock %}
+81
View File
@@ -0,0 +1,81 @@
{% extends "base.html" %}
{% block title %}Wochenplan | Nouri{% endblock %}
{% block content %}
<section class="page-intro">
<div>
<p class="eyebrow">Wochenplan</p>
<h1>Struktur fuer die naechsten Tage</h1>
<p class="lead">Der Plan bleibt bewusst leichtgewichtig. Vorhandene Dinge tauchen in der Auswahl zuerst auf.</p>
</div>
<div class="week-nav">
<a class="ghost-button" href="{{ url_for('main.planner', week=prev_week.isoformat()) }}">Vorige Woche</a>
<span>{{ days[0].strftime('%d.%m.') }} bis {{ days[-1].strftime('%d.%m.%Y') }}</span>
<a class="ghost-button" href="{{ url_for('main.planner', week=next_week.isoformat()) }}">Naechste Woche</a>
</div>
</section>
<section class="panel compact-form-panel">
<form method="post" class="planner-form">
{{ csrf_input() }}
<label>
Tag
<input type="date" name="plan_date" value="{{ days[0].isoformat() }}">
</label>
<label>
Tageszeit
<select name="daypart_id">
{% for daypart in dayparts %}
<option value="{{ daypart.id }}">{{ daypart.name }}</option>
{% endfor %}
</select>
</label>
<label class="wide">
Eintrag
<select name="item_id">
<option value="">Etwas fuer den Plan waehlen</option>
{% for item in selectable_items %}
<option value="{{ item.id }}">{{ item.name }} · {{ item_kind_labels[item.kind] }}{% if item.availability_state == 'home' %} · zuhause{% endif %}</option>
{% endfor %}
</select>
</label>
<label class="wide">
Notiz
<input type="text" name="note" placeholder="Optional, z. B. zuerst einkaufen">
</label>
<button type="submit">In den Plan legen</button>
</form>
</section>
<section class="planner-grid">
{% for daypart in dayparts %}
<div class="planner-row">
<div class="planner-label">{{ daypart.name }}</div>
{% for day in days %}
<div class="planner-cell">
<div class="planner-date">{{ day.strftime('%a %d.%m.') }}</div>
{% set slot_entries = entries.get((day.isoformat(), daypart.id), []) %}
{% if slot_entries %}
<div class="planner-entry-stack">
{% for entry in slot_entries %}
<article class="planner-entry">
<strong>{{ entry.item_name }}</strong>
<small>{{ item_kind_labels[entry.item_kind] }}</small>
{% if entry.note %}
<p>{{ entry.note }}</p>
{% endif %}
<form method="post" action="{{ url_for('main.planner_remove', entry_id=entry.id, week=week_start.isoformat()) }}">
{{ csrf_input() }}
<button class="ghost-button" type="submit">Entfernen</button>
</form>
</article>
{% endfor %}
</div>
{% else %}
<p class="empty-slot">frei</p>
{% endif %}
</div>
{% endfor %}
</div>
{% endfor %}
</section>
{% endblock %}
+52
View File
@@ -0,0 +1,52 @@
{% 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">Abhaken legt Dinge automatisch unter Zuhause ab. So wird aus der Liste direkt sichtbarer Vorrat.</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 hinzufuegen</option>
{% for item in addable_items %}
<option value="{{ item.id }}">{{ item.name }} · {{ item_kind_labels[item.kind] }}{% 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">
<div>
<strong>{{ entry.item_name }}</strong>
<p class="muted">{{ item_kind_labels[entry.item_kind] }}{% if entry.display_name or entry.username %} · hinzugefuegt von {{ entry.display_name or entry.username }}{% endif %}</p>
</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>
<form method="post" action="{{ url_for('main.shopping_remove', entry_id=entry.id) }}">
{{ csrf_input() }}
<button class="ghost-button" type="submit">Entfernen</button>
</form>
</div>
</article>
{% endfor %}
</section>
{% else %}
<section class="panel empty-panel">
<h2>Die Liste ist gerade frei</h2>
<p>Eintraege aus Lebensmitteln, Mahlzeitenideen oder dem Archiv lassen sich jederzeit wieder hinzufuegen.</p>
</section>
{% endif %}
{% endblock %}