aboutsummaryrefslogtreecommitdiff
path: root/templates/gititemref.qtpl
blob: 9e1c776f675c868dd5464a0a4ae4d8c6761ba1f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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 %}