do not render price if unknown

This commit is contained in:
Emi Vasilek 2023-11-17 20:24:03 +01:00
parent af3454bd0d
commit 21e68445e7
3 changed files with 5 additions and 5 deletions

View file

@ -1,6 +1,6 @@
{% extends "base.html" %}
{% macro ingredientpart(ing) -%}
{{price(ing)}} {{ing.amount|amountprint}} {{ing["unit"].name}} {{ ing.name }} {{ing.note}}
{% if recipe.price != None %}{{price(ing.price)}} {%endif%}{{ing.amount|amountprint}} {{ing["unit"].name}} {{ ing.name }} {{ing.note}}
{%- endmacro %}
{% macro ingredient(ing) -%}
@ -22,7 +22,7 @@
{% for ing in rec.ingredients %}
<li>{{ingredient(ing)}}</li>
{% endfor %}
price: {{ price(rec) }}
{% if recipe.price != None %}price: {{price(rec.price)}}{%endif%}
{% endif %}
{% if rec.steps|length != 0 %}
<h3>Steps</h3>