show full recipe price every time with a clarification if necessary

This commit is contained in:
Emi Vasilek 2024-05-12 22:18:45 +00:00
parent 8046f0d237
commit 88f801cadb
4 changed files with 40 additions and 7 deletions

View file

@ -1,6 +1,17 @@
{% macro price(price) -%}
{% if price != None and price is defined and price.price is defined %}{{price.price|round(1)|numprint}}{%else%}?{% endif %} {{price.currency}}
{%- endmacro %}
{% macro multiprice(multiprice, shortform) -%}
{% if multiprice != None and multiprice.pricedb != None and multiprice.pricedb is defined and multiprice.pricedb.price is defined -%}
{{multiprice.pricedb.price|round(1)|numprint}}
{%else%}
?
{%- endif %}
{{multiprice.pricedb.currency}}
{%if multiprice.item_prices_missing != 0 and not shortform%}
({{multiprice.item_prices_missing}}/{{multiprice.item_count}} prices missing)
{%endif%}
{%- endmacro %}
<!DOCTYPE html>
<html lang="en">
<head>