add remaining settings and navigation pages

This commit is contained in:
2026-02-13 23:15:09 -08:00
parent 78bc1a9974
commit 90121b4fd1
6 changed files with 196 additions and 0 deletions

27
web/settings.go Normal file
View File

@@ -0,0 +1,27 @@
package web
import "net/http"
func settingsPageHandler() http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
username := getLoggedInUsername(r)
if username == "" {
http.Redirect(w, r, "/login", http.StatusSeeOther)
return
}
type data struct {
Title string
LoggedInUsername string
TemplateName string
}
d := data{
Title: "muzi | Settings",
LoggedInUsername: username,
TemplateName: "settings",
}
err := templates.ExecuteTemplate(w, "base", d)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
}
}
}