{{ $model := . }} {{/* .result: type SearchResultBeitraege struct { Queries []dbmodels.FTS5QueryRequest // these are the sorted IDs for hits Hits []string Entries map[string]*dbmodels.Entry // <- Key: Entry ID Agents map[string]*dbmodels.Agent // <- Key: Agent IDs Contents map[string][]*dbmodels.Content // <- Key: Entry ID, or year ContentsAgents map[string][]*dbmodels.RContentsAgents // <- Key: Content ID } .parameters: type SearchParameters struct { Parameters Sort string Annotations bool Persons bool Title bool Series bool Places bool Refs bool Year bool Entry bool Incipit bool AnnotationsString string PersonsString string TitleString string AlmString string SeriesString string PlacesString string RefsString string YearString string EntryString string IncipitString string } .filters type BeitraegeFilterParameters struct { Agent string Type string Year string OnlyScans bool } */}} {{ $isAlm := false }} {{ $isTitle := false }} {{ $isYear := false }} {{ $isPerson := false }} {{ $isAnnotation := false }} {{ $isIncipit := false }} {{ $isEntry := false }} {{- $isAlm = $model.parameters.AlmString -}} {{- $isTitle = or $model.parameters.Title $model.parameters.TitleString -}} {{- $isYear = or $model.parameters.Year $model.parameters.YearString -}} {{- $isPerson = or $model.parameters.Persons $model.parameters.PersonsString -}} {{- $isAnnotation = or $model.parameters.Annotations $model.parameters.AnnotationsString -}} {{- $isIncipit = or $model.parameters.Incipit $model.parameters.IncipitString -}} {{- $isEntry = or $model.parameters.Entry $model.parameters.EntryString -}} {{- $isBase := not (or $isTitle $isYear $isPerson $isAnnotation $isIncipit $isEntry) -}}
{{- template "_heading" $model.parameters -}}
{{- template "_musenalmidbox" Arr $model.parameters.AlmString "beitraege" -}}
{{- $q := "" }} {{- if $model.parameters.Query -}} {{- $q = $model.parameters.Query -}} {{- end -}} {{ template "_searchboxsimple" Arr $model.parameters true $q }}
{{ template "_infotextsimple" true }}
{{- template "_fieldscript" -}} {{- if $model.parameters.IsBeitraegeSearch -}}
{{- $isFiltered := or $model.filters.Agent $model.filters.Year $model.filters.Type -}} {{- if and $model.result.Hits (not $isFiltered) -}} {{ template "_filterlist" $model }} {{- end -}}
{{ template "tablehead" $model }} {{ template "pills" $model }} {{- if $model.result.Hits -}}
{{- range $_, $hit := $model.result.Hits -}} {{- $e := index $model.result.Entries $hit -}} {{- $contents := index $model.result.Contents $e.Id -}}
{{ $e.PreferredTitle }}
{{- len $contents -}}
{{- range $i, $c := $contents -}} {{- $rels := index $model.result.ContentsAgents $c.Id -}} {{- template "_content" Arr $c $e $rels $model.result.Agents false true $model.parameters -}} {{- end -}}
{{- end -}}
{{- end -}} {{- if $model.result.Hits -}}
{{- template "pagination" $model -}}
{{- else -}}
Kein Beitrag gefunden.
{{- end -}}
{{- end -}}