aboutsummaryrefslogtreecommitdiff
path: root/templates/pages/single-recipe.html
blob: d8c334ddcbdb7c82555dec57033516dbbb40f145 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
{% extends "base.html" %} {% block heading %} {{ single_recipe.title }} {%
endblock %} {% block content %}
<article>
  <figure>
    <img src="{{ single_recipe.image }}" alt="{{ single_recipe.title }}" />
    <figcaption><a href="{{ single_recipe.url }}">Source</a></figcaption>
  </figure>
  <h2>Ingredients</h2>
  <ul>
    {% for ingredient in single_recipe.ingredients %}
    <li>{{ ingredient }}</li>
    {% endfor %}
  </ul>
  <h2>Instructions</h2>
  {% if single_recipe.has_subsections %}
      {% for instruction in single_recipe.instructions %}
      <h3>{{  instruction.n }}</h3>
          <ul>
          {% for i in instruction.i %}
          <li>{{ i }}</li>  
          {% endfor %}
          </ul>
      {% endfor %}
  {% else %}
  <ul>
    {% for instruction in single_recipe.instructions %}
    <li>{{ instruction }}</li>
    {% endfor %}
  </ul>
  {% endif %}

</article>
<button
  hx-delete="/recipes/delete/{{ single_recipe._id }}"
  hx-target="#delete-message"
  hx-swap="innerHTML"
>
  Delete recipe
</button>
<p id="delete-message"></p>
{% endblock %}