aboutsummaryrefslogtreecommitdiff
path: root/templates/gititemref.qtpl
diff options
context:
space:
mode:
Diffstat (limited to 'templates/gititemref.qtpl')
-rw-r--r--templates/gititemref.qtpl34
1 files changed, 34 insertions, 0 deletions
diff --git a/templates/gititemref.qtpl b/templates/gititemref.qtpl
new file mode 100644
index 0000000..9e1c776
--- /dev/null
+++ b/templates/gititemref.qtpl
@@ -0,0 +1,34 @@
+{% import "git.gabrielgio.me/cerrado/pkg/git" %}
+{% import "git.gabrielgio.me/cerrado/pkg/humanize" %}
+{% import "github.com/go-git/go-git/v5/plumbing/object" %}
+
+{% code
+type GitItemRefPage struct {
+ Reference *git.TagReference
+ Commit *object.Commit
+}
+%}
+
+{% func (g *GitItemRefPage) Nav(name, ref string) %}{%= GitItemNav(name, ref, Refs) %}{% endfunc %}
+
+{% func (g *GitItemRefPage) GitContent(name, ref string) %}
+<div class="event-list">
+ <div class="row event">
+ <div class="row">
+ <div class="col-md">
+ <a title="{%s g.Commit.Hash.String() %}" href="/{%s name %}/commit/{%s g.Commit.Hash.String() %}/">{%s g.Commit.Hash.String()[0:8] %}</a> —
+ <a title="{%s g.Commit.Committer.Email %}" href="mailto:{%s g.Commit.Author.Email %}">{%s g.Commit.Author.Name %}</a>
+ </div>
+ <div class="col-md text-md-center">
+ <a title="tar.gz for {%s g.Reference.ShortName() %}" href="/{%s name %}/archive/{%s g.Reference.ShortName() %}.tar.gz">tar.gz</a>
+ </div>
+ <div class="col-md text-md-end">
+ <a title="{%s g.Commit.Author.When.UTC().Format("2006-01-02 15:04:05")%} UTC">{%s humanize.Time(g.Commit.Author.When) %}</a>
+ </div>
+ </div>
+ <div class="code-view">
+ <pre>{%s g.Reference.Message() %}</pre>
+ </div>
+ </div>
+</div>
+{% endfunc %}