templates/log.html 1.4 KiB raw
1
{{define "content"}}
2
<nav class="view-nav">
3
  <details class="branch-selector">
4
    <summary>{{.Data.Ref}}</summary>
5
    <ul>
6
      {{range .Data.Branches}}
7
      <li{{if eq .Name $.Data.Ref}} class="active"{{end}}><a href="{{$.BaseURL}}/{{$.Repo}}/log/{{.Name}}">{{.Name}}</a></li>
8
      {{end}}
9
    </ul>
10
  </details>
11
  {{if .Data.LastCommit}}
12
  <div class="last-commit">
13
    <span class="hash"><a href="{{.BaseURL}}/{{.Repo}}/commit/{{.Data.LastCommit.Hash}}">{{.Data.LastCommit.ShortHash}}</a></span>
14
    <span class="subject">{{.Data.LastCommit.Subject}}</span>
15
    <span class="author">{{.Data.LastCommit.Author}}</span>
16
    <span class="date">{{timeAgo .Data.LastCommit.AuthorDate}}</span>
17
  </div>
18
    {{end}}
19
</nav>
20
21
{{if .Data.IsEmpty}}
22
<p class="empty">No commits found.</p>
23
{{else}}
24
<table class="log-list">
25
<thead>
26
  <tr>
27
    <th>Hash</th>
28
    <th>Subject</th>
29
    <th class="author desktop">Author</th>
30
    <th>Age</th>
31
  </tr>
32
</thead>
33
<tbody>
34
{{range .Data.Commits}}
35
  <tr>
36
    <td class="hash"><a href="{{$.BaseURL}}/{{$.Repo}}/commit/{{.Hash}}">{{.ShortHash}}</a></td>
37
    <td class="subject">{{.Subject}}</td>
38
    <td class="author desktop">{{.Author}}</td>
39
    <td class="date">{{timeAgo .AuthorDate}}</td>
40
  </tr>
41
{{end}}
42
</tbody>
43
</table>
44
45
<div class="pagination">
46
  {{if .Data.HasPrev}}<a href="?page={{.Data.PrevPage}}">&larr; Newer</a>{{end}}
47
  {{if .Data.HasNext}}<a href="?page={{.Data.NextPage}}">Older &rarr;</a>{{end}}
48
</div>
49
{{end}}
50
{{end}}