Add tabs for all, own and favourite recipes
- Tabs "Alle", "Eigene Rezepte", "Favoriten" above the recipe list; search and tag filters stay within the active tab - Menu link to own recipes; empty states per tab - Fix recipe card images rendering portrait instead of 4:3 Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
c76fd119cf
commit
23adb882bd
@@ -22,6 +22,7 @@
|
||||
<summary aria-label="Menü">☰</summary>
|
||||
<nav>
|
||||
<a href="{% url 'recipes:list' %}">Rezepte</a>
|
||||
<a href="{% url 'recipes:list' %}?ansicht=meine">Eigene Rezepte</a>
|
||||
<a href="{% url 'recipes:list' %}?ansicht=favoriten">Favoriten</a>
|
||||
<a href="{% url 'recipes:import' %}">Importieren</a>
|
||||
<a href="{% url 'accounts:profile' %}">Mein Konto</a>
|
||||
|
||||
@@ -9,16 +9,22 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<nav class="tabs" aria-label="Ansicht">
|
||||
<a class="tab" href="{% querystring ansicht=None seite=None %}"{% if not active_view %} aria-current="page"{% endif %}>Alle</a>
|
||||
<a class="tab" href="{% querystring ansicht="meine" seite=None %}"{% if active_view == "meine" %} aria-current="page"{% endif %}>Eigene Rezepte</a>
|
||||
<a class="tab" href="{% querystring ansicht="favoriten" seite=None %}"{% if active_view == "favoriten" %} aria-current="page"{% endif %}>Favoriten</a>
|
||||
</nav>
|
||||
|
||||
<form method="get" class="search" role="search">
|
||||
<div class="search-row">
|
||||
{{ form.q }}
|
||||
<button type="submit" class="button">Suchen</button>
|
||||
</div>
|
||||
<details class="filters"{% if form.zutat.value or form.ansicht.value %} open{% endif %}>
|
||||
<details class="filters"{% if form.zutat.value %} open{% endif %}>
|
||||
<summary>Filter</summary>
|
||||
<div class="field"><label for="{{ form.zutat.id_for_label }}">{{ form.zutat.label }}</label>{{ form.zutat }}</div>
|
||||
<div class="field"><label for="{{ form.ansicht.id_for_label }}">{{ form.ansicht.label }}</label>{{ form.ansicht }}</div>
|
||||
</details>
|
||||
{% if active_view %}<input type="hidden" name="ansicht" value="{{ active_view }}">{% endif %}
|
||||
{% if active_tag %}<input type="hidden" name="tag" value="{{ active_tag }}">{% endif %}
|
||||
</form>
|
||||
|
||||
@@ -65,8 +71,15 @@
|
||||
{% if page.has_next %}<a class="button secondary" href="{% querystring seite=page.next_page_number %}">Weiter →</a>{% endif %}
|
||||
</nav>
|
||||
{% endif %}
|
||||
{% elif filtered %}
|
||||
<p class="muted">Keine Rezepte gefunden. <a href="{% url 'recipes:list' %}">Filter zurücksetzen</a></p>
|
||||
{% elif filtered and not only_view %}
|
||||
<p class="muted">Keine Rezepte gefunden. <a href="{% querystring q=None zutat=None tag=None seite=None %}">Filter zurücksetzen</a></p>
|
||||
{% elif active_view == "favoriten" %}
|
||||
<div class="card empty"><p>Noch keine Favoriten. Tippe bei einem Rezept auf „☆ Merken“.</p></div>
|
||||
{% elif active_view == "meine" %}
|
||||
<div class="card empty">
|
||||
<p>Du hast noch keine eigenen Rezepte.</p>
|
||||
<a class="button" href="{% url 'recipes:create' %}">Rezept anlegen</a>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="card empty">
|
||||
<p>Noch keine Rezepte. Leg das erste an!</p>
|
||||
|
||||
Reference in New Issue
Block a user