comfy-recipes/templates/recipe.html

31 lines
No EOL
834 B
HTML

{% extends "base.html" %}
{% macro ingredientpart(ing) -%}
{{ing.amount|numprint}} {{ing.unit.name}} {{ ing.name }}
{%- endmacro %}
{% macro ingredient(ing) -%}
{{ingredientpart(ing)}}
{% if ing.alternatives|length != 0 %}
{% for alting in ing.alternatives %}
or {{ingredientpart(alting)}}
{% endfor %}
{% endif %}
{%- endmacro %}
{%block title%}{{recipe.title}}{%endblock%}
{%block body %}
<a href="index.html">back</a>
<h1>{{recipe.title}}</h1>
{% for part in recipe.parts %}
{% if recipe.parts|length != 1 %}
<h2>{{part.title}}</h2>
{% endif %}
<h3>Ingredients</h3>
{% for ing in part.ingredients %}
<li>{{ingredient(ing)}}</li>
{% endfor %}
<h3>Steps</h3>
{% for step in part.steps %}
<li>{{ step }}</li>
{% endfor %}
<hr>
{% endfor %}
{%endblock%}