release nouri 0.4.0 templates suggestions and mobile sheet
This commit is contained in:
@@ -0,0 +1,93 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}{% if template %}Tagesvorlage bearbeiten{% else %}Neue Tagesvorlage{% endif %} | Nouri{% endblock %}
|
||||
{% block content %}
|
||||
<section class="page-intro">
|
||||
<div>
|
||||
<p class="eyebrow">Tagesvorlage</p>
|
||||
<h1>{% if template %}{{ template.name }} bearbeiten{% else %}Tagesvorlage anlegen{% endif %}</h1>
|
||||
<p class="lead">Gib der Vorlage einen Namen, den du später schnell wiedererkennst. Die Einträge bleiben bewusst einfach und alltagsnah.</p>
|
||||
</div>
|
||||
{% if source_date %}
|
||||
<span class="status-pill">Aus {{ source_date.strftime('%d.%m.%Y') }}</span>
|
||||
{% endif %}
|
||||
</section>
|
||||
|
||||
<section class="panel form-panel">
|
||||
<form method="post" class="stack-form">
|
||||
{{ csrf_input() }}
|
||||
<label>
|
||||
Name der Vorlage
|
||||
<input type="text" name="name" value="{{ form_data.name }}" placeholder="{{ name_suggestions[0] }}" required>
|
||||
<small class="helper-text">Zum Beispiel: Ruhiger Tag, Einfacher Bürotag oder ein ganz eigener Name.</small>
|
||||
</label>
|
||||
|
||||
<label>
|
||||
Beschreibung
|
||||
<textarea name="description" rows="3" placeholder="Optional, wenn eine kleine Erinnerung hilfreich ist.">{{ form_data.description }}</textarea>
|
||||
</label>
|
||||
|
||||
<label>
|
||||
Sichtbarkeit
|
||||
<select name="visibility">
|
||||
{% for value, label in visibility_options %}
|
||||
<option value="{{ value }}" {% if form_data.visibility == value %}selected{% endif %}>{{ label }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<small class="helper-text">{{ visibility_descriptions[form_data.visibility] }}</small>
|
||||
</label>
|
||||
|
||||
<div class="chip-row">
|
||||
{% for suggestion in name_suggestions %}
|
||||
<span class="chip status-soft">{{ suggestion }}</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<div class="stack-sections">
|
||||
{% for section in daypart_sections %}
|
||||
<fieldset>
|
||||
<legend>{{ section.daypart.name }}</legend>
|
||||
<div class="template-search-row">
|
||||
<label class="wide">
|
||||
Einträge filtern
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Nach Namen suchen"
|
||||
data-filter-input
|
||||
data-filter-target="#day-template-list-{{ section.daypart.id }}"
|
||||
>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
{% if section.quick_items %}
|
||||
<div class="quick-add-row">
|
||||
{% for item in section.quick_items %}
|
||||
<label class="quick-select-card" data-filter-label="{{ item.name|lower }} {{ item.category|default('', true)|lower }}">
|
||||
<input type="checkbox" name="daypart_{{ section.daypart.id }}_item_ids" value="{{ item.id }}" {% if item.id in section.selected_ids %}checked{% endif %}>
|
||||
<span>
|
||||
<strong>{{ item.name }}</strong>
|
||||
<small>{{ item_kind_labels[item.kind] }} · {{ item.visibility_label }} · {{ item.for_label }}</small>
|
||||
</span>
|
||||
</label>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="checkbox-grid template-checkbox-grid" id="day-template-list-{{ section.daypart.id }}">
|
||||
{% for item in section.list_items %}
|
||||
<label class="check-option" data-filter-label="{{ item.name|lower }} {{ item.category|default('', true)|lower }}">
|
||||
<input type="checkbox" name="daypart_{{ section.daypart.id }}_item_ids" value="{{ item.id }}" {% if item.id in section.selected_ids %}checked{% endif %}>
|
||||
<span>{{ item.name }} · {{ item.visibility_label }} · {{ item.for_label }}</span>
|
||||
</label>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</fieldset>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<button type="submit">Speichern</button>
|
||||
<a class="ghost-button" href="{{ url_for('main.template_library') }}">Zurück</a>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,165 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}Vorlagen | Nouri{% endblock %}
|
||||
{% block content %}
|
||||
<section class="page-intro">
|
||||
<div>
|
||||
<p class="eyebrow">Vorlagen</p>
|
||||
<h1>Bewährtes ruhig wiederverwenden</h1>
|
||||
<p class="lead">Tagesvorlagen, Wochenvorlagen und kleine Pakete helfen dabei, vertraute Muster mit wenig Tipparbeit erneut zu nutzen.</p>
|
||||
</div>
|
||||
<div class="hero-actions">
|
||||
<a class="button" href="{{ url_for('main.day_template_create') }}">Neue Tagesvorlage</a>
|
||||
<a class="button secondary" href="{{ url_for('main.week_template_create') }}">Neue Wochenvorlage</a>
|
||||
<a class="button secondary" href="{{ url_for('main.item_set_create') }}">Neues Paket</a>
|
||||
</div>
|
||||
</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>
|
||||
Sichtbarkeit
|
||||
<select name="visibility">
|
||||
{% for value, label in visibility_options %}
|
||||
<option value="{{ value }}" {% if selected_visibility == value %}selected{% endif %}>{{ label }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</label>
|
||||
<div class="filter-actions">
|
||||
<button type="submit">Filtern</button>
|
||||
<a class="ghost-button" href="{{ url_for('main.template_library') }}">Zurücksetzen</a>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
{% if template_hints %}
|
||||
<section class="panel">
|
||||
<div class="panel-head">
|
||||
<h2>Sanfte Hinweise</h2>
|
||||
</div>
|
||||
<div class="hint-list">
|
||||
{% for hint in template_hints %}
|
||||
<p class="hint-chip">{{ hint }}</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</section>
|
||||
{% endif %}
|
||||
|
||||
<section class="template-library-grid">
|
||||
<article class="panel">
|
||||
<div class="panel-head">
|
||||
<h2>Tagesvorlagen</h2>
|
||||
<a href="{{ url_for('main.day_template_create') }}">Neu anlegen</a>
|
||||
</div>
|
||||
{% if day_templates %}
|
||||
<div class="stack-sections">
|
||||
{% for template in day_templates %}
|
||||
<article class="template-list-card">
|
||||
<div>
|
||||
<strong>{{ template.name }}</strong>
|
||||
{% if template.description %}
|
||||
<p class="muted">{{ template.description }}</p>
|
||||
{% endif %}
|
||||
<div class="chip-row">
|
||||
<span class="chip">{{ template.visibility_label }}</span>
|
||||
<span class="chip status-soft">{{ template.owner_label }}</span>
|
||||
{% if template.last_used_at %}
|
||||
<span class="chip">Zuletzt genutzt</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row-actions">
|
||||
<form method="post" action="{{ url_for('main.day_template_apply', template_id=template.id) }}">
|
||||
{{ csrf_input() }}
|
||||
<input type="hidden" name="target_date" value="{{ today.isoformat() }}">
|
||||
<button type="submit">Heute anwenden</button>
|
||||
</form>
|
||||
{% if template.can_edit %}
|
||||
<a class="ghost-button" href="{{ url_for('main.day_template_edit', template_id=template.id) }}">Bearbeiten</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</article>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
<p class="empty-state">Noch keine passende Tagesvorlage. Du kannst eine Vorlage direkt neu anlegen oder aus einem Tagesplan speichern.</p>
|
||||
{% endif %}
|
||||
</article>
|
||||
|
||||
<article class="panel">
|
||||
<div class="panel-head">
|
||||
<h2>Wochenvorlagen</h2>
|
||||
<a href="{{ url_for('main.week_template_create') }}">Neu anlegen</a>
|
||||
</div>
|
||||
{% if week_templates %}
|
||||
<div class="stack-sections">
|
||||
{% for template in week_templates %}
|
||||
<article class="template-list-card">
|
||||
<div>
|
||||
<strong>{{ template.name }}</strong>
|
||||
{% if template.description %}
|
||||
<p class="muted">{{ template.description }}</p>
|
||||
{% endif %}
|
||||
<div class="chip-row">
|
||||
<span class="chip">{{ template.visibility_label }}</span>
|
||||
<span class="chip status-soft">{{ template.owner_label }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row-actions">
|
||||
<form method="post" action="{{ url_for('main.week_template_apply', template_id=template.id) }}">
|
||||
{{ csrf_input() }}
|
||||
<input type="hidden" name="target_week" value="{{ today.isoformat() }}">
|
||||
<button type="submit">Diese Woche anwenden</button>
|
||||
</form>
|
||||
{% if template.can_edit %}
|
||||
<a class="ghost-button" href="{{ url_for('main.week_template_edit', template_id=template.id) }}">Bearbeiten</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</article>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
<p class="empty-state">Noch keine Wochenvorlage. Eine gute Woche lässt sich später hier ganz leicht wiederverwenden.</p>
|
||||
{% endif %}
|
||||
</article>
|
||||
</section>
|
||||
|
||||
<section class="panel">
|
||||
<div class="panel-head">
|
||||
<h2>Kleine Pakete</h2>
|
||||
<a href="{{ url_for('main.item_set_create') }}">Neues Paket</a>
|
||||
</div>
|
||||
{% if item_sets %}
|
||||
<div class="stack-sections">
|
||||
{% for item_set in item_sets %}
|
||||
<article class="template-list-card">
|
||||
<div>
|
||||
<strong>{{ item_set.name }}</strong>
|
||||
{% if item_set.description %}
|
||||
<p class="muted">{{ item_set.description }}</p>
|
||||
{% endif %}
|
||||
<div class="chip-row">
|
||||
<span class="chip">{{ item_set.visibility_label }}</span>
|
||||
<span class="chip status-soft">{{ item_set.owner_label }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row-actions">
|
||||
<form method="post" action="{{ url_for('main.item_set_apply', set_id=item_set.id) }}">
|
||||
{{ csrf_input() }}
|
||||
<button type="submit">Auf Einkaufsliste</button>
|
||||
</form>
|
||||
{% if item_set.can_edit %}
|
||||
<a class="ghost-button" href="{{ url_for('main.item_set_edit', set_id=item_set.id) }}">Bearbeiten</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</article>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
<p class="empty-state">Pakete eignen sich gut für kleine Bündel wie schnelles Frühstück, sicherer Snack oder Einkauf für zwei Tage.</p>
|
||||
{% endif %}
|
||||
</section>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,73 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}{% if item_set %}Paket bearbeiten{% else %}Neues Paket{% endif %} | Nouri{% endblock %}
|
||||
{% block content %}
|
||||
<section class="page-intro">
|
||||
<div>
|
||||
<p class="eyebrow">Kleines Paket</p>
|
||||
<h1>{% if item_set %}{{ item_set.name }} bearbeiten{% else %}Paket anlegen{% endif %}</h1>
|
||||
<p class="lead">Pakete bündeln wiederkehrende Dinge ganz leicht, zum Beispiel schnelles Frühstück, sicherer Snack oder Einkauf für zwei Tage.</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="panel form-panel">
|
||||
<form method="post" class="stack-form">
|
||||
{{ csrf_input() }}
|
||||
<label>
|
||||
Name des Pakets
|
||||
<input type="text" name="name" value="{{ form_data.name }}" placeholder="{{ name_suggestions[0] }}" required>
|
||||
</label>
|
||||
|
||||
<label>
|
||||
Beschreibung
|
||||
<textarea name="description" rows="3" placeholder="Optional, wenn eine kleine Erinnerung hilfreich ist.">{{ form_data.description }}</textarea>
|
||||
</label>
|
||||
|
||||
<label>
|
||||
Sichtbarkeit
|
||||
<select name="visibility">
|
||||
{% for value, label in visibility_options %}
|
||||
<option value="{{ value }}" {% if form_data.visibility == value %}selected{% endif %}>{{ label }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<small class="helper-text">{{ visibility_descriptions[form_data.visibility] }}</small>
|
||||
</label>
|
||||
|
||||
<div class="chip-row">
|
||||
{% for suggestion in name_suggestions %}
|
||||
<span class="chip status-soft">{{ suggestion }}</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<fieldset>
|
||||
<legend>Einträge auswählen</legend>
|
||||
<label>
|
||||
Einträge filtern
|
||||
<input type="text" placeholder="Nach Namen suchen" data-filter-input data-filter-target="#item-set-list">
|
||||
</label>
|
||||
<div class="stack-sections" id="item-set-list">
|
||||
{% for group in item_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 item in group["items"] %}
|
||||
<label class="check-option" data-filter-label="{{ item.name|lower }} {{ item.category|default('', true)|lower }}">
|
||||
<input type="checkbox" name="item_ids" value="{{ item.id }}" {% if item.id in form_data.item_ids %}checked{% endif %}>
|
||||
<span>{{ item.name }} · {{ item_kind_labels[item.kind] }} · {{ item.visibility_label }} · {{ item.for_label }}</span>
|
||||
</label>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<div class="form-actions">
|
||||
<button type="submit">Speichern</button>
|
||||
<a class="ghost-button" href="{{ url_for('main.template_library') }}">Zurück</a>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,79 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}{% if template %}Wochenvorlage bearbeiten{% else %}Neue Wochenvorlage{% endif %} | Nouri{% endblock %}
|
||||
{% block content %}
|
||||
<section class="page-intro">
|
||||
<div>
|
||||
<p class="eyebrow">Wochenvorlage</p>
|
||||
<h1>{% if template %}{{ template.name }} bearbeiten{% else %}Wochenvorlage anlegen{% endif %}</h1>
|
||||
<p class="lead">Wochenvorlagen bleiben bewusst leicht: pro Wochentag kannst du eine bestehende Tagesvorlage zuordnen oder einen aktuellen Tag als neue Vorlage übernehmen.</p>
|
||||
</div>
|
||||
{% if source_week %}
|
||||
<span class="status-pill">Aus Woche ab {{ source_week.strftime('%d.%m.%Y') }}</span>
|
||||
{% endif %}
|
||||
</section>
|
||||
|
||||
<section class="panel form-panel">
|
||||
<form method="post" class="stack-form">
|
||||
{{ csrf_input() }}
|
||||
<input type="hidden" name="source_week" value="{{ form_data.source_week }}">
|
||||
|
||||
<label>
|
||||
Name der Vorlage
|
||||
<input type="text" name="name" value="{{ form_data.name }}" placeholder="{{ name_suggestions[0] }}" required>
|
||||
<small class="helper-text">Ein Name wie Standardwoche, leichte Woche oder etwas ganz Eigenes reicht völlig aus.</small>
|
||||
</label>
|
||||
|
||||
<label>
|
||||
Beschreibung
|
||||
<textarea name="description" rows="3" placeholder="Optional, wenn eine kleine Erinnerung hilfreich ist.">{{ form_data.description }}</textarea>
|
||||
</label>
|
||||
|
||||
<label>
|
||||
Sichtbarkeit
|
||||
<select name="visibility">
|
||||
{% for value, label in visibility_options %}
|
||||
<option value="{{ value }}" {% if form_data.visibility == value %}selected{% endif %}>{{ label }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<small class="helper-text">{{ visibility_descriptions[form_data.visibility] }}</small>
|
||||
</label>
|
||||
|
||||
<div class="chip-row">
|
||||
{% for suggestion in name_suggestions %}
|
||||
<span class="chip status-soft">{{ suggestion }}</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<div class="stack-sections">
|
||||
{% for weekday_index in range(7) %}
|
||||
<div class="week-template-row">
|
||||
<div>
|
||||
<strong>{{ weekday_labels[weekday_index] }}</strong>
|
||||
<p class="muted">Du kannst eine vorhandene Tagesvorlage auswählen oder den aktuellen Tag aus der Quellwoche übernehmen.</p>
|
||||
</div>
|
||||
<label>
|
||||
Tagesvorlage
|
||||
<select name="weekday_{{ weekday_index }}_day_template_id">
|
||||
<option value="">Noch offen</option>
|
||||
{% for day_template in day_templates %}
|
||||
<option value="{{ day_template.id }}" {% if form_data.selected_map.get(weekday_index) == day_template.id %}selected{% endif %}>{{ day_template.name }} · {{ day_template.visibility_label }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</label>
|
||||
{% if form_data.source_week %}
|
||||
<label class="inline-check">
|
||||
<input type="checkbox" name="weekday_{{ weekday_index }}_copy_source" value="1" {% if form_data.copy_from_source.get(weekday_index) %}checked{% endif %}>
|
||||
<span>Aus Quellwoche als neue Tagesvorlage übernehmen</span>
|
||||
</label>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<button type="submit">Speichern</button>
|
||||
<a class="ghost-button" href="{{ url_for('main.template_library') }}">Zurück</a>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user