123 lines
5.8 KiB
HTML
123 lines
5.8 KiB
HTML
{% 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">Gemeinsame und persönliche Ideen bleiben hier ruhig sortiert, mit einem klaren Blick darauf, für wen etwas gedacht ist.</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>
|
|
Sichtbarkeit
|
|
<select name="visibility">
|
|
{% for value, label in visibility_options %}
|
|
<option value="{{ value }}" {% if selected_visibility == 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 %}
|
|
<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>
|
|
<div class="chip-row">
|
|
<span class="chip">{{ item.visibility_label }}</span>
|
|
<span class="chip status-soft">{{ item.owner_label }}</span>
|
|
<span class="chip">{{ item.for_label }}</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">
|
|
{% if item.can_edit %}
|
|
<a class="ghost-button" href="{{ url_for('main.item_edit', item_id=item.id) }}">Bearbeiten</a>
|
|
{% endif %}
|
|
<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>
|
|
</form>
|
|
{% if item.availability_state != 'home' and item.can_edit %}
|
|
<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' and item.can_edit %}
|
|
<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>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 %}
|