aboutsummaryrefslogtreecommitdiff
path: root/templates/commit.qtpl
blob: adc6f2ad6c7bcf32c6a250b5d7c0f6d060de66ac (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" %}

{% func Commit(name string, c *git.CommitReference, showTar bool) %}
  <div class="row event">
    <div class="row">
      <div class="col-md">
       <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.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.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.Commit().Message %}</pre>
    </div>
  </div>
{% endfunc %}