aboutsummaryrefslogtreecommitdiff
path: root/templates/commit.qtpl
diff options
context:
space:
mode:
Diffstat (limited to 'templates/commit.qtpl')
-rw-r--r--templates/commit.qtpl24
1 files changed, 17 insertions, 7 deletions
diff --git a/templates/commit.qtpl b/templates/commit.qtpl
index b5699f4..adc6f2a 100644
--- a/templates/commit.qtpl
+++ b/templates/commit.qtpl
@@ -1,24 +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" %}
-{% func Commit(name string, c *object.Commit, showTar bool) %}
+{% func Commit(name string, c *git.CommitReference, showTar bool) %}
<div class="row event">
<div class="row">
<div class="col-md">
- <a title="{%s c.Hash.String() %}" href="/{%s name %}/commit/{%s c.Hash.String() %}/">{%s c.Hash.String()[0:8] %}</a> —
- <a title="{%s c.Committer.Email %}" href="mailto:{%s c.Author.Email %}">{%s c.Author.Name %}</a>
+ <a title="{%s c.Commit().Hash.String() %}" href="/{%s name %}/commit/{%s c.Commit().Hash.String() %}/">{%s c.Commit().Hash.String()[0:8] %}</a> —
+ <a title="{%s c.Commit().Committer.Email %}" href="mailto:{%s c.Commit().Author.Email %}">{%s c.Commit().Author.Name %}</a>
+ —
+ {% if c.HasReference() %}
+ {% for _, r := range c.References() %}
+ {% if r.Name().IsBranch() %}
+ <a class="ref branch" title="{%s c.Commit().Hash.String() %}" href="/{%s name %}/tree/{%s r.Name().Short() %}/">{%s r.Name().Short() %}</a>
+ {% else %}
+ <a class="ref tag" title="{%s c.Commit().Hash.String() %}" href="/{%s name %}/commit/{%s c.Commit().Hash.String() %}/">{%s r.Name().Short() %}</a>
+ {% endif %}
+ {% endfor %}
+ {%endif%}
</div>
{% if showTar %}
<div class="col-md text-md-center">
- <a title="tar.gz for {%s c.Hash.String() %}" href="/{%s name %}/archive/{%s c.Hash.String() %}.tar.gz">tar.gz</a>
+ <a title="tar.gz for {%s c.Commit().Hash.String() %}" href="/{%s name %}/archive/{%s c.Commit().Hash.String() %}.tar.gz">tar.gz</a>
</div>
{% endif %}
<div class="col-md text-md-end">
- <a title="{%s c.Author.When.UTC().Format("2006-01-02 15:04:05")%} UTC">{%s humanize.Time(c.Author.When) %}</a>
+ <a title="{%s c.Commit().Author.When.UTC().Format("2006-01-02 15:04:05")%} UTC">{%s humanize.Time(c.Commit().Author.When) %}</a>
</div>
</div>
<div class="code-view">
- <pre>{%s c.Message %}</pre>
+ <pre>{%s c.Commit().Message %}</pre>
</div>
</div>
{% endfunc %}