blob: dd1382f991a135f105b3f3765bb83052d2412b7a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
package repo
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 HTTP struct {
r templates.Renderer
}
func NewHTTP(r templates.Renderer) *HTTP { return &HTTP{r: r} }
func (h *HTTP) Index(w http.ResponseWriter, r *http.Request, v wtypes.Vars) {
base := wtypes.Base(r)
repo := v["repo"]
_ = h.r.Render(w, "repo/index.html", struct {
Group string
Repo string
}{
Group: "/" + strings.Join(base.GroupPath, "/") + "/",
Repo: repo,
})
}
|