2021-01-18 19:18:34 +01:00
|
|
|
<ul>
|
2023-01-19 17:08:03 +01:00
|
|
|
{{ $ingrRoot := 0 }}
|
|
|
|
{{- range . }}
|
|
|
|
{{ if isset . "percent" }}
|
|
|
|
{{ with .qt }}
|
|
|
|
{{ $ingrRoot := (int .) }}
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
{{ end -}}
|
2021-01-18 19:18:34 +01:00
|
|
|
{{- range . }}
|
|
|
|
{{ if isset . "catname" }}
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
<h2>{{ .catname | markdownify }}</h2>
|
2023-01-19 17:08:03 +01:00
|
|
|
{{- $prevIngrRoot := $ingrRoot -}}
|
2021-01-18 19:18:34 +01:00
|
|
|
{{ partial "ingredients_ul.html" .ingredients }}
|
2023-01-19 17:08:03 +01:00
|
|
|
{{- $ingrRot := $prevIngrRoot -}}
|
2021-01-18 19:18:34 +01:00
|
|
|
<ul>
|
|
|
|
|
|
|
|
{{ else }}
|
|
|
|
<li>
|
2023-01-19 17:08:03 +01:00
|
|
|
<span class="ingred-text">
|
|
|
|
<span
|
|
|
|
class="ingred-qt{{ with .qt -}}
|
|
|
|
{{ if eq . "QS" }} with_abbrv" title="Quantité Suffisante{{ end }}
|
|
|
|
{{- end }}">{{ with .qt }}{{ . | markdownify }}{{ end }}</span>
|
|
|
|
{{ with .article -}}
|
|
|
|
{{ . | markdownify -}}
|
|
|
|
{{- if substr . -1 1 | eq "'" -}}{{ else }} {{ end -}}
|
|
|
|
{{/* ^^^ No space only if article ends with an apostrophe */}}
|
|
|
|
{{- end -}}
|
|
|
|
<span class="ingred-name">{{ .name | markdownify }}</span>
|
|
|
|
</span>
|
|
|
|
<span class="ingred-baker-percent">
|
|
|
|
{{ if not eq $ingrRoot.percent 0 -}}
|
|
|
|
{{ with .qt }}
|
|
|
|
{{ if not eq . "QS" }}
|
|
|
|
{{ mul 100 (div . $ingrRoot.percent) }} %
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
{{- end }}
|
2021-01-18 19:18:34 +01:00
|
|
|
</li>
|
|
|
|
{{ end }}
|
|
|
|
{{ end -}}
|
|
|
|
</ul>
|