bunteshaus.de/themes/buha/layouts/partials/structure/article_meta.html

54 lines
2.1 KiB
HTML
Raw Normal View History

2022-04-04 03:35:13 +02:00
{{ $visible := "none" }}
{{ $covid := "false" }}
{{ $price := "false" }}
{{ $contact := "false" }}
{{ $registeremail := "false" }}
{{ if .visible }}
{{ $visible = split .visible "," }}
{{ range $visible }}
2022-04-03 21:08:42 +02:00
{{ if eq . "covid" }}
2022-04-04 03:35:13 +02:00
{{ $covid = "true" }}
2022-04-03 21:08:42 +02:00
{{ end }}
{{ if eq . "price" }}
2022-04-04 03:35:13 +02:00
{{ $price = "true" }}
2022-04-03 21:08:42 +02:00
{{ end }}
{{ if eq . "contact" }}
2022-04-04 03:35:13 +02:00
{{ $contact = "true" }}
2022-04-03 21:08:42 +02:00
{{ end }}
{{ if eq . "registeremail" }}
2022-04-04 03:35:13 +02:00
{{ $registeremail = "true" }}
{{ end }}
{{ if eq . "all" }}
{{ $contact = "true" }}
{{ $price = "true" }}
{{ $covid = "true" }}
{{ $registeremail = "true" }}
2022-04-03 21:08:42 +02:00
{{ end }}
{{ end }}
{{ end }}
<div id="articlemeta" style="font-size: smaller;">
{{ if and (ne .context.Params.when "") (ne .context.Params.when nil) }}
2022-04-04 03:35:13 +02:00
<div>{{ .context.Params.when }}</div>
2022-04-03 21:08:42 +02:00
{{ end }}
{{ if and (ne .context.Params.price "") (ne .context.Params.price nil) (eq $price "true") }}
{{ if eq .context.Params.price "free" }}
<div>Der Eintritt ist frei.</div>
{{ else }}
<div>Eintritt: {{ .context.Params.price }}</div>
{{ end }}
{{ end }}
{{ if and (ne .context.Params.registeremail "") (ne .context.Params.registeremail nil) (eq $registeremail "true")}}
<div>Anmeldung unter {{ .context.Params.registeremail | markdownify }} erwünscht</div>
2022-04-04 03:35:13 +02:00
{{ else if and (ne .context.Params.registeremail "") (ne .context.Params.registeremail nil) (eq $registeremail "false")}}
{{ $.context.Scratch.Set "meta" "true" }}
2022-04-03 21:08:42 +02:00
{{ end }}
{{ if and (ne .context.Params.covid "") (ne .context.Params.covid nil) (eq $covid "true") }}
<div>Es gilt die {{ .context.Params.covid }} Regel</div>
{{ end }}
{{ if and (ne .context.Params.contact "") (ne .context.Params.contact nil) (eq $contact "true") }}
<div>Kontakt: <a href="mailto://{{ .context.Params.contact }}">{{ .context.Params.contact }}</a></div>
2022-04-04 03:35:13 +02:00
{{ else if and (ne .context.Params.contact "") (ne .context.Params.contact nil) (eq $contact "false") }}
{{ $.context.Scratch.Set "meta" "true" }}
2022-04-03 21:08:42 +02:00
{{ end }}
2022-04-04 03:35:13 +02:00
</div>