added sections overview
This commit is contained in:
parent
72d00aeb21
commit
799ff0fb2f
16 changed files with 181 additions and 66 deletions
|
|
@ -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()
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue