Update rezept zusammenfassung

This commit is contained in:
L3D 2021-08-11 21:42:40 +02:00
parent 9be29c26ef
commit 07ea84e89e
Signed by: l3d
GPG key ID: CD08445BFF4313D1
8 changed files with 104 additions and 10 deletions

View file

@ -40,4 +40,4 @@ trailer:
Du kennst noch weitere Möglichkeiten ein Waffeleisen zu verwenden? Wir freuen uns sehr, wenn du uns deine Rezepte und Ideen weiter gibst. Du kennst noch weitere Möglichkeiten ein Waffeleisen zu verwenden? Wir freuen uns sehr, wenn du uns deine Rezepte und Ideen weiter gibst.
Das geht per E-Mail. Alternativ kannst du es selbst hier veröffentlichen. Denn diese Webseite kannst du [auf GitHub](https://github.com/c3woc/c3woc-website.git) bearbeiten! Das geht per E-Mail. Alternativ kannst du es selbst hier veröffentlichen. Denn diese Webseite kannst du [auf GitHub](https://github.com/c3woc/c3woc-website.git) bearbeiten!
--- ---
body: hello world body:

View file

@ -8,7 +8,7 @@
{%- for child in post.children -%} {%- for child in post.children -%}
{%- if child._template == 'zutaten.yaml' -%} {%- if child._template == 'zutaten.yaml' -%}
{%- if from_index -%} {%- if from_index -%}
{{ '\n ' -}} <a href="{{ child|url }}/../">{{ child.recipe_name }}</a> {%- include "zutaten/rezept_from_index.html" -%}
{%- else -%} {%- else -%}
{%- include "zutaten/rezept.html" -%} {%- include "zutaten/rezept.html" -%}
{%- endif -%} {%- endif -%}

View file

@ -34,7 +34,7 @@
{%- endif -%} {%- endif -%}
{{- '\n ' -}} </div> {{- '\n ' -}} </div>
{{- '\n ' -}} </div> {{- '\n ' -}} </div>
{#- {#-
Nachdem die Zutaten des Rezept nun angegeben sind, Nachdem die Zutaten des Rezept nun angegeben sind,
folgt die Zubereitung der waffelfähigen Teigprodukte... folgt die Zubereitung der waffelfähigen Teigprodukte...
@ -43,7 +43,7 @@
{%- if child.steps is defined and child.steps.blocks is defined and child.steps != "" -%} {%- if child.steps is defined and child.steps.blocks is defined and child.steps != "" -%}
{%- if child.steps.blocks is defined and child.steps.blocks != "" and child.steps.blocks != [] -%} {%- if child.steps.blocks is defined and child.steps.blocks != "" and child.steps.blocks != [] -%}
{%- include "zutaten/zubereitung.html" -%} {%- include "zutaten/zubereitung.html" -%}
{%- endif -%} {%- endif -%}
{%- endif -%} {%- endif -%}
{%- include "zutaten/hinweise.html" -%} {%- include "zutaten/hinweise.html" -%}
{#- {#-

View file

@ -0,0 +1,50 @@
{#-
HTML Rendering des Rezept aus dem zutaten.yaml template
für die Übersichtsseite /rezept nur das nötigste...
-#}
{%- for child in post.children -%}
{%- if child._template == 'zutaten.yaml' -%}
{#-
Zunächst werden die Zutaten des Rezept definiert...
-#}
{{- '\n ' -}} <div class="content__box">
{{- '\n ' -}} <div class="content__inner_box">
{{- '\n ' -}}
{%- if child.recipe_uuid is defined and child.recipe_uuid != "" -%}
<h1 id="{{ child.recipe_uuid }}">
{%- else -%}
<h1>
{%- endif -%}
{%- if child.recipe_name and child.recipe_name != "" -%}
{{ child.recipe_name }}</h1>
{%- else -%}
{{ child.title }}</h1>
{%- endif -%}
{%- if child.servings is defined and child.servings != "" -%}
{%- if child.servings.blocks != [] -%}
{%- include "zutaten/zutaten_short.html" -%}
{%- else -%}
<p>ungültige Rezeptangaben</p>
{%- endif -%}
{%- endif -%}
{{- '\n ' -}} </div>
{{- '\n ' -}} </div>
{#-
Nachdem die Zutaten des Rezept nun angegeben sind,
folgt die Zubereitung der waffelfähigen Teigprodukte...
-#}
{%- if child.steps is defined and child.steps.blocks is defined and child.steps != "" -%}
{%- if child.steps.blocks is defined and child.steps.blocks != "" and child.steps.blocks != [] -%}
{%- set only_render_steps = true -%}
{%- include "zutaten/zubereitung.html" -%}
{%- endif -%}
{%- endif -%}
{%- endif -%}
{%- endfor -%}

View file

@ -9,14 +9,14 @@
{%- if stp.step is defined and stp.step != "" -%} {%- if stp.step is defined and stp.step != "" -%}
{{- '\n ' -}} <li> {{- '\n ' -}} <li>
{{- '\n ' -}} <span>{{ stp.step }}</span> {{- '\n ' -}} <span>{{ stp.step }}</span>
{%- if stp.haccp_type is defined and stp.haccp_type != "" and stp.haccp_string is defined and stp.haccp_string != "" -%} {%- if stp.haccp_type is defined and stp.haccp_type != "" and stp.haccp_string is defined and stp.haccp_string != "" and not only_render_steps | default(false) -%}
{{- '\n ' -}} <ul> {{- '\n ' -}} <ul>
{{- '\n ' -}} <li> {{- '\n ' -}} <li>
{{- '\n ' -}}<span class="{{- stp.haccp_type|lower -}}">{{ stp.haccp_string }}</span> {{- '\n ' -}}<span class="{{- stp.haccp_type|lower -}}">{{ stp.haccp_string }}</span>
{{- '\n ' -}} </li> {{- '\n ' -}} </li>
{{- '\n ' -}} </ul> {{- '\n ' -}} </ul>
{%- endif %} {%- endif %}
{%- if stp.notes is defined and stp.notes != "" and stp.notes.blocks is defined %} {%- if stp.notes is defined and stp.notes != "" and stp.notes.blocks is defined and not only_render_steps | default(false) -%}
{%- if stp.notes.blocks != [] -%} {%- if stp.notes.blocks != [] -%}
{{- '\n ' -}} <ul> {{- '\n ' -}} <ul>
{%- for nde in stp.notes.blocks -%} {%- for nde in stp.notes.blocks -%}

View file

@ -22,7 +22,7 @@
Hier wird eine kurznotiz zur verarbeitung gerendert Hier wird eine kurznotiz zur verarbeitung gerendert
oder ein Link zur Verarbeitungsnotiz. oder ein Link zur Verarbeitungsnotiz.
-#} -#}
{%- 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 != "" and not hide_recepie_processing | default(false) -%}
{%- if ing.processing.blocks != [] -%} {%- if ing.processing.blocks != [] -%}
{%- for prc in ing.processing.blocks -%} {%- for prc in ing.processing.blocks -%}
{%- if loop.index == 1 -%} {%- if loop.index == 1 -%}
@ -40,7 +40,7 @@
{#- {#-
Render alternativzutat, wenn verfügbar! Render alternativzutat, wenn verfügbar!
-#} -#}
{%- if ing.substitutions is defined and ing.substitutions != "" -%} {%- if ing.substitutions is defined and ing.substitutions != "" and not hide_recepie_substitutions | default(false) -%}
{%- if ing.substitutions.blocks is defined and ing.substitutions.blocks != "" -%} {%- if ing.substitutions.blocks is defined and ing.substitutions.blocks != "" -%}
{%- if ing.substitutions.blocks != [] -%} {%- if ing.substitutions.blocks != [] -%}
{%- for sst in ing.substitutions.blocks -%} {%- for sst in ing.substitutions.blocks -%}

View file

@ -14,7 +14,7 @@
Hier wird eine kurznotiz zur verarbeitung gerendert Hier wird eine kurznotiz zur verarbeitung gerendert
oder ein Link zur Verarbeitungsnotiz. oder ein Link zur Verarbeitungsnotiz.
-#} -#}
{%- 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 != "" and not hide_recepie_processing | default(false) -%}
{%- if ing.processing.blocks != [] -%} {%- if ing.processing.blocks != [] -%}
{%- for prc in ing.processing.blocks -%} {%- for prc in ing.processing.blocks -%}
{%- if loop.index == 1 -%} {%- if loop.index == 1 -%}
@ -32,7 +32,7 @@
{#- {#-
Render alternativzutat, wenn verfügbar! Render alternativzutat, wenn verfügbar!
-#} -#}
{%- if ing.substitutions is defined and ing.substitutions != "" -%} {%- if ing.substitutions is defined and ing.substitutions != "" and not hide_recepie_substitutions | default(false) -%}
{%- if ing.substitutions.blocks is defined and ing.substitutions.blocks != "" -%} {%- if ing.substitutions.blocks is defined and ing.substitutions.blocks != "" -%}
{%- if ing.substitutions.blocks != [] -%} {%- if ing.substitutions.blocks != [] -%}
{%- for sst in ing.substitutions.blocks -%} {%- for sst in ing.substitutions.blocks -%}

View file

@ -0,0 +1,44 @@
{#-
Hier werden die einzelnen
Zutaten für die kurzfassung des Rezept gerendert...
-#}
{%- for prt in child.servings.blocks -%}
{#-
Zunächst schauen wir, für was für Mengen das Rezept definiert ist.
Für jede fefinierte Menge haben wir einen neuen Durchlauf in dem for loop
-#}
{%- set prt_loop = 1 -%}
{%- set hide_recepie_processing = true -%}
{%- set hide_recepie_substitutions = true -%}
{%- if loop.index == 1 -%}
{#-
in der prt_loop variable speichern wir in welchem loop index die zutat steht.
Wir wollen hier nur die erste angabe (loop.index == 1) rendern.
-#}
{%- if child.ingredients is defined and child.ingredients != "" %}
{%- if child.ingredients.blocks != [] -%}
{{- '\n ' -}} <ul>
{#-
Hier wird nun die konkrete Zutat angegeben.
Also zB. Eier: 4 Stück.
-#}
{%- include "zutaten/zutat_menge.html" -%}
{{- '\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 -%}
{%- endif -%}
{%- endfor -%}