From 56416b78ecb99dd7388133e2d4ed12f53174fee1 Mon Sep 17 00:00:00 2001 From: Jocadbz Date: Fri, 20 Feb 2026 13:26:58 -0300 Subject: [PATCH] refactor the preferences page --- handlers/preferences.go | 1 + templates/pages/preferences.html | 60 +++++++++++++------------------- 2 files changed, 25 insertions(+), 36 deletions(-) diff --git a/handlers/preferences.go b/handlers/preferences.go index b26b26c..53d658b 100644 --- a/handlers/preferences.go +++ b/handlers/preferences.go @@ -69,6 +69,7 @@ func PreferencesHandler(app *App) http.HandlerFunc { BasePath: app.Config.ThreadrDir, StaticPath: app.Config.ThreadrDir + "/static", CurrentURL: r.URL.Path, + ContentTemplate: "preferences-content", }, Preferences: prefs, ShowSuccess: showSuccess, diff --git a/templates/pages/preferences.html b/templates/pages/preferences.html index 2b212b2..6047c61 100644 --- a/templates/pages/preferences.html +++ b/templates/pages/preferences.html @@ -1,38 +1,26 @@ -{{define "preferences"}} - - - - {{.Title}} - - - - - {{template "navbar" .}} -
-
-

Preferences

-
- {{if .ShowSuccess}} -
- Preferences saved successfully! -
- {{end}} -
-
-

Draft Auto-Save

- -

- Drafts are saved to your browser's local storage and restored when you return to chat. -

+{{define "preferences"}}{{template "base" .}}{{end}} - -
-
-
- {{template "cookie_banner" .}} - - +{{define "preferences-content"}} +
+

Preferences

+
+{{if .ShowSuccess}} +
+ Preferences saved successfully! +
+{{end}} +
+
+

Draft Auto-Save

+ +

+ Drafts are saved to your browser's local storage and restored when you return to chat. +

+ + +
+
{{end}}