latest changes

This commit is contained in:
Joren de Graaf
2026-10-14 18:02:27 +02:00
parent 2934662d7a
commit b72283818c
19 changed files with 201 additions and 28 deletions
+7 -3
View File
@@ -2,7 +2,7 @@
{% block title %}Recipes · Tasknest{% endblock %}
{% block page_class %}recipes-page-content{% endblock %}
{% block content %}
<link rel="stylesheet" href="{% static 'recipes/recipes.css' %}?v=4">
<link rel="stylesheet" href="{% static 'recipes/recipes.css' %}?v=5">
<div class="recipes-layout {% if explicit_detail %}recipes-layout--detail{% else %}recipes-layout--list{% endif %}">
<aside class="recipes-browser" aria-label="Recipe browser">
<div class="recipes-browser__heading">
@@ -12,12 +12,15 @@
<form method="get" action="{% url 'recipes:list' %}" class="recipes-filters" role="search">
<label for="recipes-search">Search recipes</label>
<div class="recipes-search-row"><input id="recipes-search" type="search" name="q" value="{{ query }}" placeholder="Search recipes or ingredients"><button type="submit">Search</button></div>
<div class="recipes-filter-grid">
<details class="recipes-filter-details" data-responsive-filters open>
<summary>More filters{% if category or tag or favourite %} · Applied{% endif %}</summary>
<div class="recipes-filter-options"><div class="recipes-filter-grid">
<label>Category<select name="category"><option value="">All categories</option>{% for value in categories %}<option value="{{ value }}"{% if value == category %} selected{% endif %}>{{ value }}</option>{% endfor %}</select></label>
<label>Tag<select name="tag"><option value="">All tags</option>{% for value in tags %}<option value="{{ value }}"{% if value == tag %} selected{% endif %}>{{ value }}</option>{% endfor %}</select></label>
</div>
<label class="recipes-favourite-filter"><input type="checkbox" name="favourite" value="1"{% if favourite %} checked{% endif %}> Favourites only</label>
<button class="recipes-filter-apply" type="submit">Apply filters</button>
<button class="recipes-filter-apply" type="submit">Apply filters</button></div>
</details>
</form>
<div class="recipes-list" aria-label="Your recipes">
{% for recipe in recipes %}
@@ -59,4 +62,5 @@
<section class="recipes-panel"><h3>Actions</h3><a class="recipes-action" href="{% url 'recipes:edit' selected.api_id %}">Edit recipe</a><form method="post" action="{% url 'recipes:create-variation' selected.api_id %}" class="recipes-action-form">{% csrf_token %}<button type="submit" class="recipes-action">Create variation</button></form>{% if last_use %}<form method="post" action="{% url 'recipes:stock-undo' last_use.pk %}" class="recipes-action-form">{% csrf_token %}<button type="submit" class="recipes-action">Undo last inventory use</button></form>{% endif %}<a class="recipes-action recipes-action--danger" href="{% url 'recipes:delete' selected.api_id %}">Delete recipe</a></section>
</aside>{% endif %}
</div>
<script src="{% static 'planner/responsive_filters.js' %}?v=1" defer></script>
{% endblock %}
+15 -8
View File
@@ -3,19 +3,25 @@
{% block page_class %}recipes-page-content{% endblock %}
{% block content %}
<link rel="stylesheet" href="{% static 'recipes/recipes.css' %}?v=4">
<link rel="stylesheet" href="{% static 'recipes/match.css' %}?v=2">
<link rel="stylesheet" href="{% static 'recipes/match.css' %}?v=7">
<div class="recipe-match">
<header class="recipe-match__header">
<div><a class="recipes-back" href="{% url 'recipes:list' %}">← Back to recipes</a><p class="recipe-match__eyebrow">A little cooking demo</p><h1>Recipe Match <span aria-hidden="true">♡</span></h1><p>Explore recipes one card at a time. Select a recipe to see if the demo account picked it too.</p></div>
</header>
<form class="recipe-match__filters" method="get" role="search" aria-label="Filter recipe cards">
<label>Search<input type="search" name="q" value="{{ query }}" placeholder="Title or ingredient"></label>
<label>Category<select name="category"><option value="">All categories</option>{% for value in categories %}<option value="{{ value }}"{% if value == category %} selected{% endif %}>{{ value }}</option>{% endfor %}</select></label>
<label>Tag<select name="tag"><option value="">All tags</option>{% for value in tags %}<option value="{{ value }}"{% if value == tag %} selected{% endif %}>{{ value }}</option>{% endfor %}</select></label>
<label>Time<select name="time"><option value="">Any time</option><option value="30"{% if time_limit == '30' %} selected{% endif %}>Up to 30 min</option><option value="60"{% if time_limit == '60' %} selected{% endif %}>Up to 60 min</option></select></label>
<button type="submit">Apply filters</button>
<form class="recipe-match__filter-panel" method="get" role="search" aria-label="Filter recipe cards">
<div class="recipe-match__search-row"><label for="match-search">Search recipes</label><input id="match-search" type="search" name="q" value="{{ query }}" placeholder="Title or ingredient"><button type="submit">Search</button></div>
<details class="recipe-match__more-filters" data-responsive-filters open>
<summary><span>More filters</span><small>{% if category or tag or time_limit %}Filters applied{% else %}All recipes{% endif %}</small></summary>
<div class="recipe-match__filters">
<label>Category<select name="category"><option value="">All categories</option>{% for value in categories %}<option value="{{ value }}"{% if value == category %} selected{% endif %}>{{ value }}</option>{% endfor %}</select></label>
<label>Tag<select name="tag"><option value="">All tags</option>{% for value in tags %}<option value="{{ value }}"{% if value == tag %} selected{% endif %}>{{ value }}</option>{% endfor %}</select></label>
<label>Time<select name="time"><option value="">Any time</option><option value="30"{% if time_limit == '30' %} selected{% endif %}>Up to 30 min</option><option value="60"{% if time_limit == '60' %} selected{% endif %}>Up to 60 min</option></select></label>
<button type="submit">Apply filters</button>
</div>
</details>
</form>
<section class="recipe-match__stage" aria-label="Recipe discovery">
<form class="recipe-match__reset" method="post" action="{% url 'recipes:match-reset' %}">{% csrf_token %}<button type="submit" aria-label="Start over and show all recipes">↺ Start over</button></form>
<p class="recipe-match__counter" data-match-counter aria-live="polite"></p>
<div class="recipe-match__deck" data-match-deck>
{% for recipe in recipes %}
@@ -35,5 +41,6 @@
</section>
</div>
<input type="hidden" id="recipe-match-csrf" value="{{ csrf_token }}">
<script src="{% static 'recipes/match.js' %}?v=4" defer></script>
<script src="{% static 'planner/responsive_filters.js' %}?v=1" defer></script>
<script src="{% static 'recipes/match.js' %}?v=7" defer></script>
{% endblock %}