bunteshaus.de/themes/buha/layouts/partials/tools/categories.html
2022-03-27 21:17:25 +02:00

51 lines
2.1 KiB
HTML

{{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }}
{{- $tags := slice -}}
{{- $categories := slice -}}
{{ range $pages }}
{{- if .Params.tags -}}
{{- $tags = $tags | append .Params.tags -}}
{{ end }}
{{- if .Params.categories -}}
{{- $categories = $categories | append .Params.categories -}}
{{ end }}
{{ end }}
{{- $categories := $categories | uniq -}}
{{- $tags := $tags | uniq -}}
<div style="display:flex; flex-direction: row;"> Kategorien <input type="checkbox" name="opencat" value="true" /> aufklappen</div>
<div style="flex-direction: column;" class="visibleIf" data-visibleif-rule="opencat == 'true'">
<fieldset style="max-width: 58.5rem;" id="categories" name="categories">
{{ range sort $categories }}
{{ $n := . | i18n }}
{{ if not $n }}
{{ $n = . }}
{{ end }}
<div style="display: flex; flex-direction: row;">
<input type="checkbox" name="category" id="{{ . }}-cat" value="{{ . }}"><label style="width: 20rem;" for="{{ . }}-cat">{{ strings.FirstUpper $n }}</label>
</div>
{{ end }}
</fieldset>
<label style="width: 12vw;" for="newcat">{{ i18n "new" }}</label>
<input style="max-width: 58.5rem;" type="text" class="f" name="newcat" id="newcat" placeholder="" />
</div>
<div style="display:flex; flex-direction: row;"> Tags <input type="checkbox" name="opentag" value="true" /> aufklappen</div>
<div style="flex-direction: column;" class="visibleIf" data-visibleif-rule="opentag == 'true'">
<fieldset style="display: flex; flex-direction: column; max-width: 58.5rem;" id="tags" name="tags">
{{ range sort $tags }}
{{ $n := . | i18n }}
{{ if not $n }}
{{ $n = . }}
{{ end }}
<div style="display: flex; flex-direction: row;">
<input type="checkbox" name="tags" id="{{ . }}-tag" value="{{ . }}"><label style="width: 20rem;" for="{{ . }}-tag">{{ strings.FirstUpper $n }}</label>
</div>
{{ end }}
</fieldset>
<label style="width: 12vw;" for="newtag">{{ i18n "new" }}</label>
<input style="max-width: 58.5rem;" type="text" class="f" name="newtag" id="newtag" placeholder="" />
</div>