Added page layout errors

This commit is contained in:
Magnus Åhall 2024-06-27 09:51:52 +02:00
parent 4b21b0ac07
commit 65c0984348
6 changed files with 119 additions and 24 deletions

View file

@ -22,7 +22,7 @@ type Page struct {
Data any
}
func (p *Page) Render(w http.ResponseWriter) {
func (p *Page) Render(w http.ResponseWriter, r *http.Request) {
tmpl, err := getPage(p.LAYOUT, p.PAGE)
if err != nil {
httpError(w, we.Wrap(err).Log())
@ -49,6 +49,7 @@ func (p *Page) Render(w http.ResponseWriter) {
"PAGE": p.PAGE,
"MENU": p.MENU,
"CONFIG": smonConfig.Settings,
"ERROR": r.URL.Query().Get("_err"),
"Label": p.Label,
"Icon": p.Icon,