aboutsummaryrefslogtreecommitdiff
path: root/http_handle_index.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-02-13 01:28:35 +0800
committerRunxi Yu <me@runxiyu.org>2025-02-13 01:28:35 +0800
commit14326ba9be276d2649b4681d3ebed1c32f65013f (patch)
tree9bd8717b6968b5a977d925d193042a92bc68f311 /http_handle_index.go
parentssh_{server,utils}: Swap filenames (diff)
downloadforge-14326ba9be276d2649b4681d3ebed1c32f65013f.tar.gz
forge-14326ba9be276d2649b4681d3ebed1c32f65013f.tar.zst
forge-14326ba9be276d2649b4681d3ebed1c32f65013f.zip
_header.html: Add header
Diffstat (limited to 'http_handle_index.go')
-rw-r--r--http_handle_index.go9
1 files changed, 3 insertions, 6 deletions
diff --git a/http_handle_index.go b/http_handle_index.go
index bf36f98..4448272 100644
--- a/http_handle_index.go
+++ b/http_handle_index.go
@@ -4,10 +4,7 @@ import (
"net/http"
)
-func handle_index(w http.ResponseWriter, r *http.Request) {
- data := make(map[string]any)
- data["global"] = global_data
-
+func handle_index(w http.ResponseWriter, r *http.Request, params map[string]any) {
rows, err := database.Query(r.Context(), "SELECT name FROM groups")
if err != nil {
_, _ = w.Write([]byte("Error querying groups: " + err.Error()))
@@ -30,9 +27,9 @@ func handle_index(w http.ResponseWriter, r *http.Request) {
return
}
- data["groups"] = groups
+ params["groups"] = groups
- err = templates.ExecuteTemplate(w, "index", data)
+ err = templates.ExecuteTemplate(w, "index", params)
if err != nil {
_, _ = w.Write([]byte("Error rendering template: " + err.Error()))
return