added sections overview

This commit is contained in:
ston1th 2019-01-22 21:45:32 +01:00
commit 799ff0fb2f
16 changed files with 181 additions and 66 deletions

View file

@ -205,14 +205,31 @@ func searchHandler(ctx *Context) {
}
}
func allHandler(ctx *Context) {
ctx.Template("allHandler")
func sectionsHandler(ctx *Context) {
ctx.Template("sectionsHandler")
ctx.Data = webData{
Title: "All Pages",
BodyTitle: "All Pages",
Title: "All Sections",
BodyTitle: "All Sections",
Admin: ctx.Admin(),
}
ctx.Data.Data = ctx.Srv.DB.GetAllPages(ctx.User())
ctx.Data.Data = ctx.Srv.DB.GetAllSections(ctx.User())
ctx.Exec()
}
func sectionHandler(ctx *Context) {
ctx.Template("sectionHandler")
section := ctx.Var("section")
ctx.Data = webData{
Title: section,
BodyTitle: section,
Admin: ctx.Admin(),
}
var err error
ctx.Data.Data, err = ctx.Srv.DB.GetAllSectionPages(section, ctx.User())
if err != nil {
ctx.NotFound()
return
}
ctx.Exec()
}