aboutsummaryrefslogtreecommitdiff
path: root/forged/internal/incoming/web/handlers/group.go
diff options
context:
space:
mode:
Diffstat (limited to 'forged/internal/incoming/web/handlers/group.go')
-rw-r--r--forged/internal/incoming/web/handlers/group.go14
1 files changed, 11 insertions, 3 deletions
diff --git a/forged/internal/incoming/web/handlers/group.go b/forged/internal/incoming/web/handlers/group.go
index 1a1cb1d..0c631c3 100644
--- a/forged/internal/incoming/web/handlers/group.go
+++ b/forged/internal/incoming/web/handlers/group.go
@@ -4,14 +4,22 @@ import (
"net/http"
"strings"
+ "go.lindenii.runxiyu.org/forge/forged/internal/incoming/web/templates"
wtypes "go.lindenii.runxiyu.org/forge/forged/internal/incoming/web/types"
)
-type GroupHTTP struct{}
+type GroupHTTP struct {
+ r templates.Renderer
+}
-func NewGroupHTTP() *GroupHTTP { return &GroupHTTP{} }
+func NewGroupHTTP(r templates.Renderer) *GroupHTTP { return &GroupHTTP{r: r} }
func (h *GroupHTTP) Index(w http.ResponseWriter, r *http.Request, _ wtypes.Vars) {
base := wtypes.Base(r)
- _, _ = w.Write([]byte("group index for: /" + strings.Join(base.GroupPath, "/") + "/"))
+ _ = h.r.Render(w, "group/index.html", struct {
+ GroupPath string
+ }{
+ GroupPath: "/" + strings.Join(base.GroupPath, "/") + "/",
+ })
}
+