mirror of
https://github.com/Theodor-Springmann-Stiftung/kgpz_web.git
synced 2025-10-29 00:55:32 +00:00
Some improvements with the akteure page
This commit is contained in:
@@ -17,6 +17,21 @@ func GetAgents(kgpz *xmlmodels.Library) fiber.Handler {
|
||||
return func(c *fiber.Ctx) error {
|
||||
a := c.Params("letterorid", DEFAULT_AGENT)
|
||||
a = strings.ToLower(a)
|
||||
|
||||
// Handle special "autoren" route
|
||||
if a == "autoren" {
|
||||
agents := viewmodels.AuthorsView(kgpz)
|
||||
if len(agents.Agents) == 0 {
|
||||
logging.Error(nil, "No authors found")
|
||||
return c.SendStatus(fiber.StatusNotFound)
|
||||
}
|
||||
return c.Render(
|
||||
"/autoren/",
|
||||
fiber.Map{"model": agents},
|
||||
)
|
||||
}
|
||||
|
||||
// Handle normal letter/id lookup
|
||||
agents := viewmodels.AgentsView(a, kgpz)
|
||||
if len(agents.Agents) == 0 {
|
||||
logging.Error(nil, "No agents found for letter or id: "+a)
|
||||
|
||||
Reference in New Issue
Block a user