aboutsummaryrefslogtreecommitdiff
path: root/pkg/handler/git/handler.go
diff options
context:
space:
mode:
authorGabriel A. Giovanini <mail@gabrielgio.me>2025-03-25 21:20:13 +0100
committerGabriel A. Giovanini <mail@gabrielgio.me>2025-03-25 21:20:13 +0100
commit6006194c072dba9f65aa08c6e3be06ea8ead8910 (patch)
treee647fd2063efce999ac97761f05aaf38fee135dd /pkg/handler/git/handler.go
parentc1247a52e92523be8d225d20dc9592f32dca5088 (diff)
downloadcerrado-6006194c072dba9f65aa08c6e3be06ea8ead8910.tar.gz
cerrado-6006194c072dba9f65aa08c6e3be06ea8ead8910.tar.bz2
cerrado-6006194c072dba9f65aa08c6e3be06ea8ead8910.zip
feat: Add ref page
Now there is page more tailored to a single ref.
Diffstat (limited to 'pkg/handler/git/handler.go')
-rw-r--r--pkg/handler/git/handler.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/pkg/handler/git/handler.go b/pkg/handler/git/handler.go
index 034d5c2..a9be54c 100644
--- a/pkg/handler/git/handler.go
+++ b/pkg/handler/git/handler.go
@@ -350,6 +350,28 @@ func (g *GitHandler) Log(w http.ResponseWriter, r *http.Request) error {
return nil
}
+func (g *GitHandler) Ref(w http.ResponseWriter, r *http.Request) error {
+ ext.SetHTML(w)
+ name := r.PathValue("name")
+ ref := r.PathValue("ref")
+
+ commit, tag, err := g.gitService.GetTag(ref, name)
+ if err != nil {
+ return err
+ }
+
+ gitList := &templates.GitItemPage{
+ Name: name,
+ Ref: ref,
+ GitItemBase: &templates.GitItemRefPage{
+ Commit: commit,
+ Reference: tag,
+ },
+ }
+ templates.WritePageTemplate(w, gitList, r.Context())
+ return nil
+}
+
func (g *GitHandler) Commit(w http.ResponseWriter, r *http.Request) error {
ext.SetHTML(w)
name := r.PathValue("name")