rename space to district

This commit is contained in:
Anya Tokugawa committed 2026-07-04 23:19:18 +09:00
1 parent 94d56f9a8f
commit 8a2ac56844
7 files changed
+253 -9

No files matched your search

+43
View File
@@ -0,0 +1,43 @@
package server
import (
"net/http"
"pageswiki/internal/store"
)
type RequestContext struct {
District *store.District
}
func (s *Server) BuildRequestContext(
r *http.Request,
) *RequestContext {
return &RequestContext{
District: s.currentDistrict(),
}
}
func (s *Server) renderWithContext(
w http.ResponseWriter,
r *http.Request,
name string,
data map[string]any,
) {
if data == nil {
data = map[string]any{}
}
data["Context"] =
s.BuildRequestContext(
r,
)
s.render(
w,
name,
data,
)
}