From b71c6c0e5b8dd00d44e40ac0551902a23cbe19d5 Mon Sep 17 00:00:00 2001 From: "Gabriel A. Giovanini" Date: Sat, 15 Jun 2024 18:42:48 +0200 Subject: feat: Add summary page --- templates/gititemsummary.qtpl | 64 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 63 insertions(+), 1 deletion(-) (limited to 'templates/gititemsummary.qtpl') diff --git a/templates/gititemsummary.qtpl b/templates/gititemsummary.qtpl index 4cbf324..9a3e2ee 100644 --- a/templates/gititemsummary.qtpl +++ b/templates/gititemsummary.qtpl @@ -1,10 +1,72 @@ +{% import "github.com/go-git/go-git/v5/plumbing" %} +{% import "github.com/go-git/go-git/v5/plumbing/object" %} + {% code type GitItemSummaryPage struct { + Tags []*plumbing.Reference + Branches []*plumbing.Reference + Commits []*object.Commit } %} {% func (g *GitItemSummaryPage) Nav(name, ref string) %}{%= GitItemNav(name, ref, Summary) %}{% endfunc %} {% func (g *GitItemSummaryPage) GitContent(name, ref string) %} -

Summary

+
+
+ {% if len(g.Tags) > 0 %} +
+ {% for _, t := range g.Tags %} +
+
+ {%s t.Name().Short() %} +
+
+
+ tree + log +
+
+
+ {% endfor %} +
+ {% else %} +

No tags

+ {% endif %} +
+
+
+ {% for _, b := range g.Branches %} +
+
+ {%s b.Name().Short() %} +
+
+
+ tree + log +
+
+
+ {% endfor %} +
+
+
+
+
+ {% for _, c := range g.Commits %} +
+
+ {%s TimeFormat(c.Committer.When) %} +
+
+
{%s c.Message %}
+
+
+ {%s c.Committer.Name %} <{%s c.Committer.Email %}> +
+
+ {% endfor %} +
+
{% endfunc %} -- cgit v1.2.3