Migration This is my new public git source viewer. Source coming soon. Please contact with concerns/bugs. Contact me

templates/views/log.html

83aa601b98007ead72afeadb131a93d5694e04ca · 2.5 KB · 69 lines raw

1 {{ define "log.html" }}{{ template "base" . }}{{ end }}
2 {{ define "main" }}
3 {{ $slug := print "/" .Info.Slug }}
4 {{ $verify := .Info.GPGKeyring }}
5 {{ $m := mod "meta" }}
6 {{/* "20" here must match core.LogPageSize -- buildCtx uses that constant
7 to snap incoming ?ofs= values onto real page boundaries. */}}
8 {{ $page := mod "log" "20" }}
9
10 <header class="hero">
11 <div class="hero-inner">
12 <h1 class="page-title">Commit History</h1>
13 <p class="page-subtitle">
14 Showing <span style="color:var(--accent);font-weight:600;">{{ len $page.Commits }}</span> commits
15 </p>
16 </div>
17 </header>
18
19 {{/* `with` on the slice, not index 0 -- an empty repo has no commits. */}}
20 {{ with $page.Commits }}
21 <div class="table-wrap">
22 <table class="table">
23 <thead>
24 <tr>
25 <th>Hash</th>
26 <th>Subject</th>
27 <th>Author</th>
28 {{ if $verify }}<th>Signature</th>{{ end }}
29 <th class="text-right">Date</th>
30 </tr>
31 </thead>
32 <tbody>
33 {{ range . }}
34 <tr>
35 <td class="font-mono text-sm"><a href="{{ $slug }}/commit/{{ .SHA }}">{{ .Short }}</a></td>
36 <td><a href="{{ $slug }}/commit/{{ .SHA }}">{{ .Subject }}</a></td>
37 <td class="text-sm">{{ .Author }}</td>
38 {{ if $verify }}
39 <td class="text-sm">
40 {{ if .Verified }}<span class="chip chip-ok" title="{{ .Signer }} &middot; {{ .KeyID }}">verified</span>
41 {{ else if .Unchecked }}<span class="chip" title="key {{ .KeyID }} not in keyring">unknown key</span>
42 {{ else if .Signed }}<span class="chip chip-bad" title="{{ .KeyID }}">{{ .SigLabel }}</span>
43 {{ else }}<span class="text-muted">&mdash;</span>{{ end }}
44 </td>
45 {{ end }}
46 <td class="text-right text-sm text-muted"><time datetime="{{ rfc3339 .When }}">{{ date .When }}</time></td>
47 </tr>
48 {{ end }}
49 </tbody>
50 </table>
51 </div>
52
53 {{ else }}
54 {{ if $page.HasPrev }}
55 <div class="notice" style="text-align:center;"><span class="text-muted">No commits at this offset.</span></div>
56 {{ else }}
57 <div class="card" style="padding:2rem;text-align:center;">
58 <p class="muted">No commits yet. This is a fresh repository.</p>
59 </div>
60 {{ end }}
61 {{ end }}
62
63 {{ if or $page.HasPrev $page.HasNext }}
64 <nav class="pager" style="display:flex;justify-content:space-between;margin-top:1rem;">
65 <span>{{ if $page.HasPrev }}<a href="?ofs={{ $page.PrevOfs }}">&larr; Newer</a>{{ end }}</span>
66 <span>{{ if $page.HasNext }}<a href="?ofs={{ $page.NextOfs }}">Older &rarr;</a>{{ end }}</span>
67 </nav>
68 {{ end }}
69 {{ end }}