Nach Typ suchen

This commit is contained in:
Simon Martens
2025-03-10 14:38:10 +01:00
parent 5980ce6c6c
commit b8f36274fc
7 changed files with 39 additions and 18 deletions

View File

@@ -64,6 +64,7 @@ func (p *SuchePage) Setup(router *router.Router[*core.RequestEvent], app core.Ap
data := make(map[string]interface{})
data["parameters"] = allparas
data["types"] = dbmodels.MUSENALM_TYPE_VALUES
return engine.Response200(e, p.Template+paras.Collection+"/", data, p.Layout)
})
@@ -85,6 +86,7 @@ func (p *SuchePage) SearchBeitraegeRequest(app core.App, engine *templating.Engi
data["filters"] = filterparams
data["parameters"] = params
data["result"] = result
data["types"] = dbmodels.MUSENALM_TYPE_VALUES
return engine.Response200(e, p.Template+params.Collection+"/", data, p.Layout)
}

View File

@@ -65,7 +65,7 @@ func NewSearchParameters(e *core.RequestEvent, p Parameters) (*SearchParameters,
year := e.Request.URL.Query().Get(SEARCH_PARAM_YEAR) == "on"
yearstring := e.Request.URL.Query().Get(SEARCH_PARAM_YEAR + "string")
typestring := e.Request.URL.Query().Get(BEITRAEGE_PARAM_TYPE)
typestring := e.Request.URL.Query().Get(BEITRAEGE_PARAM_TYPE + "string")
series := e.Request.URL.Query().Get(BAENDE_PARAM_SERIES) == "on"
seriesstring := e.Request.URL.Query().Get(BAENDE_PARAM_SERIES + "string")

File diff suppressed because one or more lines are too long

View File

@@ -57,7 +57,7 @@
{{ $model.result.Agent.BiographicalData }}
</span>
{{- if $model.result.Agent.References }}
<span class="inline-block bg-stone-200 px-2 mx-1 font-sans text-base rounded ">
<span class="inline-block bg-stone-200 px-2 mx-1 font-sans text-sm rounded align-middle">
{{ $model.result.Agent.References }}
</span>
{{ end }}
@@ -67,7 +67,7 @@
{{- range $i, $p := $arr -}}
<a
href="/personen/?letter={{- Upper (First $model.result.Agent.Name) -}}&filter={{ Lower $p }}#{{- $model.result.Agent.Id -}}"
class="inline-block bg-slate-200 px-2 text-base font-sans rounded mx-1
class="inline-block bg-slate-200 px-2 text-sm font-sans rounded mx-1 align-middle
hover:text-slate-900 no-underline">
{{- $p -}}
</a>

View File

@@ -45,7 +45,9 @@
Year string
OnlyScans bool
}
*/}}
.types []string
*/}}
{{ $isAlm := false }}
{{ $isTitle := false }}
@@ -109,7 +111,7 @@
name="persons"
id="persons"
{{ if or $isBase $isPerson -}}checked{{- end -}} />
<label for="person">Personen &amp; Pseudonyme</label>
<label for="persons">Personen &amp; Pseudonyme</label>
</div>
<div class="selectgroup-option">
<input
@@ -177,6 +179,17 @@
name="annotationsstring"
id="annotationsstring"
value="{{ $model.parameters.AnnotationsString }}" />
<label for="typestring">Kategorie</label>
<select name="typestring" id="typestring" class="w-full">
<option value="">Alle</option>
{{- range $i, $t := $model.types -}}
<option
value="{{ $t }}"
{{ if eq $t $model.parameters.TypeString -}}selected{{- end -}}>
{{ $t }}
</option>
{{- end -}}
</select>
<button id="submitbutton" type="submit" class="">Suchen</button>
<a href="/suche/beitraege" class="whitespace-nowrap"
><i class="ri-arrow-left-long-line"></i> Zurück zur einfachen Suche</a

View File

@@ -1,19 +1,21 @@
<script type="module">
let fieldset = document.querySelector("fieldset.selectgroup");
let checkboxes = Array.from(fieldset.querySelectorAll('input[type="checkbox"]'));
fieldset.addEventListener("change", (event) => {
let target = event.target;
if (target.type === "checkbox") {
let name = target.name;
let checked = target.checked;
if (!checked) {
let allchecked = checkboxes.filter((checkbox) => checkbox.checked);
if (allchecked.length === 0) {
target.checked = true;
if (fieldset) {
let checkboxes = Array.from(fieldset.querySelectorAll('input[type="checkbox"]'));
fieldset.addEventListener("change", (event) => {
let target = event.target;
if (target.type === "checkbox") {
let name = target.name;
let checked = target.checked;
if (!checked) {
let allchecked = checkboxes.filter((checkbox) => checkbox.checked);
if (allchecked.length === 0) {
target.checked = true;
}
}
}
}
});
});
}
const form = document.getElementById("simplesearchform");
let submitBtn = null;

View File

@@ -447,6 +447,10 @@
@apply w-full px-2 py-1 border-zinc-600 border col-span-9;
}
#extendedsearchcolumn select {
@apply w-full px-2 py-1 border-zinc-600 border col-span-9;
}
#extendedsearchcolumn button {
@apply col-start-4 col-span-4 py-2;
}