feat(webui): bootstrap account settings management with light and dark mode
This commit is contained in:
parent
ab043d8617
commit
98c7d6f578
13 changed files with 136 additions and 14 deletions
|
@ -3,14 +3,23 @@ package webui
|
|||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
"git.adyxax.org/adyxax/tfstated/pkg/model"
|
||||
)
|
||||
|
||||
type Page struct {
|
||||
LightMode bool
|
||||
Precedent string
|
||||
Section string
|
||||
Title string
|
||||
}
|
||||
|
||||
func makePage(r *http.Request, page *Page) *Page {
|
||||
settings := r.Context().Value(model.SettingsContextKey{}).(*model.Settings)
|
||||
page.LightMode = settings.LightMode
|
||||
return page
|
||||
}
|
||||
|
||||
func handleIndexGET() http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
if r.URL.Path == "/" {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue