allow using a single string as an ingredient instead of a dict

This commit is contained in:
Emi Vasilek 2023-11-28 12:28:52 +00:00
parent 072aa03a53
commit 883f0756f9
5 changed files with 59 additions and 17 deletions

View file

@ -1,6 +1,11 @@
{% extends "base.html" %}
{% macro ingredientpart(ing) -%}
{% if recipe.price != None %}{{price(ing.price)}} {%endif%}{{ing.amount|amountprint}} {{ing["unit"].name}} {{ ing.name }} {{ing.note}}
{% if recipe.price != None %}{{price(ing.price)}} {%endif%}
{% if ing.amount != None %} {{ing.amount|amountprint}}
{% if ing.unit != None %} {{ing.unit.name}}{% endif %}
{%endif%}
{{ ing.name }}
{% if ing.note != "" %} {{ing.note}}{% endif %}
{%- endmacro %}
{% macro ingredient(ing) -%}