From 44bc8e4078a09857ad86691a83e7ba7d4e3a69c4 Mon Sep 17 00:00:00 2001 From: "Gabriel A. Giovanini" Date: Sun, 7 Jul 2024 20:28:42 +0200 Subject: ref: Simplify path builder code --- templates/gititemsummary.qtpl | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) (limited to 'templates/gititemsummary.qtpl') diff --git a/templates/gititemsummary.qtpl b/templates/gititemsummary.qtpl index ef2c534..44e1604 100644 --- a/templates/gititemsummary.qtpl +++ b/templates/gititemsummary.qtpl @@ -1,9 +1,10 @@ {% import "github.com/go-git/go-git/v5/plumbing" %} {% import "github.com/go-git/go-git/v5/plumbing/object" %} +{% import "git.gabrielgio.me/cerrado/pkg/git" %} {% code type GitItemSummaryPage struct { - Tags []*plumbing.Reference + Tags []*git.TagReference Branches []*plumbing.Reference Commits []*object.Commit } @@ -14,26 +15,7 @@ type GitItemSummaryPage struct { {% func (g *GitItemSummaryPage) GitContent(name, ref string) %}
- {% if len(g.Tags) > 0 %} -
- {% for _, t := range g.Tags %} -
-
- {%s t.Name().Short() %} -
-
-
- tar.gz - tree - log -
-
-
- {% endfor %} -
- {% else %} -

No tags

- {% endif %} + {%= ListTags(name, g.Tags) %}
-- cgit v1.2.3