feat(webui): bootstrap a proper UI

This commit is contained in:
Julien Dessaux 2025-01-26 00:04:38 +01:00
parent 09885ef1e4
commit 4e029fb83a
Signed by: adyxax
GPG key ID: F92E51B86E07177E
11 changed files with 127 additions and 75 deletions

View file

@ -12,6 +12,7 @@ var statesTemplates = template.Must(template.ParseFS(htmlFS, "html/base.html", "
func handleStatesGET(db *database.DB) http.Handler {
type StatesData struct {
Page
States []model.State
}
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
@ -23,6 +24,7 @@ func handleStatesGET(db *database.DB) http.Handler {
return
}
render(w, statesTemplates, http.StatusOK, StatesData{
Page: Page{Title: "States", Section: "states"},
States: states,
})
})