81 lines
3.9 KiB
HTML
81 lines
3.9 KiB
HTML
{% 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" name="save_mode" value="stay">Speichern</button>
|
|
<button class="secondary" type="submit" name="save_mode" value="close">Speichern und schließen</button>
|
|
<a class="ghost-button" href="{{ url_for('main.template_library') }}">Zurück</a>
|
|
</div>
|
|
</form>
|
|
</section>
|
|
{% endblock %}
|