1{{define "content"}}
2<nav aria-label="breadcrumb">
3 <ul>
4 <li><a href="/{{.Repo.Name}}">{{.Repo.Name}}</a></li>
5 <li>{{.Ref}}</li>
6 </ul>
7</nav>
8
9<section aria-labelledby="commits-heading">
10 <h2 id="commits-heading">Commit log</h2>
11
12 {{if .Commits}}
13 {{range .Commits}}
14 <article aria-labelledby="commit-{{.ID | shortHash}}">
15 <h3 id="commit-{{.ID | shortHash}}">
16 <code><a href="/{{$.Repo.Name}}/commit/{{.ID}}">{{.ID | shortHash}}</a></code>
17 {{.Message | commitSubject}}
18 </h3>
19 {{$body := .Message | commitBody}}
20 {{if $body}}
21 <details>
22 <summary>Click to expand commit body</summary>
23 <pre>{{$body}}</pre>
24 </details>
25 {{end}}
26 <p>
27 <strong>{{.Author.Name}}</strong> created
28 <time datetime="{{.Author.When | rfc3339}}" data-tooltip="{{.Author.When | formatDate}}">{{.Author.When | relativeTime}}</time>
29 </p>
30 </article>
31 {{end}}
32
33 {{if or .HasPrevPage .HasNextPage}}
34 <nav aria-label="Pagination">
35 <p>Page {{.Page}} of {{.TotalPages}}</p>
36 <ul>
37 {{if .HasPrevPage}}
38 <li>
39 <a href="/{{.Repo.Name}}/commits/{{.Ref}}?page={{dec .Page}}" rel="prev"
40 >Previous page</a
41 >
42 </li>
43 {{end}}
44 {{if .HasNextPage}}
45 <li>
46 <a href="/{{.Repo.Name}}/commits/{{.Ref}}?page={{inc .Page}}" rel="next"
47 >Next page</a
48 >
49 </li>
50 {{end}}
51 </ul>
52 </nav>
53 {{end}}
54 {{else}}
55 <p>No commits yet</p>
56 {{end}}
57</section>
58{{end}}