diff --git a/pages/suche_beitraege.go b/pages/suche_beitraege.go index bc31ae9..fab2688 100644 --- a/pages/suche_beitraege.go +++ b/pages/suche_beitraege.go @@ -67,6 +67,39 @@ func (p *BeitraegeFilterParameters) FieldSetBeitraege() []dbmodels.FTS5QueryRequ return ret } +func (p BeitraegeFilterParameters) ToQueryParams() string { + r := "" + if p.Agent != "" { + r += "&" + FILTER_PARAM_BEIAEGE_AGENT + "=" + p.Agent + } + if p.Type != "" { + r += "&" + FILTER_PARAM_BEIAEGE_TYPE + "=" + p.Type + } + if p.Year != "" { + r += "&" + FILTER_PARAM_BEIAEGE_YEAR + "=" + p.Year + } + if p.OnlyScans { + r += "&" + FILTER_PARAM_BEIAEGE_ONLYSCANS + "=on" + } + + return r +} + +func (p BeitraegeFilterParameters) ToQueryParamsWOScans() string { + r := "" + if p.Agent != "" { + r += "&" + FILTER_PARAM_BEIAEGE_AGENT + "=" + p.Agent + } + if p.Type != "" { + r += "&" + FILTER_PARAM_BEIAEGE_TYPE + "=" + p.Type + } + if p.Year != "" { + r += "&" + FILTER_PARAM_BEIAEGE_YEAR + "=" + p.Year + } + + return r +} + type SearchResultBeitraege struct { Queries []dbmodels.FTS5QueryRequest diff --git a/views/layouts/default/root.gohtml b/views/layouts/default/root.gohtml index 3463505..4df021e 100644 --- a/views/layouts/default/root.gohtml +++ b/views/layouts/default/root.gohtml @@ -21,14 +21,12 @@ {{ end }} - - - + diff --git a/views/routes/suche/beitraege/body.gohtml b/views/routes/suche/beitraege/body.gohtml index cc38be8..7acd368 100644 --- a/views/routes/suche/beitraege/body.gohtml +++ b/views/routes/suche/beitraege/body.gohtml @@ -140,14 +140,15 @@ {{- template "_fieldscript" -}} {{- if $model.parameters.IsBeitraegeSearch -}} -