proper recursive finding of conversions
This commit is contained in:
parent
5fd453759b
commit
ffa0253193
4 changed files with 71 additions and 25 deletions
|
@ -1,3 +1,6 @@
|
|||
{% macro price(rec) -%}
|
||||
{% if rec.price == None %}?{%else%}{{rec.price|round(1)|numprint}}{% endif %} CZK
|
||||
{%- endmacro %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
@ -8,4 +11,4 @@
|
|||
<body>
|
||||
{% block body %}{% endblock %}
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
{%block body %}
|
||||
<h1>Recipes</h1>
|
||||
{% for recipe in recipes %}
|
||||
<li><a href="{{ recipe.outpath }}">{{ recipe.title }}</a></li>
|
||||
<li>{{price(recipe)}} <a href="{{ recipe.outpath }}">{{ recipe.title }}</a></li>
|
||||
{% endfor %}
|
||||
{%endblock%}
|
||||
{%endblock%}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{% extends "base.html" %}
|
||||
{% macro ingredientpart(ing) -%}
|
||||
{% if ing.price != None %}{{ing.price|round(1)|numprint}}{%else%} ?{%endif%} {{ing.amount|amountprint}} {{ing["unit"].name}} {{ ing.name }}
|
||||
{{price(ing)}} {{ing.amount|amountprint}} {{ing["unit"].name}} {{ ing.name }} {{ing.note}}
|
||||
{%- endmacro %}
|
||||
|
||||
{% macro ingredient(ing) -%}
|
||||
|
@ -22,6 +22,7 @@
|
|||
{% for ing in rec.ingredients %}
|
||||
<li>{{ingredient(ing)}}</li>
|
||||
{% endfor %}
|
||||
price: {{ price(rec) }}
|
||||
{% endif %}
|
||||
{% if rec.steps|length != 0 %}
|
||||
<h3>Steps</h3>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue