mirror of
https://github.com/Theodor-Springmann-Stiftung/musenalm.git
synced 2025-10-29 09:15:33 +00:00
Refactored Startpage
This commit is contained in:
@@ -8,6 +8,7 @@ full_bin = "./tmp/musenalm --dir ./pb_data serve"
|
|||||||
cmd = "go build -tags=dev,fts5,sqlite_icu -o ./tmp/musenalm ."
|
cmd = "go build -tags=dev,fts5,sqlite_icu -o ./tmp/musenalm ."
|
||||||
delay = 400
|
delay = 400
|
||||||
exclude_dir = [
|
exclude_dir = [
|
||||||
|
"views/transform",
|
||||||
"views/routes",
|
"views/routes",
|
||||||
"views/layouts",
|
"views/layouts",
|
||||||
"views/assets",
|
"views/assets",
|
||||||
|
|||||||
@@ -1,148 +0,0 @@
|
|||||||
package dbmodels
|
|
||||||
|
|
||||||
import (
|
|
||||||
"strconv"
|
|
||||||
|
|
||||||
"github.com/pocketbase/dbx"
|
|
||||||
"github.com/pocketbase/pocketbase/core"
|
|
||||||
)
|
|
||||||
|
|
||||||
type EntriesAgents map[string][]*REntriesAgents
|
|
||||||
|
|
||||||
func EntriesForID(app core.App, query int) ([]*Entry, error) {
|
|
||||||
entries := []*Entry{}
|
|
||||||
err := app.RecordQuery(ENTRIES_TABLE).
|
|
||||||
Where(dbx.HashExp{MUSENALMID_FIELD: strconv.Itoa(query)}).
|
|
||||||
All(&entries)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return entries, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func YearsForEntries(app core.App) ([]int, error) {
|
|
||||||
rec := []core.Record{}
|
|
||||||
err := app.RecordQuery(ENTRIES_TABLE).
|
|
||||||
Select(YEAR_FIELD + " AS id").
|
|
||||||
Distinct(true).
|
|
||||||
OrderBy("id").
|
|
||||||
All(&rec)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
years := []int{}
|
|
||||||
for _, r := range rec {
|
|
||||||
years = append(years, r.GetInt("id"))
|
|
||||||
}
|
|
||||||
|
|
||||||
return years, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func EntriesForYear(app core.App, year int) ([]*Entry, error) {
|
|
||||||
entries := []*Entry{}
|
|
||||||
err := app.RecordQuery(ENTRIES_TABLE).
|
|
||||||
Where(dbx.HashExp{YEAR_FIELD: year}).
|
|
||||||
All(&entries)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return entries, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func EntriesForAgent(app core.App, agentId string) ([]*Entry, EntriesAgents, error) {
|
|
||||||
relations := []*core.Record{}
|
|
||||||
err := app.RecordQuery(RelationTableName(ENTRIES_TABLE, AGENTS_TABLE)).
|
|
||||||
Where(dbx.HashExp{AGENTS_TABLE: agentId}).
|
|
||||||
All(&relations)
|
|
||||||
if err != nil {
|
|
||||||
return nil, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
app.ExpandRecords(relations, []string{ENTRIES_TABLE}, nil)
|
|
||||||
entries := []*Entry{}
|
|
||||||
for _, r := range relations {
|
|
||||||
record := r.ExpandedOne(ENTRIES_TABLE)
|
|
||||||
if record == nil {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
entries = append(entries, NewEntry(record))
|
|
||||||
}
|
|
||||||
|
|
||||||
agents := map[string][]*REntriesAgents{}
|
|
||||||
for _, r := range relations {
|
|
||||||
agent := NewREntriesAgents(r)
|
|
||||||
agents[agent.Entry()] = append(agents[agent.Entry()], agent)
|
|
||||||
}
|
|
||||||
|
|
||||||
return entries, agents, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func EntriesForPlace(app core.App, placeId string) ([]*Entry, error) {
|
|
||||||
entries := []*Entry{}
|
|
||||||
err := app.RecordQuery(ENTRIES_TABLE).
|
|
||||||
Where(dbx.Like(PLACES_TABLE, placeId).Match(true, true)).
|
|
||||||
All(&entries)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return entries, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func EntryForId(app core.App, id string) (*Entry, error) {
|
|
||||||
entry := &Entry{}
|
|
||||||
err := app.RecordQuery(ENTRIES_TABLE).
|
|
||||||
Where(dbx.HashExp{ID_FIELD: id}).
|
|
||||||
One(entry)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return entry, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func EntriesForIds(app core.App, ids []any) ([]*Entry, error) {
|
|
||||||
entries := []*Entry{}
|
|
||||||
err := app.RecordQuery(ENTRIES_TABLE).
|
|
||||||
Where(dbx.HashExp{ID_FIELD: ids}).
|
|
||||||
All(&entries)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return entries, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func EntryForMusenalmID(app core.App, id string) (*Entry, error) {
|
|
||||||
entry := &Entry{}
|
|
||||||
err := app.RecordQuery(ENTRIES_TABLE).
|
|
||||||
Where(dbx.HashExp{MUSENALMID_FIELD: id}).
|
|
||||||
One(entry)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return entry, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func EntriesForContents(app core.App, contents []*Content) (map[string]*Entry, error) {
|
|
||||||
cids := []any{}
|
|
||||||
for _, c := range contents {
|
|
||||||
cids = append(cids, c.Entry())
|
|
||||||
}
|
|
||||||
|
|
||||||
entries := []*Entry{}
|
|
||||||
err := app.RecordQuery(ENTRIES_TABLE).
|
|
||||||
Where(dbx.HashExp{ID_FIELD: cids}).
|
|
||||||
All(&entries)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
entriesMap := make(map[string]*Entry, len(entries))
|
|
||||||
for _, e := range entries {
|
|
||||||
entriesMap[e.Id] = e
|
|
||||||
}
|
|
||||||
|
|
||||||
return entriesMap, nil
|
|
||||||
}
|
|
||||||
@@ -103,6 +103,11 @@ func Series_IDs(app core.App, ids []any) ([]*Series, error) {
|
|||||||
return TableByIDs[[]*Series](app, SERIES_TABLE, ids)
|
return TableByIDs[[]*Series](app, SERIES_TABLE, ids)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func Series_ID(app core.App, id string) (*Series, error) {
|
||||||
|
ret, err := TableByID[Series](app, SERIES_TABLE, id)
|
||||||
|
return &ret, err
|
||||||
|
}
|
||||||
|
|
||||||
func Places_IDs(app core.App, ids []any) ([]*Place, error) {
|
func Places_IDs(app core.App, ids []any) ([]*Place, error) {
|
||||||
return TableByIDs[[]*Place](app, PLACES_TABLE, ids)
|
return TableByIDs[[]*Place](app, PLACES_TABLE, ids)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package dbmodels
|
package dbmodels
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"slices"
|
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/Theodor-Springmann-Stiftung/musenalm/helpers/datatypes"
|
"github.com/Theodor-Springmann-Stiftung/musenalm/helpers/datatypes"
|
||||||
@@ -69,7 +68,7 @@ outer_loop:
|
|||||||
ids = append(ids, id.ID)
|
ids = append(ids, id.ID)
|
||||||
}
|
}
|
||||||
|
|
||||||
altseries, err := SeriessesForIds(app, ids)
|
altseries, err := Series_IDs(app, ids)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
@@ -99,246 +98,3 @@ func TitleSearchSeries(app core.App, query string) ([]*Series, error) {
|
|||||||
|
|
||||||
return series, nil
|
return series, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// INFO: expects a normalized query string
|
|
||||||
// Returns all ids that match the query
|
|
||||||
func FTS5SearchSeries(app core.App, query string) ([]*FTS5IDQueryResult, error) {
|
|
||||||
seriesids := []*FTS5IDQueryResult{}
|
|
||||||
q := NewFTS5Query().
|
|
||||||
From(SERIES_TABLE).
|
|
||||||
SelectID()
|
|
||||||
|
|
||||||
queries := strings.Split(query, " ")
|
|
||||||
for _, que := range queries {
|
|
||||||
que := datatypes.NormalizeString(que)
|
|
||||||
if len(que) >= 3 {
|
|
||||||
q.AndMatch([]string{SERIES_TITLE_FIELD, ANNOTATION_FIELD, REFERENCES_FIELD}, que)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
querystring := q.Query()
|
|
||||||
if querystring == "" {
|
|
||||||
return seriesids, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
err := app.DB().NewQuery(querystring).All(&seriesids)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return seriesids, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func IDsForSeriesses(series []*Series) []any {
|
|
||||||
ids := []any{}
|
|
||||||
for _, s := range series {
|
|
||||||
ids = append(ids, s.Id)
|
|
||||||
}
|
|
||||||
return ids
|
|
||||||
}
|
|
||||||
|
|
||||||
func makeMapForEnrySeries(relations []*REntriesSeries, entries map[string]*Entry) SeriesEntries {
|
|
||||||
m := map[string][]*REntriesSeries{}
|
|
||||||
for _, r := range relations {
|
|
||||||
m[r.Series()] = append(m[r.Series()], r)
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, rel := range m {
|
|
||||||
slices.SortFunc(rel, func(i, j *REntriesSeries) int {
|
|
||||||
ientry := entries[i.Entry()]
|
|
||||||
jentry := entries[j.Entry()]
|
|
||||||
return ientry.Year() - jentry.Year()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
return m
|
|
||||||
}
|
|
||||||
|
|
||||||
func EntriesForSeriesses(app core.App, series []*Series) (
|
|
||||||
SeriesEntries,
|
|
||||||
map[string]*Entry,
|
|
||||||
error) {
|
|
||||||
ids := IDsForSeriesses(series)
|
|
||||||
relations := []*core.Record{}
|
|
||||||
|
|
||||||
err := app.RecordQuery(RelationTableName(ENTRIES_TABLE, SERIES_TABLE)).
|
|
||||||
Where(dbx.HashExp{
|
|
||||||
SERIES_TABLE: ids,
|
|
||||||
}).
|
|
||||||
All(&relations)
|
|
||||||
if err != nil {
|
|
||||||
return nil, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
app.ExpandRecords(relations, []string{ENTRIES_TABLE}, nil)
|
|
||||||
bmap := map[string]*Entry{}
|
|
||||||
for _, r := range relations {
|
|
||||||
record := r.ExpandedOne(ENTRIES_TABLE)
|
|
||||||
if record == nil {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
entry := NewEntry(record)
|
|
||||||
bmap[entry.Id] = entry
|
|
||||||
}
|
|
||||||
|
|
||||||
smap := map[string][]*REntriesSeries{}
|
|
||||||
for _, r := range relations {
|
|
||||||
rel := NewREntriesSeries(r)
|
|
||||||
smap[rel.Series()] = append(smap[rel.Series()], rel)
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, rel := range smap {
|
|
||||||
slices.SortFunc(rel, func(i, j *REntriesSeries) int {
|
|
||||||
ientry := bmap[i.Entry()]
|
|
||||||
jentry := bmap[j.Entry()]
|
|
||||||
return ientry.Year() - jentry.Year()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
return smap, bmap, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func LettersForSeries(app core.App) ([]string, error) {
|
|
||||||
letters := []core.Record{}
|
|
||||||
ids := []string{}
|
|
||||||
|
|
||||||
err := app.RecordQuery(SERIES_TABLE).
|
|
||||||
Select("upper(substr(" + SERIES_TITLE_FIELD + ", 1, 1)) AS id").
|
|
||||||
Distinct(true).
|
|
||||||
All(&letters)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, l := range letters {
|
|
||||||
ids = append(ids, l.GetString("id"))
|
|
||||||
}
|
|
||||||
return ids, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func AllAgentsForSeries(app core.App) ([]*Agent, error) {
|
|
||||||
rels := []*core.Record{}
|
|
||||||
// INFO: we could just fetch all relations here
|
|
||||||
err := app.RecordQuery(RelationTableName(ENTRIES_TABLE, AGENTS_TABLE)).
|
|
||||||
GroupBy(AGENTS_TABLE).
|
|
||||||
All(&rels)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
app.ExpandRecords(rels, []string{AGENTS_TABLE}, nil)
|
|
||||||
agents := []*Agent{}
|
|
||||||
for _, r := range rels {
|
|
||||||
record := r.ExpandedOne(AGENTS_TABLE)
|
|
||||||
if record == nil {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
agent := NewAgent(record)
|
|
||||||
agents = append(agents, agent)
|
|
||||||
}
|
|
||||||
|
|
||||||
SortAgentsByName(agents)
|
|
||||||
|
|
||||||
return agents, err
|
|
||||||
}
|
|
||||||
|
|
||||||
func SeriesForLetter(app core.App, letter string) ([]*Series, error) {
|
|
||||||
series := []*Series{}
|
|
||||||
err := app.RecordQuery(SERIES_TABLE).
|
|
||||||
Where(dbx.Like(SERIES_TITLE_FIELD, letter).Match(false, true)).
|
|
||||||
OrderBy(SERIES_TITLE_FIELD).
|
|
||||||
All(&series)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return series, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func SeriesForAgent(app core.App, id string) ([]*Series, SeriesEntries, map[string]*Entry, error) {
|
|
||||||
entries, _, err := EntriesForAgent(app, id)
|
|
||||||
if err != nil {
|
|
||||||
return nil, nil, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return SeriesForEntries(app, entries)
|
|
||||||
}
|
|
||||||
|
|
||||||
func SeriesForPlace(app core.App, id string) ([]*Series, SeriesEntries, map[string]*Entry, error) {
|
|
||||||
entries, err := EntriesForPlace(app, id)
|
|
||||||
if err != nil {
|
|
||||||
return nil, nil, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return SeriesForEntries(app, entries)
|
|
||||||
}
|
|
||||||
|
|
||||||
func SeriesForEntries(app core.App, entries []*Entry) ([]*Series, SeriesEntries, map[string]*Entry, error) {
|
|
||||||
bids := make([]any, 0, len(entries))
|
|
||||||
for _, e := range entries {
|
|
||||||
bids = append(bids, e.Id)
|
|
||||||
}
|
|
||||||
|
|
||||||
srels := []*REntriesSeries{}
|
|
||||||
err := app.RecordQuery(RelationTableName(ENTRIES_TABLE, SERIES_TABLE)).
|
|
||||||
Where(dbx.HashExp{ENTRIES_TABLE: bids}).
|
|
||||||
All(&srels)
|
|
||||||
if err != nil {
|
|
||||||
return nil, nil, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
sids := []any{}
|
|
||||||
for _, s := range srels {
|
|
||||||
sids = append(sids, s.Series())
|
|
||||||
}
|
|
||||||
|
|
||||||
series := []*Series{}
|
|
||||||
err = app.RecordQuery(SERIES_TABLE).
|
|
||||||
Where(dbx.HashExp{ID_FIELD: sids}).
|
|
||||||
All(&series)
|
|
||||||
if err != nil {
|
|
||||||
return nil, nil, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
bmap := make(map[string]*Entry, len(entries))
|
|
||||||
for _, e := range entries {
|
|
||||||
bmap[e.Id] = e
|
|
||||||
}
|
|
||||||
|
|
||||||
smap := makeMapForEnrySeries(srels, bmap)
|
|
||||||
|
|
||||||
return series, smap, bmap, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func SeriesForYear(app core.App, year int) ([]*Series, SeriesEntries, map[string]*Entry, error) {
|
|
||||||
series, err := EntriesForYear(app, year)
|
|
||||||
if err != nil {
|
|
||||||
return nil, nil, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return SeriesForEntries(app, series)
|
|
||||||
}
|
|
||||||
|
|
||||||
func SeriesForId(app core.App, id string) (*Series, error) {
|
|
||||||
s := &Series{}
|
|
||||||
err := app.RecordQuery(SERIES_TABLE).
|
|
||||||
Where(dbx.HashExp{MUSENALMID_FIELD: id}).
|
|
||||||
One(s)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return s, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func SeriessesForIds(app core.App, ids []any) ([]*Series, error) {
|
|
||||||
series := []*Series{}
|
|
||||||
err := app.RecordQuery(SERIES_TABLE).
|
|
||||||
Where(dbx.HashExp{ID_FIELD: ids}).
|
|
||||||
All(&series)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return series, nil
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -35,17 +35,27 @@ func (p *ReihePage) Setup(router *router.Router[*core.RequestEvent], app core.Ap
|
|||||||
router.GET(URL_REIHE, func(e *core.RequestEvent) error {
|
router.GET(URL_REIHE, func(e *core.RequestEvent) error {
|
||||||
id := e.Request.PathValue("id")
|
id := e.Request.PathValue("id")
|
||||||
data := make(map[string]interface{})
|
data := make(map[string]interface{})
|
||||||
reihe, err := dbmodels.SeriesForId(app, id)
|
reihe, err := dbmodels.Series_ID(app, id)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return engine.Response404(e, err, data)
|
return engine.Response404(e, err, data)
|
||||||
}
|
}
|
||||||
data["series"] = reihe
|
data["series"] = reihe
|
||||||
|
|
||||||
rmap, emap, err := dbmodels.EntriesForSeriesses(app, []*dbmodels.Series{reihe})
|
entries, relations, err := Entries_Series_IDs(app, []any{id})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return engine.Response404(e, err, data)
|
return engine.Response404(e, err, data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
emap := make(map[string]*dbmodels.Entry)
|
||||||
|
for _, entry := range entries {
|
||||||
|
emap[entry.Id] = entry
|
||||||
|
}
|
||||||
|
|
||||||
|
rmap := make(map[string][]*dbmodels.REntriesSeries)
|
||||||
|
for _, relation := range relations {
|
||||||
|
rmap[relation.Series()] = append(rmap[relation.Series()], relation)
|
||||||
|
}
|
||||||
|
|
||||||
data["relations"] = rmap[reihe.Id]
|
data["relations"] = rmap[reihe.Id]
|
||||||
data["entries"] = emap
|
data["entries"] = emap
|
||||||
|
|
||||||
|
|||||||
133
pages/reihen.go
133
pages/reihen.go
@@ -2,6 +2,7 @@ package pages
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/Theodor-Springmann-Stiftung/musenalm/app"
|
"github.com/Theodor-Springmann-Stiftung/musenalm/app"
|
||||||
"github.com/Theodor-Springmann-Stiftung/musenalm/dbmodels"
|
"github.com/Theodor-Springmann-Stiftung/musenalm/dbmodels"
|
||||||
@@ -150,6 +151,10 @@ func (p *ReihenPage) SearchRequest(app core.App, engine *templating.Engine, e *c
|
|||||||
|
|
||||||
func (p *ReihenPage) Get(request *core.RequestEvent, engine *templating.Engine, data map[string]interface{}) error {
|
func (p *ReihenPage) Get(request *core.RequestEvent, engine *templating.Engine, data map[string]interface{}) error {
|
||||||
data["common"] = NewCommonReihenData(request.App)
|
data["common"] = NewCommonReihenData(request.App)
|
||||||
|
record, _ := p.GetLatestData(request.App)
|
||||||
|
if record != nil {
|
||||||
|
data["record"] = pagemodels.NewReihen(record)
|
||||||
|
}
|
||||||
return engine.Response200(request, URL_REIHEN, data)
|
return engine.Response200(request, URL_REIHEN, data)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -278,15 +283,10 @@ func NewSeriesListResult_Letter(app core.App, letter string) (*SeriesListResult,
|
|||||||
entriesMap[e.Id] = e
|
entriesMap[e.Id] = e
|
||||||
}
|
}
|
||||||
|
|
||||||
rmap, bmap, err := dbmodels.EntriesForSeriesses(app, series)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return &SeriesListResult{
|
return &SeriesListResult{
|
||||||
Series: series,
|
Series: series,
|
||||||
Entries: bmap,
|
Entries: entriesMap,
|
||||||
EntriesSeries: rmap,
|
EntriesSeries: relationsMap,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -445,56 +445,121 @@ func NewSeriesResult_Search(app core.App, search string) (*SeriesListResult, err
|
|||||||
dbmodels.Sort_Series_Title(series)
|
dbmodels.Sort_Series_Title(series)
|
||||||
dbmodels.Sort_Series_Title(altseries)
|
dbmodels.Sort_Series_Title(altseries)
|
||||||
|
|
||||||
rmap, bmap, err := dbmodels.EntriesForSeriesses(app, series)
|
keys := []any{}
|
||||||
|
keys = append(keys, dbmodels.Ids(series)...)
|
||||||
|
keys = append(keys, dbmodels.Ids(altseries)...)
|
||||||
|
|
||||||
|
entries, relations, err := Entries_Series_IDs(app, keys)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
rmap2, bmap2, err := dbmodels.EntriesForSeriesses(app, altseries)
|
relationsMap := make(map[string][]*dbmodels.REntriesSeries)
|
||||||
if err != nil {
|
entriesMap := make(map[string]*dbmodels.Entry)
|
||||||
return nil, err
|
for _, v := range relations {
|
||||||
|
relationsMap[v.Series()] = append(relationsMap[v.Series()], v)
|
||||||
}
|
}
|
||||||
|
|
||||||
for k, v := range rmap2 {
|
for _, v := range entries {
|
||||||
rmap[k] = v
|
entriesMap[v.Id] = v
|
||||||
}
|
|
||||||
for k, v := range bmap2 {
|
|
||||||
bmap[k] = v
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ids := []*dbmodels.Series{}
|
ret := &SeriesListResult{
|
||||||
if searchint, err := strconv.Atoi(search); err == nil {
|
Series: series,
|
||||||
identries, err := dbmodels.EntriesForID(app, searchint)
|
AltSeries: altseries,
|
||||||
|
Entries: entriesMap,
|
||||||
|
EntriesSeries: relationsMap,
|
||||||
|
}
|
||||||
|
|
||||||
|
if _, err := strconv.Atoi(strings.TrimSpace(search)); err == nil {
|
||||||
|
identries := []*dbmodels.Entry{}
|
||||||
|
err := app.RecordQuery(dbmodels.ENTRIES_TABLE).
|
||||||
|
Where(dbx.HashExp{dbmodels.MUSENALMID_FIELD: search}).
|
||||||
|
All(&identries)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(identries) != 0 {
|
if len(identries) != 0 {
|
||||||
|
app.Logger().Info("Found entries by musenalmid", "count", len(identries))
|
||||||
idseries, rmap3, bmap3, err := dbmodels.SeriesForEntries(app, identries)
|
idseries, idrelations, err := Series_Entries(app, identries)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
ids = idseries
|
|
||||||
|
|
||||||
dbmodels.Sort_Series_Title(idseries)
|
dbmodels.Sort_Series_Title(idseries)
|
||||||
|
ret.IDSeries = idseries
|
||||||
|
|
||||||
for k, v := range rmap3 {
|
for _, v := range idrelations {
|
||||||
rmap[k] = v
|
ret.EntriesSeries[v.Series()] = append(relationsMap[v.Series()], v)
|
||||||
}
|
}
|
||||||
|
|
||||||
for k, v := range bmap3 {
|
for _, v := range identries {
|
||||||
bmap[k] = v
|
ret.Entries[v.Id] = v
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return &SeriesListResult{
|
return ret, nil
|
||||||
Series: series,
|
}
|
||||||
Entries: bmap,
|
|
||||||
EntriesSeries: rmap,
|
func (r *SeriesListResult) Count() int {
|
||||||
IDSeries: ids,
|
return len(r.Series) + len(r.AltSeries) + len(r.IDSeries)
|
||||||
AltSeries: altseries,
|
}
|
||||||
}, nil
|
|
||||||
|
func Entries_Series(app core.App, series []*dbmodels.Series) ([]*dbmodels.Entry, []*dbmodels.REntriesSeries, error) {
|
||||||
|
relations, err := dbmodels.REntriesSeries_Seriess(app, dbmodels.Ids(series))
|
||||||
|
if err != nil {
|
||||||
|
return nil, nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
eids := []any{}
|
||||||
|
for _, r := range relations {
|
||||||
|
eids = append(eids, r.Entry())
|
||||||
|
}
|
||||||
|
|
||||||
|
entries, err := dbmodels.Entries_IDs(app, eids)
|
||||||
|
if err != nil {
|
||||||
|
return nil, nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return entries, relations, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func Entries_Series_IDs(app core.App, ids []any) ([]*dbmodels.Entry, []*dbmodels.REntriesSeries, error) {
|
||||||
|
relations, err := dbmodels.REntriesSeries_Seriess(app, ids)
|
||||||
|
if err != nil {
|
||||||
|
return nil, nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
eids := []any{}
|
||||||
|
for _, r := range relations {
|
||||||
|
eids = append(eids, r.Entry())
|
||||||
|
}
|
||||||
|
|
||||||
|
entries, err := dbmodels.Entries_IDs(app, eids)
|
||||||
|
if err != nil {
|
||||||
|
return nil, nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return entries, relations, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func Series_Entries(app core.App, entries []*dbmodels.Entry) ([]*dbmodels.Series, []*dbmodels.REntriesSeries, error) {
|
||||||
|
relations, err := dbmodels.REntriesSeries_Entries(app, dbmodels.Ids(entries))
|
||||||
|
if err != nil {
|
||||||
|
return nil, nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
sids := []any{}
|
||||||
|
for _, r := range relations {
|
||||||
|
sids = append(sids, r.Series())
|
||||||
|
}
|
||||||
|
|
||||||
|
series, err := dbmodels.Series_IDs(app, sids)
|
||||||
|
if err != nil {
|
||||||
|
return nil, nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return series, relations, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ const (
|
|||||||
TEMPLATE_SUCHE = "/suche/"
|
TEMPLATE_SUCHE = "/suche/"
|
||||||
)
|
)
|
||||||
|
|
||||||
var availableTypes = []string{"reihen", "baende", "beitraege", "personen"}
|
var availableTypes = []string{"baende", "beitraege"}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
rp := &SuchePage{
|
rp := &SuchePage{
|
||||||
@@ -72,7 +72,7 @@ func (p *SuchePage) SimpleSearchBaendeRequest(app core.App, engine *templating.E
|
|||||||
return engine.Response404(e, err, nil)
|
return engine.Response404(e, err, nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
query := dbmodels.NormalizeQuery(params.Query)
|
query := params.NormalizeQuery()
|
||||||
if len(query) == 0 {
|
if len(query) == 0 {
|
||||||
engine.Response404(e, nil, nil)
|
engine.Response404(e, nil, nil)
|
||||||
}
|
}
|
||||||
@@ -165,6 +165,10 @@ func NewParameters(e *core.RequestEvent) (*Parameters, error) {
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (p *Parameters) NormalizeQuery() []string {
|
||||||
|
return dbmodels.NormalizeQuery(p.Query)
|
||||||
|
}
|
||||||
|
|
||||||
type SimpleParameters struct {
|
type SimpleParameters struct {
|
||||||
Parameters
|
Parameters
|
||||||
Annotations bool
|
Annotations bool
|
||||||
@@ -195,15 +199,18 @@ func NewSimpleParameters(e *core.RequestEvent, p Parameters) (*SimpleParameters,
|
|||||||
// TODO: sanity check here if any single field is selected
|
// TODO: sanity check here if any single field is selected
|
||||||
|
|
||||||
return &SimpleParameters{
|
return &SimpleParameters{
|
||||||
Parameters: p,
|
Parameters: p,
|
||||||
|
// INFO: Common parameters
|
||||||
Alm: alm,
|
Alm: alm,
|
||||||
Title: title,
|
Title: title,
|
||||||
Series: series,
|
|
||||||
Persons: persons,
|
Persons: persons,
|
||||||
Places: places,
|
|
||||||
Refs: refs,
|
|
||||||
Annotations: annotations,
|
Annotations: annotations,
|
||||||
Year: year,
|
|
||||||
|
// INFO: Baende parameters
|
||||||
|
Places: places,
|
||||||
|
Refs: refs,
|
||||||
|
Year: year,
|
||||||
|
Series: series,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -37,27 +37,25 @@ Modelle umwandeln (zzt RecordProxy)
|
|||||||
|
|
||||||
- In der Almanach-Ansicht werden die Abkürzungen erklärt
|
- In der Almanach-Ansicht werden die Abkürzungen erklärt
|
||||||
- In der Almanach- und Suchansicht werden Sammlungen abgehoben
|
- In der Almanach- und Suchansicht werden Sammlungen abgehoben
|
||||||
- In der Almanach- und Suchansicht werden auch mehrere Bilder zu einem Eintrag angezeigt
|
- In der Almanach- und Suchansicht werden auch mehrere Bilder zu einem Eintrag angezeigt, falls vorhanden
|
||||||
- In der Almanach- und Suchansicht kann nach Inhalten frei gefiltert werden, oder nach Typ
|
- In der Almanach- und Suchansicht kann nach Inhalten frei gefiltert werden, oder nach Typ
|
||||||
|
|
||||||
- Es gibt neue URLs, die fest verlinkt werden können für einzelne:
|
- Es gibt URLs, die fest verlinkt werden können für einzelne:
|
||||||
- Personen
|
- Personen
|
||||||
- Reihen
|
- Reihen
|
||||||
- Bände
|
- Bände
|
||||||
- Beiträge
|
- Beiträge
|
||||||
|
- Alle Suchanfragen
|
||||||
|
|
||||||
- Die Suche ist klar nach Typ unterteilt und insgesamt zuverlässiger
|
- Die Suche ist klar nach Typ unterteilt und insgesamt zuverlässiger
|
||||||
- Zusätzlich zur jetzigen Suchfunktion gibt es für jeden Typ noch eine Detailsuche
|
- Zusätzlich zur jetzigen Suchfunktion gibt es für Beiträge und Bände noch eine Detailsuche
|
||||||
- Suchergebnisse können nach Typ, Person, Jahr gefiltert werden
|
- Suchergebnisse können nach Typ, Person, Jahr gefiltert werden
|
||||||
- Suchergebnisse könnnen nach Jahr und Band, nach Band und Jahr (nach Personen) sortiert werden
|
- Suchergebnisse könnnen nach Jahr und Band, nach Band und Jahr (nach Personen) sortiert werden
|
||||||
- Jede Suche hat eine eindeutige URL
|
|
||||||
|
|
||||||
|
|
||||||
TODO danach:
|
TODO danach:
|
||||||
- Google-Suchoptimierung
|
- Google-Suchoptimierung
|
||||||
- Error Pages prüfen & error-Verhalten von HTMX
|
- Error Pages prüfen & error-Verhalten von HTMX
|
||||||
- Stimmigere Page-Abstraktion
|
|
||||||
- Weißraum in den Antworten
|
- Weißraum in den Antworten
|
||||||
- Antworten komprimieren
|
- Antworten komprimieren
|
||||||
- Cache?
|
- Cache?
|
||||||
- Footer
|
|
||||||
|
|||||||
@@ -44,156 +44,164 @@
|
|||||||
{{- end -}}
|
{{- end -}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="container-normal mt-12" id="">
|
<div class="container-oversize mt-12">
|
||||||
<div class="flex flex-col" id="entrydata">
|
<div class="pb-1.5 ml-32"><i class="ri-book-line"></i> Almanach</div>
|
||||||
<div class="entryrow">
|
<div class=" border relative pt-0">
|
||||||
<div class="fieldlabel">Almanach-Nummer</div>
|
<div class="ml-32 relative pt-2 bg-stone-50 mt-0 w-max flex flex-col">
|
||||||
<div class="fieldvalue">{{ $model.result.Entry.MusenalmID }}</div>
|
|
||||||
</div>
|
</div>
|
||||||
{{- if $model.result.Entry.PreferredTitle -}}
|
<div class="container-normal !py-8" id="">
|
||||||
<div class="entryrow">
|
<div class="flex flex-col" id="entrydata">
|
||||||
<div class="fieldlabel">Kurztitel</div>
|
<div class="entryrow">
|
||||||
<div class="fieldvalue">{{ $model.result.Entry.PreferredTitle }}</div>
|
<div class="fieldlabel">Almanach-Nummer</div>
|
||||||
</div>
|
<div class="fieldvalue">{{ $model.result.Entry.MusenalmID }}</div>
|
||||||
{{- end -}}
|
</div>
|
||||||
{{- if $model.result.Entry.TitleStmt -}}
|
{{- if $model.result.Entry.PreferredTitle -}}
|
||||||
<div class="entryrow">
|
<div class="entryrow">
|
||||||
<div class="fieldlabel">Titel</div>
|
<div class="fieldlabel">Kurztitel</div>
|
||||||
<div class="fieldvalue">{{ $model.result.Entry.TitleStmt }}</div>
|
<div class="fieldvalue">{{ $model.result.Entry.PreferredTitle }}</div>
|
||||||
</div>
|
</div>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
<div class="entryrow">
|
{{- if $model.result.Entry.TitleStmt -}}
|
||||||
<div class="fieldlabel">Jahr</div>
|
<div class="entryrow">
|
||||||
<div class="fieldvalue">
|
<div class="fieldlabel">Titel</div>
|
||||||
{{- if $model.result.Entry.Year -}}
|
<div class="fieldvalue">{{ $model.result.Entry.TitleStmt }}</div>
|
||||||
<a href="/reihen?year={{ $model.result.Entry.Year }}&hidden=true"
|
</div>
|
||||||
>{{ $model.result.Entry.Year }}</a
|
{{- end -}}
|
||||||
>
|
<div class="entryrow">
|
||||||
{{- else -}}
|
<div class="fieldlabel">Jahr</div>
|
||||||
[keine Angabe]
|
<div class="fieldvalue">
|
||||||
|
{{- if $model.result.Entry.Year -}}
|
||||||
|
<a href="/reihen?year={{ $model.result.Entry.Year }}&hidden=true"
|
||||||
|
>{{ $model.result.Entry.Year }}</a
|
||||||
|
>
|
||||||
|
{{- else -}}
|
||||||
|
[keine Angabe]
|
||||||
|
{{- end -}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{- if $model.result.Entry.ResponsibilityStmt -}}
|
||||||
|
<div class="entryrow">
|
||||||
|
<div class="fieldlabel">Herausgeberangabe</div>
|
||||||
|
<div class="fieldvalue">{{ $model.result.Entry.ResponsibilityStmt }}</div>
|
||||||
|
</div>
|
||||||
|
{{- end -}}
|
||||||
|
{{- if $model.result.Entry.Extent -}}
|
||||||
|
<div class="entryrow">
|
||||||
|
<div class="fieldlabel">Umfang</div>
|
||||||
|
<div class="fieldvalue">
|
||||||
|
<abbrev-tooltips data-text="{{ $model.result.Entry.Extent }}"></abbrev-tooltips>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{- end -}}
|
||||||
|
{{- if $model.result.Entry.Language -}}
|
||||||
|
<div class="entryrow">
|
||||||
|
<div class="fieldlabel">Sprache</div>
|
||||||
|
<div class="fieldvalue">
|
||||||
|
{{- range $i, $lang := $model.result.Entry.Language -}}
|
||||||
|
{{- if $i -}},{{- end -}}
|
||||||
|
{{- if eq $lang "ger" -}}
|
||||||
|
{{ $isGer = true }}
|
||||||
|
Deutsch
|
||||||
|
{{- else if eq $lang "eng" -}}
|
||||||
|
{{ $isEng = true }}
|
||||||
|
Englisch
|
||||||
|
{{- else if eq $lang "fre" -}}
|
||||||
|
{{ $isFra = true }}
|
||||||
|
Französisch
|
||||||
|
{{- else if eq $lang "ita" -}}
|
||||||
|
Italienisch
|
||||||
|
{{- else if eq $lang "lat" -}}
|
||||||
|
Latein
|
||||||
|
{{- else -}}
|
||||||
|
{{ $lang }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{- end -}}
|
||||||
|
{{- if $model.result.Entry.References -}}
|
||||||
|
<div class="entryrow">
|
||||||
|
<div class="fieldlabel">Nachweise</div>
|
||||||
|
<div class="fieldvalue">
|
||||||
|
{{- $model.result.Entry.References -}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{- end -}}
|
||||||
|
{{- if $model.result.Series -}}
|
||||||
|
<div class="entryrow">
|
||||||
|
<div class="fieldlabel">Reihen</div>
|
||||||
|
<div class="fieldvalue">
|
||||||
|
{{- range $i, $s := $model.result.Series -}}
|
||||||
|
<div>
|
||||||
|
{{- $rel := index $model.result.EntriesSeries $s.Id -}}
|
||||||
|
{{- if $rel -}}
|
||||||
|
{{- if not (eq $rel.Type "Bevorzugter Reihentitel") -}}
|
||||||
|
<span class="text-sm font-sans mr-2">
|
||||||
|
{{- if eq $rel.Type "Früherer Reihentitel" -}}
|
||||||
|
hat Titelauflage s.a.
|
||||||
|
{{- else if eq $rel.Type "Späterer Reihentitel" -}}
|
||||||
|
ist Titelauflage von, s.a.
|
||||||
|
{{- else if eq $rel.Type "In anderer Sprache" -}}
|
||||||
|
{{- if $isFra -}}
|
||||||
|
In deutscher Sprache s.a.
|
||||||
|
{{- else -}}
|
||||||
|
In französischer Sprache s.a.
|
||||||
|
{{- end -}}
|
||||||
|
{{- else if eq $rel.Type "Alternatives Titelblatt" -}}
|
||||||
|
alternatives Titelblatt, s.a.
|
||||||
|
{{- end -}}
|
||||||
|
</span>
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
<a href="/reihe/{{ $s.MusenalmID }}">{{ $s.Title }}</a>
|
||||||
|
</div>
|
||||||
|
{{- end -}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{- end -}}
|
||||||
|
{{- if $model.result.Places -}}
|
||||||
|
<div class="entryrow">
|
||||||
|
<div class="fieldlabel">Orte</div>
|
||||||
|
<div class="fieldvalue">
|
||||||
|
{{- range $i, $p := $model.result.Places -}}
|
||||||
|
<div>
|
||||||
|
<a href="/reihen?place={{ $p.Id }}&hidden=true">{{ $p.Name }}</a>
|
||||||
|
</div>
|
||||||
|
{{- end -}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{- end -}}
|
||||||
|
{{- if $model.result.EntriesAgents -}}
|
||||||
|
<div class="entryrow">
|
||||||
|
<div class="fieldlabel">Personen</div>
|
||||||
|
<div class="fieldvalue">
|
||||||
|
{{- range $i, $r := $model.result.EntriesAgents -}}
|
||||||
|
{{- $a := index $model.result.Agents $r.Agent -}}
|
||||||
|
{{- if $a -}}
|
||||||
|
<div>
|
||||||
|
<a href="/person/{{ $a.Id }}">
|
||||||
|
{{ $a.Name }}
|
||||||
|
</a>
|
||||||
|
<span
|
||||||
|
class="ml-2 px-2 py-0.5 rounded text-sm font-sans bg-slate-200 inline-block">
|
||||||
|
{{- $r.Type -}}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{- end -}}
|
||||||
|
{{- if $model.result.Entry.Annotation -}}
|
||||||
|
<div class="entryrow">
|
||||||
|
<div class="fieldlabel">Anmerkungen</div>
|
||||||
|
<div class="fieldvalue">
|
||||||
|
{{- Safe (ReplaceSlashParen $model.result.Entry.Annotation) -}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{- if $model.result.Entry.ResponsibilityStmt -}}
|
|
||||||
<div class="entryrow">
|
|
||||||
<div class="fieldlabel">Herausgeber</div>
|
|
||||||
<div class="fieldvalue">{{ $model.result.Entry.ResponsibilityStmt }}</div>
|
|
||||||
</div>
|
|
||||||
{{- end -}}
|
|
||||||
{{- if $model.result.Entry.Extent -}}
|
|
||||||
<div class="entryrow">
|
|
||||||
<div class="fieldlabel">Umfang</div>
|
|
||||||
<div class="fieldvalue">
|
|
||||||
<abbrev-tooltips data-text="{{ $model.result.Entry.Extent }}"></abbrev-tooltips>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{{- end -}}
|
|
||||||
{{- if $model.result.Entry.Language -}}
|
|
||||||
<div class="entryrow">
|
|
||||||
<div class="fieldlabel">Sprache</div>
|
|
||||||
<div class="fieldvalue">
|
|
||||||
{{- range $i, $lang := $model.result.Entry.Language -}}
|
|
||||||
{{- if $i -}},{{- end -}}
|
|
||||||
{{- if eq $lang "ger" -}}
|
|
||||||
{{ $isGer = true }}
|
|
||||||
Deutsch
|
|
||||||
{{- else if eq $lang "eng" -}}
|
|
||||||
{{ $isEng = true }}
|
|
||||||
Englisch
|
|
||||||
{{- else if eq $lang "fre" -}}
|
|
||||||
{{ $isFra = true }}
|
|
||||||
Französisch
|
|
||||||
{{- else if eq $lang "ita" -}}
|
|
||||||
Italienisch
|
|
||||||
{{- else if eq $lang "lat" -}}
|
|
||||||
Latein
|
|
||||||
{{- else -}}
|
|
||||||
{{ $lang }}
|
|
||||||
{{- end -}}
|
|
||||||
{{- end -}}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{{- end -}}
|
|
||||||
{{- if $model.result.Entry.References -}}
|
|
||||||
<div class="entryrow">
|
|
||||||
<div class="fieldlabel">Nachweise</div>
|
|
||||||
<div class="fieldvalue">
|
|
||||||
{{- $model.result.Entry.References -}}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{{- end -}}
|
|
||||||
{{- if $model.result.Series -}}
|
|
||||||
<div class="entryrow">
|
|
||||||
<div class="fieldlabel">Reihen</div>
|
|
||||||
<div class="fieldvalue">
|
|
||||||
{{- range $i, $s := $model.result.Series -}}
|
|
||||||
<div>
|
|
||||||
{{- $rel := index $model.result.EntriesSeries $s.Id -}}
|
|
||||||
{{- if $rel -}}
|
|
||||||
{{- if not (eq $rel.Type "Bevorzugter Reihentitel") -}}
|
|
||||||
<span class="text-sm font-sans mr-2">
|
|
||||||
{{- if eq $rel.Type "Früherer Reihentitel" -}}
|
|
||||||
hat Titelauflage s.a.
|
|
||||||
{{- else if eq $rel.Type "Späterer Reihentitel" -}}
|
|
||||||
ist Titelauflage von, s.a.
|
|
||||||
{{- else if eq $rel.Type "In anderer Sprache" -}}
|
|
||||||
{{- if $isFra -}}
|
|
||||||
In deutscher Sprache s.a.
|
|
||||||
{{- else -}}
|
|
||||||
In französischer Sprache s.a.
|
|
||||||
{{- end -}}
|
|
||||||
{{- else if eq $rel.Type "Alternatives Titelblatt" -}}
|
|
||||||
alternatives Titelblatt, s.a.
|
|
||||||
{{- end -}}
|
|
||||||
</span>
|
|
||||||
{{- end -}}
|
|
||||||
{{- end -}}
|
|
||||||
<a href="/reihe/{{ $s.MusenalmID }}">{{ $s.Title }}</a>
|
|
||||||
</div>
|
|
||||||
{{- end -}}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{{- end -}}
|
|
||||||
{{- if $model.result.Places -}}
|
|
||||||
<div class="entryrow">
|
|
||||||
<div class="fieldlabel">Orte</div>
|
|
||||||
<div class="fieldvalue">
|
|
||||||
{{- range $i, $p := $model.result.Places -}}
|
|
||||||
<div>
|
|
||||||
<a href="/reihen?place={{ $p.Id }}&hidden=true">{{ $p.Name }}</a>
|
|
||||||
</div>
|
|
||||||
{{- end -}}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{{- end -}}
|
|
||||||
{{- if $model.result.EntriesAgents -}}
|
|
||||||
<div class="entryrow">
|
|
||||||
<div class="fieldlabel">Personen</div>
|
|
||||||
<div class="fieldvalue">
|
|
||||||
{{- range $i, $r := $model.result.EntriesAgents -}}
|
|
||||||
{{- $a := index $model.result.Agents $r.Agent -}}
|
|
||||||
{{- if $a -}}
|
|
||||||
<div>
|
|
||||||
<a href="/person/{{ $a.Id }}">
|
|
||||||
{{ $a.Name }}
|
|
||||||
</a>
|
|
||||||
<span class="ml-2 px-2 py-0.5 rounded text-sm font-sans bg-slate-200 inline-block">
|
|
||||||
{{- $r.Type -}}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
{{- end -}}
|
|
||||||
{{- end -}}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{{- end -}}
|
|
||||||
{{- if $model.result.Entry.Annotation -}}
|
|
||||||
<div class="entryrow">
|
|
||||||
<div class="fieldlabel">Anmerkungen</div>
|
|
||||||
<div class="fieldvalue">
|
|
||||||
{{- Safe (ReplaceSlashParen $model.result.Entry.Annotation) -}}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{{- end -}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -207,3 +215,4 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
</div>
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<div class="container-normal flex flex-col font-serif mt-12">
|
<div class="container-normal flex flex-col font-serif mt-12">
|
||||||
<div class="font-sans">
|
<div class="font-sans">
|
||||||
<svg
|
{{/* <svg
|
||||||
class="w-[0.9rem] h-[0.9rem] relative bottom-[0.04rem] inline-block"
|
class="w-[0.9rem] h-[0.9rem] relative bottom-[0.04rem] inline-block"
|
||||||
width="65px"
|
width="65px"
|
||||||
height="65px"
|
height="65px"
|
||||||
@@ -30,15 +30,17 @@
|
|||||||
<g id="SVGRepo_bgCarrier" stroke-width="0"></g>
|
<g id="SVGRepo_bgCarrier" stroke-width="0"></g>
|
||||||
<g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g>
|
<g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g>
|
||||||
<g id="SVGRepo_iconCarrier">
|
<g id="SVGRepo_iconCarrier">
|
||||||
<g id="🔍-Product-Icons" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
<g id="🔍-Product-Icons" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||||
<g id="ic_fluent_library_28_filled" fill="currentColor" fill-rule="nonzero">
|
<g id="ic_fluent_library_28_filled" fill="currentColor" fill-rule="nonzero">
|
||||||
<path
|
<path
|
||||||
d="M5.9897,3 C7.0937,3 7.9897,3.896 7.9897,5 L7.9897,23 C7.9897,24.104 7.0937,25 5.9897,25 L4.0007,25 C2.8957,25 2.0007,24.104 2.0007,23 L2.0007,5 C2.0007,3.896 2.8957,3 4.0007,3 L5.9897,3 Z M12.9897,3 C14.0937,3 14.9897,3.896 14.9897,5 L14.9897,23 C14.9897,24.104 14.0937,25 12.9897,25 L10.9947,25 C9.8897,25 8.9947,24.104 8.9947,23 L8.9947,5 C8.9947,3.896 9.8897,3 10.9947,3 L12.9897,3 Z M22.0701,6.5432 L25.9301,22.0262 C26.1971,23.0972 25.5441,24.1832 24.4731,24.4512 L22.5101,24.9402 C21.4391,25.2072 20.3531,24.5552 20.0861,23.4832 L16.2261,8.0002 C15.9581,6.9282 16.6111,5.8432 17.6821,5.5752 L19.6451,5.0862 C20.7161,4.8182 21.8021,5.4712 22.0701,6.5432 Z"
|
d="M5.9897,3 C7.0937,3 7.9897,3.896 7.9897,5 L7.9897,23 C7.9897,24.104 7.0937,25 5.9897,25 L4.0007,25 C2.8957,25 2.0007,24.104 2.0007,23 L2.0007,5 C2.0007,3.896 2.8957,3 4.0007,3 L5.9897,3 Z M12.9897,3 C14.0937,3 14.9897,3.896 14.9897,5 L14.9897,23 C14.9897,24.104 14.0937,25 12.9897,25 L10.9947,25 C9.8897,25 8.9947,24.104 8.9947,23 L8.9947,5 C8.9947,3.896 9.8897,3 10.9947,3 L12.9897,3 Z M22.0701,6.5432 L25.9301,22.0262 C26.1971,23.0972 25.5441,24.1832 24.4731,24.4512 L22.5101,24.9402 C21.4391,25.2072 20.3531,24.5552 20.0861,23.4832 L16.2261,8.0002 C15.9581,6.9282 16.6111,5.8432 17.6821,5.5752 L19.6451,5.0862 C20.7161,4.8182 21.8021,5.4712 22.0701,6.5432 Z"
|
||||||
id="🎨-Color"></path>
|
id="🎨-Color"></path>
|
||||||
</g>
|
|
||||||
</g>
|
|
||||||
</g>
|
</g>
|
||||||
</svg>
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
*/}}
|
||||||
|
<i class="ri-book-shelf-fill"></i>
|
||||||
Reihe
|
Reihe
|
||||||
</div>
|
</div>
|
||||||
<div class="grow-0">
|
<div class="grow-0">
|
||||||
|
|||||||
@@ -23,7 +23,18 @@
|
|||||||
// Only on place request
|
// Only on place request
|
||||||
Place *dbmodels.Place
|
Place *dbmodels.Place
|
||||||
}
|
}
|
||||||
*/}}
|
|
||||||
|
// Parameters:
|
||||||
|
.letter
|
||||||
|
.search
|
||||||
|
.hidden
|
||||||
|
|
||||||
|
.record
|
||||||
|
.record.Image(Path)
|
||||||
|
.record.Text
|
||||||
|
|
||||||
|
.startpage
|
||||||
|
*/}}
|
||||||
|
|
||||||
{{ $model := . }}
|
{{ $model := . }}
|
||||||
{{ if and .startpage .record }}
|
{{ if and .startpage .record }}
|
||||||
@@ -86,7 +97,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ if .series }}
|
{{ if $model.result.Series }}
|
||||||
<div class="border-b text-sm font-sans text-right pb-0.5">
|
<div class="border-b text-sm font-sans text-right pb-0.5">
|
||||||
Treffer in Reihentiteln ↑
|
Treffer in Reihentiteln ↑
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -37,6 +37,7 @@
|
|||||||
hx-trigger="input changed delay=1500ms, keyup[key=='Enter']"
|
hx-trigger="input changed delay=1500ms, keyup[key=='Enter']"
|
||||||
hx-select="#searchcontent"
|
hx-select="#searchcontent"
|
||||||
hx-target="#searchcontent"
|
hx-target="#searchcontent"
|
||||||
|
hx-swap="outerHTML"
|
||||||
autocomplete="off"
|
autocomplete="off"
|
||||||
{{ if $model.search }}disabled="true"{{ end }} />
|
{{ if $model.search }}disabled="true"{{ end }} />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -4,10 +4,26 @@
|
|||||||
x-data="{ open: true }"
|
x-data="{ open: true }"
|
||||||
x-show="open">
|
x-show="open">
|
||||||
<div class="container-extraoversize flex flex-row gap-x-8">
|
<div class="container-extraoversize flex flex-row gap-x-8">
|
||||||
<div class="max-w-[52rem] font-serif text-lg hyphens-auto">
|
<div
|
||||||
{{ Safe $model.record.Text }}
|
class="max-w-[52rem] font-serif text-base hyphens-auto bg-gray-50 py-8 border-r
|
||||||
|
border-b">
|
||||||
|
<div class="px-8">
|
||||||
|
{{ Safe $model.record.Text }}
|
||||||
|
<div class="pt-3">
|
||||||
|
<a href="/edition/einfuehrung">Einführung</i></a>
|
||||||
|
<i class="ri-seedling-line px-1.5"></i>
|
||||||
|
<a href="/edition/dokumentation">Dokumentation </a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mt-4 py-2 px-3 rounded bg-orange-100 border border-orange-200
|
||||||
|
text-orange-950 font-sans font-bold">
|
||||||
|
Bitte beachten Sie, dass es sich hier noch um eine öffentliche Testversion
|
||||||
|
handelt. Über Rückmeldungen und Anregungen freuen wir uns [→ <a
|
||||||
|
href="/edition//kontakt">Kontakt</a>]
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="-mr-16 pt-2 grow-0 shrink-0">
|
<div class="-mr-16 pt-2 grow-0">
|
||||||
<img src="{{ $model.record.ImagePath }}" />
|
<img src="{{ $model.record.ImagePath }}" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,4 +1,22 @@
|
|||||||
{{ $model := . }}
|
{{ $model := . }}
|
||||||
|
{{/* .parameters
|
||||||
|
type Parameters struct {
|
||||||
|
Extended bool
|
||||||
|
Collection string
|
||||||
|
Query string
|
||||||
|
}
|
||||||
|
type SimpleParameters struct {
|
||||||
|
Parameters
|
||||||
|
Annotations bool
|
||||||
|
Persons bool
|
||||||
|
Title bool
|
||||||
|
Alm bool
|
||||||
|
Series bool
|
||||||
|
Places bool
|
||||||
|
Refs bool
|
||||||
|
Year bool
|
||||||
|
}
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
|
||||||
<div id="searchcontrol" class="container-normal">
|
<div id="searchcontrol" class="container-normal">
|
||||||
|
|||||||
@@ -349,7 +349,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
#entrydata .fieldlabel {
|
#entrydata .fieldlabel {
|
||||||
@apply font-bold text-base font-sans whitespace-nowrap min-w-48 grow-0 shrink-0 pt-0.5;
|
@apply font-bold font-serif text-base whitespace-nowrap min-w-48 grow-0 shrink-0 pt-0.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
#entrydata .fieldvalue {
|
#entrydata .fieldvalue {
|
||||||
|
|||||||
Reference in New Issue
Block a user