diff --git a/internal/routes/settings.go b/internal/routes/settings.go index cf2c1e1..f6e3275 100644 --- a/internal/routes/settings.go +++ b/internal/routes/settings.go @@ -14,7 +14,7 @@ import ( "git.soup.land/soup/shelves/internal/templates/components" ) -func settingsRenderView(f settingsForm, e settingsFormErrors) template.HTML { +func settingsRenderView(f settingsForm, e settingsFormErrors, ctx httpx.Ctx) template.HTML { body := components.Form{ Action: "/settings", Fields: []components.Field{ @@ -41,7 +41,7 @@ func settingsRenderView(f settingsForm, e settingsFormErrors) template.HTML { }, }.HTML() - return components.Page{Title: "Set up", Body: body}.HTML() + return components.Page{Title: "Set up", Body: body, SessionInfo: ctx.SessionInfo}.HTML() } func queryGetOwnerSettings(db *sql.DB) (settingsForm, error) { @@ -67,7 +67,7 @@ func SettingsGet(w http.ResponseWriter, r *http.Request) { return } - html(w, settingsRenderView(form, settingsFormErrors{})) + html(w, settingsRenderView(form, settingsFormErrors{}, ctx)) } type settingsForm struct { @@ -129,7 +129,7 @@ func SettingsPost(w http.ResponseWriter, r *http.Request) { if failed { w.WriteHeader(http.StatusBadRequest) - html(w, settingsRenderView(form, errs)) + html(w, settingsRenderView(form, errs, ctx)) return } diff --git a/internal/templates/components/page.tmpl.html b/internal/templates/components/page.tmpl.html index 11f6c2b..901f84b 100644 --- a/internal/templates/components/page.tmpl.html +++ b/internal/templates/components/page.tmpl.html @@ -2,13 +2,13 @@ - {{block "Title" .Title}}{{end}} - Shelves + {{block "Title" .Title}}{{.}}{{end}} - Shelves - {{block "Head" .Head}}{{end}} + {{block "Head" .Head}}{{.}}{{end}} -