Some refinements; anonymous authors

This commit is contained in:
Simon Martens
2025-09-22 21:03:27 +02:00
parent f8d7b92be0
commit 9268402ebf
16 changed files with 177 additions and 428 deletions

View File

@@ -202,6 +202,16 @@ func (k *KGPZ) Funcs() map[string]interface{} {
e["LookupPieces"] = k.Library.Pieces.ReverseLookup
e["LookupWorks"] = k.Library.Works.ReverseLookup
e["LookupIssues"] = k.Library.Issues.ReverseLookup
e["LookupAnonymWorks"] = func() []xmlmodels.Work {
var anonymWorks []xmlmodels.Work
for _, work := range k.Library.Works.Array {
// Check if work has no agents
if len(work.AgentRefs) == 0 {
anonymWorks = append(anonymWorks, work)
}
}
return anonymWorks
}
return e
}