added user independent sections and started db migration work

This commit is contained in:
ston1th 2019-03-26 23:55:55 +01:00
commit 16ea95bf09
24 changed files with 622 additions and 122 deletions

View file

@ -236,6 +236,57 @@ func sectionHandler(ctx *Context) {
ctx.Exec()
}
func sectionNewHandler(ctx *Context) {
ctx.Template("sectionNewHandler")
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()
}
func sectionDelHandler(ctx *Context) {
ctx.Template("sectionDelHandler")
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()
}
func sectionEditHandler(ctx *Context) {
ctx.Template("sectionEditHandler")
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()
}
func pageNewHandler(ctx *Context) {
ctx.Template("pageNewHandler")
ctx.Data = webData{Title: "New Page"}