mirror of
https://github.com/Theodor-Springmann-Stiftung/musenalm.git
synced 2025-10-29 09:15:33 +00:00
Extended reihen search
This commit is contained in:
275
pages/suche.go
275
pages/suche.go
@@ -52,17 +52,14 @@ func (p *SuchePage) Setup(router *router.Router[*core.RequestEvent], app core.Ap
|
|||||||
return engine.Response404(e, err, nil)
|
return engine.Response404(e, err, nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
if paras.Query != "" {
|
allparas, _ := NewSearchParameters(e, *paras)
|
||||||
switch paras.Collection {
|
|
||||||
case "baende":
|
if paras.Query != "" || allparas.IsBaendeSearch() {
|
||||||
return p.SimpleSearchBaendeRequest(app, engine, e, *paras)
|
return p.SearchBaendeRequest(app, engine, e, *allparas)
|
||||||
case "beitraege":
|
|
||||||
return p.SimpleSearchReihenRequest(app, engine, e)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
data := make(map[string]interface{})
|
data := make(map[string]interface{})
|
||||||
data["parameters"] = paras
|
data["parameters"] = allparas
|
||||||
return engine.Response200(e, p.Template+paras.Collection+"/", data, p.Layout)
|
return engine.Response200(e, p.Template+paras.Collection+"/", data, p.Layout)
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -73,21 +70,17 @@ func (p *SuchePage) SimpleSearchReihenRequest(app core.App, engine *templating.E
|
|||||||
return engine.Response404(e, nil, nil)
|
return engine.Response404(e, nil, nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *SuchePage) SimpleSearchBaendeRequest(app core.App, engine *templating.Engine, e *core.RequestEvent, pp Parameters) error {
|
func (p *SuchePage) SearchBaendeRequest(app core.App, engine *templating.Engine, e *core.RequestEvent, params SearchParameters) error {
|
||||||
data := make(map[string]interface{})
|
data := make(map[string]interface{})
|
||||||
params, err := NewSearchParameters(e, pp)
|
|
||||||
if err != nil {
|
|
||||||
return engine.Response404(e, err, nil)
|
|
||||||
}
|
|
||||||
|
|
||||||
result, err := SimpleSearchBaende(app, *params)
|
result, err := SimpleSearchBaende(app, params)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return engine.Response404(e, err, nil)
|
return engine.Response404(e, err, nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
data["parameters"] = params
|
data["parameters"] = params
|
||||||
data["result"] = result
|
data["result"] = result
|
||||||
return engine.Response200(e, p.Template+pp.Collection+"/", data, p.Layout)
|
return engine.Response200(e, p.Template+params.Collection+"/", data, p.Layout)
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -177,11 +170,6 @@ type SearchParameters struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func NewSearchParameters(e *core.RequestEvent, p Parameters) (*SearchParameters, error) {
|
func NewSearchParameters(e *core.RequestEvent, p Parameters) (*SearchParameters, error) {
|
||||||
q := e.Request.URL.Query().Get(PARAM_QUERY)
|
|
||||||
if q == "" {
|
|
||||||
return nil, ErrNoQuery
|
|
||||||
}
|
|
||||||
|
|
||||||
alm := e.Request.URL.Query().Get(BAENDE_PARAM_ALM_NR) == "on"
|
alm := e.Request.URL.Query().Get(BAENDE_PARAM_ALM_NR) == "on"
|
||||||
title := e.Request.URL.Query().Get(BAENDE_PARAM_TITLE) == "on"
|
title := e.Request.URL.Query().Get(BAENDE_PARAM_TITLE) == "on"
|
||||||
series := e.Request.URL.Query().Get(BAENDE_PARAM_SERIES) == "on"
|
series := e.Request.URL.Query().Get(BAENDE_PARAM_SERIES) == "on"
|
||||||
@@ -191,6 +179,15 @@ func NewSearchParameters(e *core.RequestEvent, p Parameters) (*SearchParameters,
|
|||||||
annotations := e.Request.URL.Query().Get(BAENDE_PARAM_ANNOTATIONS) == "on"
|
annotations := e.Request.URL.Query().Get(BAENDE_PARAM_ANNOTATIONS) == "on"
|
||||||
year := e.Request.URL.Query().Get(BAENDE_PARAM_YEAR) == "on"
|
year := e.Request.URL.Query().Get(BAENDE_PARAM_YEAR) == "on"
|
||||||
|
|
||||||
|
almstring := e.Request.URL.Query().Get(BAENDE_PARAM_ALM_NR + "string")
|
||||||
|
titlestring := e.Request.URL.Query().Get(BAENDE_PARAM_TITLE + "string")
|
||||||
|
seriesstring := e.Request.URL.Query().Get(BAENDE_PARAM_SERIES + "string")
|
||||||
|
personsstring := e.Request.URL.Query().Get(BAENDE_PARAM_PERSONS + "string")
|
||||||
|
placesstring := e.Request.URL.Query().Get(BAENDE_PARAM_PLACES + "string")
|
||||||
|
refsstring := e.Request.URL.Query().Get(BAENDE_PARAM_REFS + "string")
|
||||||
|
annotationsstring := e.Request.URL.Query().Get(BAENDE_PARAM_ANNOTATIONS + "string")
|
||||||
|
yearstring := e.Request.URL.Query().Get(BAENDE_PARAM_YEAR + "string")
|
||||||
|
|
||||||
sort := e.Request.URL.Query().Get("sort")
|
sort := e.Request.URL.Query().Get("sort")
|
||||||
if sort == "" {
|
if sort == "" {
|
||||||
sort = "year"
|
sort = "year"
|
||||||
@@ -210,42 +207,90 @@ func NewSearchParameters(e *core.RequestEvent, p Parameters) (*SearchParameters,
|
|||||||
Refs: refs,
|
Refs: refs,
|
||||||
Year: year,
|
Year: year,
|
||||||
Series: series,
|
Series: series,
|
||||||
|
|
||||||
|
// INFO: Expanded search
|
||||||
|
AlmString: almstring,
|
||||||
|
TitleString: titlestring,
|
||||||
|
SeriesString: seriesstring,
|
||||||
|
PersonsString: personsstring,
|
||||||
|
PlacesString: placesstring,
|
||||||
|
RefsString: refsstring,
|
||||||
|
AnnotationsString: annotationsstring,
|
||||||
|
YearString: yearstring,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p SearchParameters) ToQueryParams() string {
|
func (p SearchParameters) AllSearchTerms() string {
|
||||||
if !p.Extended {
|
q := p.Query + " " + p.AnnotationsString + " " + p.PersonsString + " " + p.TitleString + " " + p.AlmString + " " + p.SeriesString + " " + p.PlacesString + " " + p.RefsString + " " + p.YearString
|
||||||
q := fmt.Sprintf("?q=%s", p.Query)
|
return q
|
||||||
if p.Alm {
|
|
||||||
q += "&alm=on"
|
|
||||||
}
|
|
||||||
if p.Title {
|
|
||||||
q += "&title=on"
|
|
||||||
}
|
|
||||||
if p.Persons {
|
|
||||||
q += "&persons=on"
|
|
||||||
}
|
|
||||||
if p.Annotations {
|
|
||||||
q += "&annotations=on"
|
|
||||||
}
|
|
||||||
if p.Series {
|
|
||||||
q += "&series=on"
|
|
||||||
}
|
|
||||||
if p.Places {
|
|
||||||
q += "&places=on"
|
|
||||||
}
|
|
||||||
if p.Refs {
|
|
||||||
q += "&references=on"
|
|
||||||
}
|
|
||||||
if p.Year {
|
|
||||||
q += "&year=on"
|
|
||||||
}
|
|
||||||
return q
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p SearchParameters) IsBeandeSearch() bool {
|
func (p SearchParameters) ToQueryParams() string {
|
||||||
|
q := "?"
|
||||||
|
|
||||||
|
// TODO: use variables, url escape
|
||||||
|
if p.Extended {
|
||||||
|
q += "extended=true"
|
||||||
|
}
|
||||||
|
|
||||||
|
if p.Query != "" {
|
||||||
|
q += fmt.Sprintf("q=%s", p.Query)
|
||||||
|
}
|
||||||
|
|
||||||
|
if p.Alm {
|
||||||
|
q += "&alm=on"
|
||||||
|
}
|
||||||
|
if p.Title {
|
||||||
|
q += "&title=on"
|
||||||
|
}
|
||||||
|
if p.Persons {
|
||||||
|
q += "&persons=on"
|
||||||
|
}
|
||||||
|
if p.Annotations {
|
||||||
|
q += "&annotations=on"
|
||||||
|
}
|
||||||
|
if p.Series {
|
||||||
|
q += "&series=on"
|
||||||
|
}
|
||||||
|
if p.Places {
|
||||||
|
q += "&places=on"
|
||||||
|
}
|
||||||
|
if p.Refs {
|
||||||
|
q += "&references=on"
|
||||||
|
}
|
||||||
|
if p.Year {
|
||||||
|
q += "&year=on"
|
||||||
|
}
|
||||||
|
|
||||||
|
if p.YearString != "" {
|
||||||
|
q += fmt.Sprintf("&yearstring=%s", p.YearString)
|
||||||
|
}
|
||||||
|
if p.AnnotationsString != "" {
|
||||||
|
q += fmt.Sprintf("&annotationsstring=%s", p.AnnotationsString)
|
||||||
|
}
|
||||||
|
if p.PersonsString != "" {
|
||||||
|
q += fmt.Sprintf("&personsstring=%s", p.PersonsString)
|
||||||
|
}
|
||||||
|
if p.TitleString != "" {
|
||||||
|
q += fmt.Sprintf("&titlestring=%s", p.TitleString)
|
||||||
|
}
|
||||||
|
if p.AlmString != "" {
|
||||||
|
q += fmt.Sprintf("&almstring=%s", p.AlmString)
|
||||||
|
}
|
||||||
|
if p.SeriesString != "" {
|
||||||
|
q += fmt.Sprintf("&seriesstring=%s", p.SeriesString)
|
||||||
|
}
|
||||||
|
if p.PlacesString != "" {
|
||||||
|
q += fmt.Sprintf("&placesstring=%s", p.PlacesString)
|
||||||
|
}
|
||||||
|
if p.RefsString != "" {
|
||||||
|
q += fmt.Sprintf("&refsstring=%s", p.RefsString)
|
||||||
|
}
|
||||||
|
|
||||||
|
return q
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p SearchParameters) IsBaendeSearch() bool {
|
||||||
return p.Collection == "baende" && (p.Query != "" || (p.AnnotationsString != "" || p.PersonsString != "" || p.TitleString != "" || p.AlmString != "" || p.SeriesString != "" || p.PlacesString != "" || p.RefsString != "" || p.YearString != ""))
|
return p.Collection == "baende" && (p.Query != "" || (p.AnnotationsString != "" || p.PersonsString != "" || p.TitleString != "" || p.AlmString != "" || p.SeriesString != "" || p.PlacesString != "" || p.RefsString != "" || p.YearString != ""))
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -295,85 +340,83 @@ func (p SearchParameters) FieldSetBaende() []dbmodels.FTS5QueryRequest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if p.IsExtendedSearch() {
|
if p.AnnotationsString != "" {
|
||||||
if p.AnnotationsString != "" {
|
que := dbmodels.NormalizeQuery(p.AnnotationsString)
|
||||||
que := dbmodels.NormalizeQuery(p.AnnotationsString)
|
if len(que) > 0 {
|
||||||
if len(que) > 0 {
|
ret = append(ret, dbmodels.FTS5QueryRequest{
|
||||||
ret = append(ret, dbmodels.FTS5QueryRequest{
|
Fields: []string{dbmodels.ANNOTATION_FIELD},
|
||||||
Fields: []string{dbmodels.ANNOTATION_FIELD},
|
Query: que,
|
||||||
Query: que,
|
})
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if p.PersonsString != "" {
|
if p.PersonsString != "" {
|
||||||
que := dbmodels.NormalizeQuery(p.PersonsString)
|
que := dbmodels.NormalizeQuery(p.PersonsString)
|
||||||
if len(que) > 0 {
|
if len(que) > 0 {
|
||||||
ret = append(ret, dbmodels.FTS5QueryRequest{
|
ret = append(ret, dbmodels.FTS5QueryRequest{
|
||||||
Fields: []string{dbmodels.AGENTS_TABLE, dbmodels.RESPONSIBILITY_STMT_FIELD},
|
Fields: []string{dbmodels.AGENTS_TABLE, dbmodels.RESPONSIBILITY_STMT_FIELD},
|
||||||
Query: que,
|
Query: que,
|
||||||
})
|
})
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if p.TitleString != "" {
|
if p.TitleString != "" {
|
||||||
que := dbmodels.NormalizeQuery(p.TitleString)
|
que := dbmodels.NormalizeQuery(p.TitleString)
|
||||||
if len(que) > 0 {
|
if len(que) > 0 {
|
||||||
ret = append(ret, dbmodels.FTS5QueryRequest{
|
ret = append(ret, dbmodels.FTS5QueryRequest{
|
||||||
Fields: []string{dbmodels.TITLE_STMT_FIELD, dbmodels.SUBTITLE_STMT_FIELD, dbmodels.INCIPIT_STMT_FIELD, dbmodels.VARIANT_TITLE_FIELD, dbmodels.PARALLEL_TITLE_FIELD},
|
Fields: []string{dbmodels.TITLE_STMT_FIELD, dbmodels.SUBTITLE_STMT_FIELD, dbmodels.INCIPIT_STMT_FIELD, dbmodels.VARIANT_TITLE_FIELD, dbmodels.PARALLEL_TITLE_FIELD},
|
||||||
Query: que,
|
Query: que,
|
||||||
})
|
})
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if p.AlmString != "" {
|
if p.AlmString != "" {
|
||||||
que := dbmodels.NormalizeQuery(p.AlmString)
|
que := dbmodels.NormalizeQuery(p.AlmString)
|
||||||
if len(que) > 0 {
|
if len(que) > 0 {
|
||||||
ret = append(ret, dbmodels.FTS5QueryRequest{
|
ret = append(ret, dbmodels.FTS5QueryRequest{
|
||||||
Fields: []string{dbmodels.MUSENALMID_FIELD},
|
Fields: []string{dbmodels.MUSENALMID_FIELD},
|
||||||
Query: que,
|
Query: que,
|
||||||
})
|
})
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if p.SeriesString != "" {
|
if p.SeriesString != "" {
|
||||||
que := dbmodels.NormalizeQuery(p.SeriesString)
|
que := dbmodels.NormalizeQuery(p.SeriesString)
|
||||||
if len(que) > 0 {
|
if len(que) > 0 {
|
||||||
ret = append(ret, dbmodels.FTS5QueryRequest{
|
ret = append(ret, dbmodels.FTS5QueryRequest{
|
||||||
Fields: []string{dbmodels.SERIES_TABLE},
|
Fields: []string{dbmodels.SERIES_TABLE},
|
||||||
Query: que,
|
Query: que,
|
||||||
})
|
})
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if p.PlacesString != "" {
|
if p.PlacesString != "" {
|
||||||
que := dbmodels.NormalizeQuery(p.PlacesString)
|
que := dbmodels.NormalizeQuery(p.PlacesString)
|
||||||
if len(que) > 0 {
|
if len(que) > 0 {
|
||||||
ret = append(ret, dbmodels.FTS5QueryRequest{
|
ret = append(ret, dbmodels.FTS5QueryRequest{
|
||||||
Fields: []string{dbmodels.PLACES_TABLE, dbmodels.PLACE_STMT_FIELD},
|
Fields: []string{dbmodels.PLACES_TABLE, dbmodels.PLACE_STMT_FIELD},
|
||||||
Query: que,
|
Query: que,
|
||||||
})
|
})
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if p.RefsString != "" {
|
if p.RefsString != "" {
|
||||||
que := dbmodels.NormalizeQuery(p.RefsString)
|
que := dbmodels.NormalizeQuery(p.RefsString)
|
||||||
if len(que) > 0 {
|
if len(que) > 0 {
|
||||||
ret = append(ret, dbmodels.FTS5QueryRequest{
|
ret = append(ret, dbmodels.FTS5QueryRequest{
|
||||||
Fields: []string{dbmodels.REFERENCES_FIELD},
|
Fields: []string{dbmodels.REFERENCES_FIELD},
|
||||||
Query: que,
|
Query: que,
|
||||||
})
|
})
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if p.YearString != "" {
|
if p.YearString != "" {
|
||||||
que := dbmodels.NormalizeQuery(p.YearString)
|
que := dbmodels.NormalizeQuery(p.YearString)
|
||||||
if len(que) > 0 {
|
if len(que) > 0 {
|
||||||
ret = append(ret, dbmodels.FTS5QueryRequest{
|
ret = append(ret, dbmodels.FTS5QueryRequest{
|
||||||
Fields: []string{dbmodels.YEAR_FIELD},
|
Fields: []string{dbmodels.YEAR_FIELD},
|
||||||
Query: dbmodels.NormalizeQuery(p.YearString),
|
Query: dbmodels.NormalizeQuery(p.YearString),
|
||||||
})
|
})
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -52,16 +52,14 @@
|
|||||||
{{ $isPersons := false }}
|
{{ $isPersons := false }}
|
||||||
{{ $isAnnotations := false }}
|
{{ $isAnnotations := false }}
|
||||||
|
|
||||||
{{ if $model.parameters.Query }}
|
{{- $isAlm = or $model.parameters.Alm $model.parameters.AlmString -}}
|
||||||
{{- $isAlm = or $model.parameters.Alm $model.parameters.AlmString -}}
|
{{- $isTitle = or $model.parameters.Title $model.parameters.TitleString -}}
|
||||||
{{- $isTitle = or $model.parameters.Title $model.parameters.TitleString -}}
|
{{- $isRefs = or $model.parameters.Refs $model.parameters.RefsString -}}
|
||||||
{{- $isRefs = or $model.parameters.Refs $model.parameters.RefsString -}}
|
{{- $isPlaces = or $model.parameters.Places $model.parameters.PlacesString -}}
|
||||||
{{- $isPlaces = or $model.parameters.Places $model.parameters.PlacesString -}}
|
{{- $isYear = or $model.parameters.Year $model.parameters.YearString -}}
|
||||||
{{- $isYear = or $model.parameters.Year $model.parameters.YearString -}}
|
{{- $isSeries = or $model.parameters.Series $model.parameters.SeriesString -}}
|
||||||
{{- $isSeries = or $model.parameters.Series $model.parameters.SeriesString -}}
|
{{- $isPersons = or $model.parameters.Persons $model.parameters.PersonsString -}}
|
||||||
{{- $isPersons = or $model.parameters.Persons $model.parameters.PersonsString -}}
|
{{- $isAnnotations = or $model.parameters.Annotations $model.parameters.AnnotationsString -}}
|
||||||
{{- $isAnnotations = or $model.parameters.Annotations $model.parameters.AnnotationsString -}}
|
|
||||||
{{ end }}
|
|
||||||
|
|
||||||
{{- $isBase := not (or $isAlm $isTitle $isRefs $isPlaces $isYear $isSeries $isPersons
|
{{- $isBase := not (or $isAlm $isTitle $isRefs $isPlaces $isYear $isSeries $isPersons
|
||||||
$isAnnotations)
|
$isAnnotations)
|
||||||
@@ -71,13 +69,13 @@
|
|||||||
<div id="searchcontrol" class="container-normal">
|
<div id="searchcontrol" class="container-normal">
|
||||||
{{- template "_heading" $model.parameters -}}
|
{{- template "_heading" $model.parameters -}}
|
||||||
<div id="" class="border-l border-zinc-300 px-8 py-10 relative">
|
<div id="" class="border-l border-zinc-300 px-8 py-10 relative">
|
||||||
{{- if not $model.parameters.Extended -}}
|
<form
|
||||||
<form
|
id="searchform"
|
||||||
id="searchform"
|
class="w-full font-serif"
|
||||||
class="w-full font-serif"
|
method="get"
|
||||||
method="get"
|
action="/suche/baende"
|
||||||
action="/suche/baende"
|
autocomplete="off">
|
||||||
autocomplete="off">
|
{{- if not $model.parameters.Extended -}}
|
||||||
<div class="searchformcolumn">
|
<div class="searchformcolumn">
|
||||||
{{- $q := "" }}
|
{{- $q := "" }}
|
||||||
{{- if $model.parameters.Query -}}
|
{{- if $model.parameters.Query -}}
|
||||||
@@ -164,18 +162,75 @@
|
|||||||
</fieldset>
|
</fieldset>
|
||||||
{{ template "_infotextsimple" true }}
|
{{ template "_infotextsimple" true }}
|
||||||
</div>
|
</div>
|
||||||
</form>
|
{{- template "_fieldscript" -}}
|
||||||
{{- end -}}
|
{{- else -}}
|
||||||
|
<div id="extendedsearchcolumn" class="">
|
||||||
|
<input type="hidden" name="extended" value="true" />
|
||||||
|
<label for="titlestring">Titel</label>
|
||||||
|
<input
|
||||||
|
type="search"
|
||||||
|
name="titlestring"
|
||||||
|
id="titlestring"
|
||||||
|
value="{{ $model.parameters.TitleString }}" />
|
||||||
|
<label for="almstring">Almanach-Nr.</label>
|
||||||
|
<input
|
||||||
|
type="search"
|
||||||
|
name="almstring"
|
||||||
|
id="almstring"
|
||||||
|
value="{{ $model.parameters.AlmString }}" />
|
||||||
|
<label for="seriesstring">Reihentitel</label>
|
||||||
|
<input
|
||||||
|
type="search"
|
||||||
|
name="seriesstring"
|
||||||
|
id="seriesstring"
|
||||||
|
value="{{ $model.parameters.SeriesString }}" />
|
||||||
|
<label for="personsstring">Personen & Verlage</label>
|
||||||
|
<input
|
||||||
|
type="search"
|
||||||
|
name="personsstring"
|
||||||
|
id="personsstring"
|
||||||
|
value="{{ $model.parameters.PersonsString }}" />
|
||||||
|
<label for="placesstring">Orte</label>
|
||||||
|
<input
|
||||||
|
type="search"
|
||||||
|
name="placesstring"
|
||||||
|
id="placesstring"
|
||||||
|
value="{{ $model.parameters.PlacesString }}" />
|
||||||
|
<label for="yearstring">Jahr</label>
|
||||||
|
<input
|
||||||
|
type="search"
|
||||||
|
name="yearstring"
|
||||||
|
id="yearstring"
|
||||||
|
value="{{ $model.parameters.YearString }}" />
|
||||||
|
<label for="refsstring">Nachweise</label>
|
||||||
|
<input
|
||||||
|
type="search"
|
||||||
|
name="refsstring"
|
||||||
|
id="refsstring"
|
||||||
|
value="{{ $model.parameters.RefsString }}" />
|
||||||
|
<label for="annotationsstring">Anmerkungen</label>
|
||||||
|
<input
|
||||||
|
type="search"
|
||||||
|
name="annotationsstring"
|
||||||
|
id="annotationsstring"
|
||||||
|
value="{{ $model.parameters.AnnotationsString }}" />
|
||||||
|
<button id="submitbutton" type="submit" class="">Suchen</button>
|
||||||
|
<a href="/suche/baende" class="whitespace-nowrap"
|
||||||
|
><i class="ri-arrow-left-long-line"></i> Zurück zur einfachen Suche</a
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
{{- end -}}
|
||||||
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{- template "_fieldscript" -}}
|
{{- if $model.parameters.IsBaendeSearch -}}
|
||||||
|
|
||||||
{{- if $model.parameters.Query -}}
|
|
||||||
<div class="container-normal" id="searchresults">
|
<div class="container-normal" id="searchresults">
|
||||||
<div class="border-b border-zinc-300 flex flex-row justify-between">
|
<div class="border-b border-zinc-300 flex flex-row justify-between">
|
||||||
<div>
|
<div>
|
||||||
Suche nach <b>»{{ $model.parameters.Query }}«</b> ·
|
{{ if $model.parameters.Query -}}
|
||||||
|
Suche nach <b>»{{ $model.parameters.Query }}«</b> ·
|
||||||
|
{{- end -}}
|
||||||
<i class="ri-book-line"></i>
|
<i class="ri-book-line"></i>
|
||||||
{{ if eq $model.result.Count 1 -}}
|
{{ if eq $model.result.Count 1 -}}
|
||||||
Ein Band
|
Ein Band
|
||||||
@@ -189,6 +244,7 @@
|
|||||||
{{ $model.result.Series | len }} Reihen
|
{{ $model.result.Series | len }} Reihen
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<label
|
<label
|
||||||
for="sort"
|
for="sort"
|
||||||
@@ -250,7 +306,7 @@
|
|||||||
let mark_instance = new Mark(elements);
|
let mark_instance = new Mark(elements);
|
||||||
// INFO: we wait a little bit before marking, to settle everything
|
// INFO: we wait a little bit before marking, to settle everything
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
mark_instance.mark('{{ $model.parameters.Query }}', {
|
mark_instance.mark('{{ $model.parameters.AllSearchTerms }}', {
|
||||||
"seperateWordSearch": true,
|
"seperateWordSearch": true,
|
||||||
});
|
});
|
||||||
}, 200);
|
}, 200);
|
||||||
@@ -258,6 +314,6 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{- if not $model.result.Hits -}}
|
{{- if not $model.result.Hits -}}
|
||||||
Keine Bände gefunden.
|
<div class="container-normal">Keine Bände gefunden.</div>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|||||||
@@ -382,4 +382,28 @@
|
|||||||
input:disabled {
|
input:disabled {
|
||||||
@apply italic text-gray-500;
|
@apply italic text-gray-500;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#extendedsearchcolumn {
|
||||||
|
@apply grid grid-cols-12 gap-y-3 w-full gap-x-4;
|
||||||
|
}
|
||||||
|
|
||||||
|
#extendedsearchcolumn input {
|
||||||
|
@apply w-full px-2 py-1 border-zinc-600 border col-span-9;
|
||||||
|
}
|
||||||
|
|
||||||
|
#extendedsearchcolumn button {
|
||||||
|
@apply bg-stone-100 text-base px-2.5 py-1 rounded font-sans transition-all duration-75 col-start-4 col-span-4;
|
||||||
|
}
|
||||||
|
|
||||||
|
#extendedsearchcolumn button:hover:not(:disabled) {
|
||||||
|
@apply cursor-pointer bg-stone-200;
|
||||||
|
}
|
||||||
|
|
||||||
|
#extendedsearchcolumn button:disabled {
|
||||||
|
@apply bg-stone-300 text-gray-500 cursor-not-allowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
#extendedsearchcolumn label {
|
||||||
|
@apply col-span-3 bg-stone-200 align-middle px-2.5 text-slate-900 items-center flex text-base;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user