This commit is contained in:
Emi Vasilek 2023-11-06 13:10:49 +01:00
parent 353aee80cb
commit 347231f013
2 changed files with 135 additions and 175 deletions

View file

@ -1,7 +1,8 @@
{% extends "base.html" %}
{% macro ingredientpart(ing) -%}
{{ing.amount|numprint}} {{ing.unit.name}} {{ ing.name }}
{{ing.amount|numprint}} {{ing["unit"].name}} {{ ing.name }}
{%- endmacro %}
{% macro ingredient(ing) -%}
{{ingredientpart(ing)}}
{% if ing.alternatives|length != 0 %}
@ -10,22 +11,25 @@
{% endfor %}
{% endif %}
{%- endmacro %}
{%block title%}{{recipe.title}}{%endblock%}
{%block body %}
<a href="index.html">back</a>
<h1>{{recipe.title}}</h1>
{% for subrecipe in recipe.subrecipes %}
{% if recipe.subrecipes|length != 1 %}
<h2>{{subrecipe.title}}</h2>
{% endif %}
{% macro getrecipe(rec) -%}
{% for subrecipe in rec.subrecipes %}
{{getrecipe(subrecipe)}}
{% endfor %}
<h1>{{rec.title}}</h1>
<h3>Ingredients</h3>
{% for ing in subrecipe.ingredients %}
{% for ing in rec.ingredients %}
<li>{{ingredient(ing)}}</li>
{% endfor %}
<h3>Steps</h3>
{% for step in subrecipe.steps %}
{% for step in rec.steps %}
<li>{{ step }}</li>
{% endfor %}
<hr>
{% endfor %}
{%- endmacro %}
{%block title%}{{recipe.title}}{%endblock%}
{%block body %}
<a href="index.html">back</a>
{{getrecipe(recipe)}}
{%endblock%}