mirror of
https://github.com/Theodor-Springmann-Stiftung/musenalm.git
synced 2025-10-30 17:55:31 +00:00
Basis Suche Inhalte
This commit is contained in:
@@ -68,25 +68,7 @@
|
||||
<div id="searchcontrol" class="container-normal">
|
||||
{{- template "_heading" $model.parameters -}}
|
||||
<div id="searchform" class="border-l border-zinc-300 px-8 py-10 relative">
|
||||
<form
|
||||
id="lookupform"
|
||||
class="w-full font-serif grid grid-cols-12 gap-x-4 mb-4"
|
||||
method="get"
|
||||
action="/suche/baende"
|
||||
autocomplete="off">
|
||||
<label for="almstring" class="col-span-3 align-middle hidden">Almanach-Nummer:</label>
|
||||
<input
|
||||
autocomplete="off"
|
||||
minlength="1"
|
||||
required="true"
|
||||
type="search"
|
||||
name="almstring"
|
||||
id="almstring"
|
||||
value="{{ $model.parameters.AlmString }}"
|
||||
placeholder="Alm-Nummer"
|
||||
class="w-full col-span-3 placeholder:italic" />
|
||||
<button id="submitbutton" type="submit" class="col-span-2">Nachschlagen</button>
|
||||
</form>
|
||||
{{- template "_musenalmidbox" Arr $model.parameters.AlmString "baende" -}}
|
||||
<form
|
||||
id="simplesearchform"
|
||||
class="w-full font-serif"
|
||||
@@ -122,11 +104,7 @@
|
||||
type="checkbox"
|
||||
name="persons"
|
||||
id="persons"
|
||||
{{ if or $isBase
|
||||
$isPersons
|
||||
-}}
|
||||
checked
|
||||
{{- end -}} />
|
||||
{{ if or $isBase $isPersons -}}checked{{- end -}} />
|
||||
<label for="persons">Personen & Verlage</label>
|
||||
</div>
|
||||
<div class="selectgroup-option">
|
||||
@@ -266,7 +244,7 @@
|
||||
class="h-min pb-1 border-b-4 border-zinc-300 px-1.5"
|
||||
name="sort"
|
||||
id="sort"
|
||||
hx-get="{{- $model.parameters.ToQueryParams -}}"
|
||||
hx-get="{{- $model.parameters.ToQueryParamsBaende -}}"
|
||||
trigger="change"
|
||||
hx-push-url="true"
|
||||
hx-select="main"
|
||||
@@ -315,7 +293,7 @@
|
||||
let mark_instance = new Mark(elements);
|
||||
// INFO: we wait a little bit before marking, to settle everything
|
||||
setTimeout(() => {
|
||||
mark_instance.mark('{{ $model.parameters.AllSearchTerms }}', {
|
||||
mark_instance.mark('{{ $model.parameters.AllSearchTermsBaende }}', {
|
||||
"seperateWordSearch": true,
|
||||
});
|
||||
}, 200);
|
||||
@@ -326,40 +304,3 @@
|
||||
<div class="container-normal">Keine Bände gefunden.</div>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
|
||||
<script type="module">
|
||||
const form = document.getElementById("simplesearchform");
|
||||
let submitBtn = null;
|
||||
if (form) {
|
||||
submitBtn = form.querySelector("#submitbutton");
|
||||
}
|
||||
|
||||
function checkValidity(f, btn) {
|
||||
if (f.checkValidity()) {
|
||||
btn.disabled = false;
|
||||
} else {
|
||||
btn.disabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (form && submitBtn) {
|
||||
checkValidity(form, submitBtn);
|
||||
form.addEventListener("input", (event) => {
|
||||
checkValidity(form, submitBtn);
|
||||
});
|
||||
}
|
||||
|
||||
const lookupform = document.getElementById("lookupform");
|
||||
let lookupsubmitBtn = null;
|
||||
if (lookupform) {
|
||||
lookupsubmitBtn = lookupform.querySelector("#submitbutton");
|
||||
}
|
||||
|
||||
if (lookupform && lookupsubmitBtn) {
|
||||
checkValidity(lookupform, lookupsubmitBtn);
|
||||
lookupform.addEventListener("input", (event) => {
|
||||
checkValidity(lookupform, lookupsubmitBtn);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user