Recipes phase 6
This commit is contained in:
@@ -6,7 +6,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></div>
|
||||
<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>
|
||||
<a class="button recipes-new" href="{% url 'recipes:create' %}">+ New recipe</a>
|
||||
</div>
|
||||
<form method="get" action="{% url 'recipes:list' %}" class="recipes-filters" role="search">
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
{% extends 'planner/base.html' %}{% load static %}
|
||||
{% block title %}Recipe Match · 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=2">
|
||||
<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>
|
||||
<section class="recipe-match__stage" aria-label="Recipe discovery">
|
||||
<p class="recipe-match__counter" data-match-counter aria-live="polite"></p>
|
||||
<div class="recipe-match__deck" data-match-deck>
|
||||
{% for recipe in recipes %}
|
||||
<article class="recipe-match__card" data-match-card data-select-url="{% url 'recipes:match-select' recipe.api_id %}" data-detail-url="{% if recipe.owner_id == request.user.pk %}{% url 'recipes:detail' recipe.api_id %}{% endif %}"{% if not forloop.first %} hidden{% endif %}>
|
||||
<div class="recipe-match__image">
|
||||
{% 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>
|
||||
</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 %}
|
||||
<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 'recipes/match.js' %}?v=4" defer></script>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user