mirror of
https://github.com/Theodor-Springmann-Stiftung/musenalm.git
synced 2025-10-29 09:15:33 +00:00
32 lines
764 B
Go
32 lines
764 B
Go
package pagemodels
|
|
|
|
import (
|
|
"github.com/Theodor-Springmann-Stiftung/musenalm/templating"
|
|
"github.com/pocketbase/pocketbase/core"
|
|
"github.com/pocketbase/pocketbase/tools/router"
|
|
)
|
|
|
|
type StaticPage struct {
|
|
Name string
|
|
Template string
|
|
Layout string
|
|
URL string
|
|
}
|
|
|
|
func (p *StaticPage) Setup(router *router.Router[*core.RequestEvent], app core.App, engine *templating.Engine) error {
|
|
router.GET(p.URL, func(e *core.RequestEvent) error {
|
|
data := map[string]interface{}{}
|
|
data["record"] = p
|
|
return engine.Response200(e, p.Template, data, p.Layout)
|
|
})
|
|
return nil
|
|
}
|
|
|
|
func (p *StaticPage) Up(app core.App, engine *templating.Engine) error {
|
|
return nil
|
|
}
|
|
|
|
func (p *StaticPage) Down(app core.App, engine *templating.Engine) error {
|
|
return nil
|
|
}
|