aboutsummaryrefslogtreecommitdiff
path: root/templates/gititemsummary.qtpl
diff options
context:
space:
mode:
authorGabriel A. Giovanini <mail@gabrielgio.me>2024-07-07 20:28:42 +0200
committerGabriel A. Giovanini <mail@gabrielgio.me>2024-07-07 21:44:29 +0200
commit44bc8e4078a09857ad86691a83e7ba7d4e3a69c4 (patch)
tree6788cafeaac286d381cc69e1917dab6ae58d1f85 /templates/gititemsummary.qtpl
parent8dff852753a1c4a708fd87e3cbb0f4844803aa95 (diff)
downloadcerrado-44bc8e4078a09857ad86691a83e7ba7d4e3a69c4.tar.gz
cerrado-44bc8e4078a09857ad86691a83e7ba7d4e3a69c4.tar.bz2
cerrado-44bc8e4078a09857ad86691a83e7ba7d4e3a69c4.zip
ref: Simplify path builder code
Diffstat (limited to 'templates/gititemsummary.qtpl')
-rw-r--r--templates/gititemsummary.qtpl24
1 files changed, 3 insertions, 21 deletions
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) %}
<div class="row">
<div class="col-md-8">
- {% if len(g.Tags) > 0 %}
- <div class="event-list">
- {% for _, t := range g.Tags %}
- <div class="row event me-md-2">
- <div class="col-4">
- {%s t.Name().Short() %}
- </div>
- <div class="col-8">
- <div class="float-end">
- <a href="/{%s name %}/archive/{%s t.Name().Short() %}.tar.gz">tar.gz</a>
- <a href="/{%s name %}/tree/{%s t.Name().Short() %}/">tree</a>
- <a href="/{%s name %}/log/{%s t.Name().Short() %}/">log</a>
- </div>
- </div>
- </div>
- {% endfor %}
- </div>
- {% else %}
- <p> No tags </p>
- {% endif %}
+ {%= ListTags(name, g.Tags) %}
</div>
<div class="col-md-4">
<div class="event-list">