Add cook later
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
{% extends 'planner/base.html' %}{% load static %}
|
||||
{% block title %}Cook Later · Tasknest{% endblock %}
|
||||
{% block page_class %}recipes-page-content{% endblock %}
|
||||
{% block content %}
|
||||
<link rel="stylesheet" href="{% static 'recipes/recipes.css' %}?v=7">
|
||||
<div class="cook-later"><a class="recipes-back" href="{% url 'recipes:list' %}">← Recipes</a><h1>Cook Later</h1><p>Recipes you saved to make another day.</p>
|
||||
<div class="cook-later__list">{% for entry in entries %}<article class="cook-later__item"><div><h2><a href="{% if entry.recipe.owner_id == request.user.pk %}{% url 'recipes:detail' entry.recipe.api_id %}{% else %}{% url 'recipes:discover-detail' entry.recipe.api_id %}{% endif %}">{{ entry.recipe.title }}</a></h2>{% if entry.recipe.description %}<p>{{ entry.recipe.description }}</p>{% endif %}<small>Saved {{ entry.created_at|date:'j M Y' }}</small></div><form method="post" action="{% url 'recipes:cook-later-remove' entry.recipe.api_id %}">{% csrf_token %}<button type="submit" aria-label="Remove {{ entry.recipe.title }} from Cook Later">Remove</button></form></article>{% empty %}<p>No recipes saved yet. <a href="{% url 'recipes:match' %}">Browse recipes to save</a>.</p>{% endfor %}</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,7 @@
|
||||
{% extends 'planner/base.html' %}{% load static recipe_markdown %}
|
||||
{% block title %}{{ recipe.title }} · Tasknest{% endblock %}
|
||||
{% block page_class %}recipes-page-content{% endblock %}
|
||||
{% block content %}
|
||||
<link rel="stylesheet" href="{% static 'recipes/recipes.css' %}?v=7">
|
||||
<div class="cook-later"><a class="recipes-back" href="{% url 'recipes:match' %}">← Browse recipes</a><h1>{{ recipe.title }}</h1>{% if recipe.description %}<p>{{ recipe.description }}</p>{% endif %}<p>{{ recipe.total_minutes }} min · {{ recipe.default_servings|floatformat:-2 }} servings</p><section class="recipes-panel"><h2>Ingredients</h2><ul>{% for ingredient in recipe.ingredients.all %}<li>{{ ingredient.quantity|floatformat:-3 }} {{ ingredient.unit }} {{ ingredient.name }}</li>{% empty %}<li>No ingredients listed.</li>{% endfor %}</ul></section><section class="recipes-panel"><h2>Instructions</h2>{% if recipe.instructions_markdown %}{{ recipe.instructions_markdown|recipe_markdown }}{% else %}<p>No instructions listed.</p>{% endif %}</section></div>
|
||||
{% endblock %}
|
||||
@@ -2,13 +2,14 @@
|
||||
{% block title %}Recipes · Tasknest{% endblock %}
|
||||
{% block page_class %}recipes-page-content{% endblock %}
|
||||
{% block content %}
|
||||
<link rel="stylesheet" href="{% static 'recipes/recipes.css' %}?v=5">
|
||||
<link rel="stylesheet" href="{% static 'recipes/recipes.css' %}?v=7">
|
||||
<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">
|
||||
<div><h1>Recipes</h1><p>Find, create and cook with what you have.</p><a class="recipes-match-link" href="{% url 'recipes:match' %}">♡ Try Recipe Match</a></div>
|
||||
<div><h1>Recipes</h1><p>Find, create and cook with what you have.</p><a class="recipes-match-link" href="{% url 'recipes:cook-later' %}">Cook Later</a></div>
|
||||
<a class="button recipes-new" href="{% url 'recipes:create' %}">+ New recipe</a>
|
||||
</div>
|
||||
<nav class="recipes-mode" aria-label="Recipe view"><a href="{% url 'recipes:list' %}{% if request.GET %}?{{ request.GET.urlencode }}{% endif %}" aria-current="page">Search</a><a href="{% url 'recipes:match' %}?q={{ query|urlencode }}&category={{ category|urlencode }}&tag={{ tag|urlencode }}">Swipe</a></nav>
|
||||
<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>
|
||||
@@ -27,7 +28,7 @@
|
||||
<a class="recipes-list-item{% if selected.pk == recipe.pk %} recipes-list-item--selected{% endif %}" href="{% url 'recipes:detail' recipe.api_id %}{% if request.GET %}?{{ request.GET.urlencode }}{% endif %}"{% if selected.pk == recipe.pk %} aria-current="page"{% endif %}>
|
||||
{% if recipe.photo %}<img class="recipes-list-item__image" src="{% url 'recipes:photo' recipe.api_id %}" alt="" loading="lazy">{% else %}<span class="recipes-list-item__placeholder" aria-hidden="true">Recipe</span>{% endif %}
|
||||
<span class="recipes-list-item__body"><strong>{{ recipe.title }}</strong><small>{{ recipe.total_minutes }} min · {{ recipe.default_servings|floatformat:-2 }} servings</small><span class="recipes-list-item__tags">{% if recipe.category %}<span>{{ recipe.category }}</span>{% endif %}{% for value in recipe.tags|slice:':2' %}<span>{{ value }}</span>{% endfor %}</span></span>
|
||||
{% if recipe.is_favourite %}<span class="recipes-list-item__favourite" aria-label="Favourite">♥</span>{% endif %}
|
||||
{% if recipe.pk in saved_ids %}<span class="recipes-saved-badge">Cook Later</span>{% endif %}{% if recipe.is_favourite %}<span class="recipes-list-item__favourite" aria-label="Favourite">♥</span>{% endif %}
|
||||
</a>
|
||||
{% empty %}
|
||||
<div class="recipes-empty-list"><p>{% if query or category or tag or favourite %}No recipes match these filters.{% else %}Your recipe library is ready.{% endif %}</p><a href="{% url 'recipes:create' %}">Create a recipe</a></div>
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
{% extends 'planner/base.html' %}{% load static %}
|
||||
{% block title %}Recipe Match · Tasknest{% endblock %}
|
||||
{% block title %}Swipe 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/match.css' %}?v=7">
|
||||
<link rel="stylesheet" href="{% static 'recipes/recipes.css' %}?v=7">
|
||||
<link rel="stylesheet" href="{% static 'recipes/match.css' %}?v=8">
|
||||
<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>
|
||||
<div><a class="recipes-back" href="{% url 'recipes:list' %}?q={{ query|urlencode }}&category={{ category|urlencode }}&tag={{ tag|urlencode }}">← Back to recipes</a><h1>Swipe recipes</h1><p>Save a recipe for later or skip to the next one.</p><nav class="recipes-mode" aria-label="Recipe view"><a href="{% url 'recipes:list' %}?q={{ query|urlencode }}&category={{ category|urlencode }}&tag={{ tag|urlencode }}">Search</a><a href="{% url 'recipes:match' %}?{{ request.GET.urlencode }}" aria-current="page">Swipe</a></nav><a href="{% url 'recipes:cook-later' %}">View Cook Later</a></div>
|
||||
</header>
|
||||
<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>
|
||||
@@ -21,7 +21,6 @@
|
||||
</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 %}
|
||||
@@ -30,17 +29,15 @@
|
||||
{% if recipe.photo %}<img src="{% url 'recipes:match-photo' recipe.api_id %}" alt="Photo of {{ recipe.title }}">{% else %}<div class="recipe-match__image-fallback" role="img" aria-label="No photo for {{ recipe.title }}"><span aria-hidden="true">🍽</span></div>{% endif %}
|
||||
<span class="recipe-match__stamp" data-match-stamp aria-hidden="true"></span>
|
||||
</div>
|
||||
<div class="recipe-match__card-body"><p class="recipe-match__kind">{% if recipe.owner_id == request.user.pk %}Your recipe{% else %}Demo recipe{% endif %}</p><h2>{{ recipe.title }}</h2><p class="recipe-match__meta">{% if recipe.total_minutes %}◷ {{ recipe.total_minutes }} min{% endif %}{% if recipe.category %}<span>{{ recipe.category }}</span>{% endif %}</p>{% if recipe.tags %}<div class="recipe-match__tags">{% for tag in recipe.tags|slice:':3' %}<span>{{ tag }}</span>{% endfor %}</div>{% endif %}</div>
|
||||
<div class="recipe-match__celebration" data-match-celebration hidden><div class="recipe-match__confetti" aria-hidden="true"></div><div class="recipe-match__celebration-copy"><span aria-hidden="true">🎉</span><h3>It's a match!</h3><p>The demo account selected this recipe too.</p><button type="button" data-match-continue>Keep swiping</button>{% if recipe.owner_id == request.user.pk %}<a href="{% url 'recipes:detail' recipe.api_id %}">View recipe</a>{% endif %}</div></div>
|
||||
<div class="recipe-match__card-body"><p class="recipe-match__kind">{% if recipe.pk in saved_ids %}Saved in Cook Later{% elif recipe.owner_id == request.user.pk %}Your recipe{% else %}Demo recipe{% endif %}</p><h2>{{ recipe.title }}</h2><p class="recipe-match__meta">{% if recipe.total_minutes %}◷ {{ recipe.total_minutes }} min{% endif %}{% if recipe.category %}<span>{{ recipe.category }}</span>{% endif %}</p>{% if recipe.tags %}<div class="recipe-match__tags">{% for tag in recipe.tags|slice:':3' %}<span>{{ tag }}</span>{% endfor %}</div>{% endif %}<a href="{% if recipe.owner_id == request.user.pk %}{% url 'recipes:detail' recipe.api_id %}{% else %}{% url 'recipes:discover-detail' recipe.api_id %}{% endif %}">View recipe</a></div>
|
||||
</article>
|
||||
{% empty %}<p class="recipe-match__empty">No recipes match these filters. Try another search or return to your recipes.</p>{% endfor %}
|
||||
</div>
|
||||
{% if recipes %}<div class="recipe-match__actions"><button type="button" class="recipe-match__skip" data-match-skip aria-label="Skip recipe"><span aria-hidden="true">×</span><small>Skip</small></button><button type="button" class="recipe-match__select" data-match-select aria-label="Select recipe"><span aria-hidden="true">♥</span><small>Select</small></button></div><p class="recipe-match__hint">Swipe left to skip or right to select. The buttons work with keyboard too.</p>{% endif %}
|
||||
{% if recipes %}<div class="recipe-match__actions"><button type="button" class="recipe-match__select" data-match-select aria-label="Save recipe to Cook Later"><span aria-hidden="true">+</span><small>Cook Later</small></button><button type="button" class="recipe-match__skip" data-match-skip aria-label="Skip recipe"><span aria-hidden="true">→</span><small>Skip</small></button></div><p class="recipe-match__hint">Swipe left to save to Cook Later, or right to skip. Both actions have buttons.</p>{% endif %}
|
||||
<p class="recipe-match__status" data-match-status role="status" aria-live="polite" tabindex="-1"></p>
|
||||
{% if not demo_ready %}<p class="recipe-match__setup">The demo account is not configured yet. You can explore cards, but matches will appear after demo selections are seeded.</p>{% endif %}
|
||||
</section>
|
||||
</div>
|
||||
<input type="hidden" id="recipe-match-csrf" value="{{ csrf_token }}">
|
||||
<script src="{% static 'planner/responsive_filters.js' %}?v=1" defer></script>
|
||||
<script src="{% static 'recipes/match.js' %}?v=7" defer></script>
|
||||
<script src="{% static 'recipes/match.js' %}?v=8" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user