Adjust template

This commit is contained in:
L3D 2021-07-29 01:15:36 +02:00
parent 2a648f89d7
commit 0b41a90ae6
Signed by: l3d
GPG key ID: CD08445BFF4313D1

View file

@ -55,6 +55,7 @@
{%- if ing.ingredient is defined and ing.ingredient != "" -%} {%- if ing.ingredient is defined and ing.ingredient != "" -%}
{%- if ing.amounts is defined and ing.amounts != "" and ing.amounts.blocks is defined and ing.amounts.blocks != "" -%} {%- if ing.amounts is defined and ing.amounts != "" and ing.amounts.blocks is defined and ing.amounts.blocks != "" -%}
{%- if ing.amounts.blocks != [] -%} {%- if ing.amounts.blocks != [] -%}
{%- set ingredient_counter = loop.index -%}
{%- for amt in ing.amounts.blocks -%} {%- for amt in ing.amounts.blocks -%}
{%- if loop.index == prt_loop -%} {%- if loop.index == prt_loop -%}
{%- if amt.amount is defined and amt.amount != "" and amt.amount != 0 and amt.amount != '0' -%} {%- if amt.amount is defined and amt.amount != "" and amt.amount != 0 and amt.amount != '0' -%}
@ -66,52 +67,15 @@
>{{ ing.ingredient }}: {{ amt.amount }} {{ amt.unit | default('each') }}</span> >{{ ing.ingredient }}: {{ amt.amount }} {{ amt.unit | default('each') }}</span>
{%- if ing.processing is defined and ing.processing != "" and ing.processing.blocks is defined and ing.processing.blocks != "" -%} {%- if ing.processing is defined and ing.processing != "" and ing.processing.blocks is defined and ing.processing.blocks != "" -%}
{%- if ing.processing.blocks != [] -%} {%- if ing.processing.blocks != [] -%}
{{- '\n ' -}} <ul> {{- ' | ' -}}
{{- '\n ' -}} <li> <a href="#processing_{{- ingredient_counter | string -}}"_ class="processing">Verarbeitungshinweis #{{- ingredient_counter | string -}}</a>
{{- '\n ' -}}
<span class="processing">Verarbeitungshinweis
{%- for tmp_prc in ing.processing.blocks -%}
{%- if loop.index == 2 -%}
{{- 'e' -}}
{%- endif -%}
{%- endfor -%}
:</span>
{{- '\n ' -}}
<ul>
{%- for prc in ing.processing.blocks -%}
{{- '\n ' -}} <li>
{{- '\n ' -}}
<span class="ingredientprocessing">{{ prc.process }}</span>
{{- '\n ' -}} </li>
{%- endfor -%}
{{- '\n ' -}} </ul>
{{- '\n ' -}} </li>
{{- '\n ' -}} </ul>
{%- endif -%} {%- endif -%}
{%- endif -%} {%- endif -%}
{%- if ing.notes is defined and ing.notes != "" and ing.notes.blocks is defined and ing.notes.blocks != "" -%} {%- if ing.notes is defined and ing.notes != "" and ing.notes.blocks is defined and ing.notes.blocks != "" -%}
{%- if ing.notes.blocks != [] -%} {%- if ing.notes.blocks != [] -%}
{{- '\n ' -}} <ul> {{- ' | ' -}}
{{- '\n ' -}} <li> <a href="#note_{{- ingredient_counter | string -}}" class="ingredientnotes">Notiz #{{- ingredient_counter | string -}}</a>
{{- '\n ' -}} {{- '\n ' -}}
<span class="ingredientnotes">Notiz
{%- for tmp_nde in ing.notes.blocks -%}
{%- if loop.index == 2 -%}
{{- 'en' -}}
{%- endif -%}
{%- endfor -%}
:</span>
{{- '\n ' -}}
<ul>
{%- for nde in ing.notes.blocks -%}
{{- '\n ' -}} <li>
{{- '\n ' -}}
<span class="ingredientnotes">{{ nde.note }}</span>
{{- '\n ' -}} </li>
{%- endfor -%}
{{- '\n ' -}} </ul>
{{- '\n ' -}} </li>
{{- '\n ' -}} </ul>
{%- endif -%} {%- endif -%}
{%- endif -%} {%- endif -%}
{%- if ing.substitutions is defined and ing.substitutions != "" -%} {%- if ing.substitutions is defined and ing.substitutions != "" -%}
@ -205,22 +169,106 @@
{%- endif -%} {%- endif -%}
{%- endfor -%} {%- endfor -%}
{{- '\n ' -}} </ul> {{- '\n ' -}} </ul>
{%- else -%}
{{- '\n ' -}} <ul>
{{- '\n ' -}} <span>Keine Zutaten definiert</span>
{{- '\n ' -}} </ul>
{%- endif -%}
{%- else -%}
{{- '\n ' -}} <ul>
{{- '\n ' -}} <span>Keine Zutaten definiert</span>
{{- '\n ' -}} </ul>
{%- endif -%}
{%- if child.ingredients is defined and child.ingredients != "" %}
{%- if child.ingredients.blocks != [] -%}
{{- '\n ' -}} <ul>
{%- for ing1 in child.ingredients.blocks %}
{%- if ing1.ingredient is defined and ing1.ingredient != "" -%}
{%- if ing1.amounts is defined and ing1.amounts != "" and ing1.amounts.blocks is defined and ing1.amounts.blocks != "" -%}
{%- if ing1.amounts.blocks != [] -%}
{%- set ingredient_counter = loop.index -%}
{%- for amt in ing1.amounts.blocks -%}
{%- if loop.index == prt_loop -%}
{%- if amt.amount is defined and amt.amount != "" and amt.amount != 0 and amt.amount != '0' -%}
{%- if ing1.processing is defined and ing1.processing != "" and ing1.processing.blocks is defined and ing1.processing.blocks != "" -%}
{%- if ing1.processing.blocks != [] -%}
{{- '\n ' -}} <li>
{{- '\n ' -}}
<span id="processing_{{- ingredient_counter | string -}}" class="processing">Verarbeitungshinweis
{%- for tmp_prc in ing1.processing.blocks -%}
{%- if loop.index == 2 -%}
{{- 'e' -}}
{%- endif -%}
{%- endfor -%}
{{- ' #' -}}
{{- ingredient_counter | string -}}:</span>
{{- '\n ' -}}
<ul>
{%- for prc in ing1.processing.blocks -%}
{{- '\n ' -}} <li>
{{- '\n ' -}}
<span class="ingredientprocessing">{{ prc.process }}</span>
{{- '\n ' -}} </li>
{%- endfor -%}
{{- '\n ' -}} </ul>
{{- '\n ' -}} </li>
{{- '\n ' -}} </ul>
{%- endif -%}
{%- endif -%}
{%- if ing1.notes is defined and ing1.notes != "" and ing1.notes.blocks is defined and ing1.notes.blocks != "" -%}
{%- if ing1.notes.blocks != [] -%}
{{- '\n ' -}} <ul>
{{- '\n ' -}} <li>
{{- '\n ' -}}
<span id="note_{{- ingredient_counter | string -}}" class="ingredientnotes">Notiz
{%- for tmp_nde in ing1.notes.blocks -%}
{%- if loop.index == 2 -%}
{{- 'en' -}}
{%- endif -%}
{%- endfor -%}
{{- ' #' -}} {{- ingredient_counter | string -}}:</span>
{{- '\n ' -}}
<ul>
{%- for nde in ing1.notes.blocks -%}
{{- '\n ' -}} <li>
{{- '\n ' -}}
<span class="ingredientnotes">{{ nde.note }}</span>
{{- '\n ' -}} </li>
{%- endfor -%}
{{- '\n ' -}} </ul>
{{- '\n ' -}} </li>
{{- '\n ' -}} </ul>
{%- endif -%}
{%- endif -%}
{{- '\n ' -}} </li>
{%- endif -%}
{%- endif -%}
{%- endfor -%}
{%- endif -%}
{%- endif -%}
{%- endif -%}
{%- endfor -%}
{{- '\n ' -}} </ul>
{%- else -%} {%- else -%}
{{- '\n ' -}} <ul> {{- '\n ' -}} <ul>
{{- '\n ' -}} <span>Keine Zutaten definiert</span> {{- '\n ' -}} <span>Keine Zutaten definiert</span>
{{- '\n ' -}} </ul> {{- '\n ' -}} </ul>
{%- endif -%}
{%- else -%}
{{- '\n ' -}} <ul>
{{- '\n ' -}} <span>Keine Zutaten definiert</span>
{{- '\n ' -}} </ul>
{%- endif -%} {%- endif -%}
{%- else -%} {%- endfor -%}
{{- '\n ' -}} <ul> {%- endif -%}
{{- '\n ' -}} <span>Keine Zutaten definiert</span>
{{- '\n ' -}} </ul>
{%- endif -%}
{%- endfor -%}
{%- endif -%} {%- endif -%}
{{- '\n ' -}} </div>
{{- '\n ' -}} </div>
{%- endif -%} {%- endif -%}
{{- '\n ' -}} </div>
{{- '\n ' -}} </div>
{%- endif -%}
{#- {#-
Rezept Schritte... Rezept Schritte...