mirror of
https://github.com/Theodor-Springmann-Stiftung/musenalm.git
synced 2025-10-29 09:15:33 +00:00
Slight page refactoring, text pages, tooltips
This commit is contained in:
@@ -7,30 +7,8 @@ import (
|
||||
)
|
||||
|
||||
type IPage interface {
|
||||
Up(app core.App) error
|
||||
Down(app core.App) error
|
||||
Up(app core.App, engine *templating.Engine) error
|
||||
Down(app core.App, engine *templating.Engine) error
|
||||
// TODO: pass the cache here
|
||||
Setup(router *router.Router[*core.RequestEvent], app core.App, engine *templating.Engine) error
|
||||
}
|
||||
|
||||
type Page struct {
|
||||
// WARNING: this is not thread safe, just set this once in setup
|
||||
Name string
|
||||
Layout string
|
||||
Template string
|
||||
}
|
||||
|
||||
func (p *Page) Up(app core.App) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *Page) Down(app core.App) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *Page) Setup(router *router.Router[*core.RequestEvent], app core.App, engine *templating.Engine) error {
|
||||
router.GET(p.Name, func(e *core.RequestEvent) error {
|
||||
return engine.Response200(e, p.Template, nil, p.Layout)
|
||||
})
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user