chore(webui): rewrite all the web session code
All checks were successful
main / main (push) Successful in 3m13s
main / deploy (push) Has been skipped
main / publish (push) Has been skipped

#60
This commit is contained in:
Julien Dessaux 2025-04-29 01:25:11 +02:00
parent 929657fd34
commit 3bb5e735c6
Signed by: adyxax
GPG key ID: F92E51B86E07177E
19 changed files with 173 additions and 123 deletions

View file

@ -1,6 +1,7 @@
package webui
import (
"context"
"html/template"
"net/http"
@ -41,8 +42,8 @@ func handleSettingsPOST(db *database.DB) http.Handler {
errorResponse(w, r, http.StatusInternalServerError, err)
return
}
page := makePage(r, &Page{Title: "Settings", Section: "settings"})
page.LightMode = settings.LightMode
ctx := context.WithValue(r.Context(), model.SettingsContextKey{}, &settings)
page := makePage(r.WithContext(ctx), &Page{Title: "Settings", Section: "settings"})
render(w, settingsTemplates, http.StatusOK, SettingsPage{
Page: page,
Settings: &settings,