Files
musenalm/views/routes/suche/components/_searchform.gohtml
2025-02-25 19:23:00 +01:00

116 lines
3.4 KiB
Plaintext

{{ $model := . }}
{{- $includeReferences := true -}}
{{- $includeAnnotations := true -}}
{{- $includeTitle := true -}}
{{- if eq $model.type "reihen" -}}
{{- if $model.options -}}
{{- $includeReferences = not (and $model.q (not (index $model.options "references"))) -}}
{{- $includeAnnotations = not (and $model.q (not (index $model.options "annotations"))) -}}
{{- $includeTitle = not (and $model.q (not (index $model.options "title"))) -}}
{{- end -}}
{{- end -}}
<form
id="searchform"
class="w-full font-serif"
method="get"
action="/suche/{{- $model.type -}}"
autocomplete="off">
{{- if eq $model.type "reihen" -}}
<!-- INFO: Reihen -->
{{- if not $model.extended -}}
<div class="grid grid-cols-12 gap-y-3 w-full gap-x-4">
{{ template "searchboxsimple" Arr . false }}
<fieldset class="selectgroup">
<div class="selectgroup-option">
<input
type="checkbox"
name="title"
id="title"
{{ if $includeTitle -}}
checked
{{- end -}} />
<label for="title">Titel</label>
</div>
<div class="selectgroup-option">
<input
type="checkbox"
name="references"
id="references"
{{ if $includeReferences -}}
checked
{{- end -}} />
<label for="references">Nachweise</label>
</div>
<div class="selectgroup-option">
<input
type="checkbox"
name="annotations"
id="annotations"
{{ if $includeAnnotations -}}
checked
{{- end -}} />
<label for="annotations">Anmerkungen</label>
</div>
</fieldset>
{{ template "infotextsimple" false }}
</div>
{{- else -}}
Extended search Reihen
{{- end -}}
<!-- INFO: Ende Reihen -->
{{- else if eq $model.type "personen" -}}
<!-- INFO: Personen -->
{{- if not $model.extended -}}
<div class="grid grid-cols-12 gap-y-3 w-full gap-x-4">
{{ template "searchboxsimple" Arr . false }}
<fieldset class="selectgroup">
<div class="selectgroup-option">
<input type="checkbox" name="names" id="names" checked />
<label for="names">Namen &amp; Pseudonyme</label>
</div>
<div class="selectgroup-option">
<input type="checkbox" name="biographical" id="biographical" checked />
<label for="biographical">Lebensdaten</label>
</div>
<div class="selectgroup-option">
<input type="checkbox" name="profession" id="profession" checked />
<label for="profession">Beruf(e)</label>
</div>
<div class="selectgroup-option">
<input type="checkbox" name="references" id="references" checked />
<label for="references">Nachweise</label>
</div>
<div class="selectgroup-option">
<input type="checkbox" name="annotations" id="annotations" checked />
<label for="annotations">Anmerkungen</label>
</div>
</fieldset>
{{ template "infotextsimple" false }}
</div>
{{- else -}}
Extended search Personen
{{- end -}}
<!-- INFO: Ende Personen -->
{{- else if eq $model.type "baende" -}}
<!-- INFO: Bände -->
{{- if not $model.extended -}}
{{- else -}}
Extended search Bände
{{- end -}}
<!-- INFO: Ende Bände -->
{{- else if eq $model.type "beitraege" -}}
<!-- INFO: Beiträge -->
{{- if not $model.extended -}}
<div class="grid grid-cols-12 gap-y-3 w-full gap-x-4">
{{ template "searchboxsimple" Arr . true }}
{{ template "infotextsimple" true }}
</div>
{{- else -}}
Extended search Beiträge
{{- end -}}
{{- end -}}
</form>