HTML · 3362 bytes Raw Blame History
1 {{ define "page" -}}
2 <section class="shithub-commit-view">
3 <header class="shithub-code-head">
4 <h1>
5 <a href="/{{ .Owner }}/{{ .Repo.Name }}/tree/{{ .Detail.OID }}">{{ .Owner }}/{{ .Repo.Name }}</a>
6 <span class="shithub-code-sep">/</span>
7 <code>{{ .Detail.ShortOID }}</code>
8 </h1>
9 <a href="/{{ .Owner }}/{{ .Repo.Name }}/tree/{{ .Detail.TreeOID }}" class="shithub-button">Browse files</a>
10 </header>
11
12 <article class="shithub-commit-meta">
13 <h2 class="shithub-commit-subject">{{ .Detail.Subject }}</h2>
14 {{ if .Detail.Body }}<div class="shithub-commit-body">{{ .BodyHTML }}</div>{{ end }}
15
16 <div class="shithub-commit-people">
17 <div class="shithub-commit-actor">
18 <span class="shithub-commit-role">Authored by</span>
19 {{ if .Author.User }}
20 <a href="/{{ .Author.Username }}"><img src="{{ .Author.AvatarURL }}" alt="" class="shithub-avatar-sm"></a>
21 <a href="/{{ .Author.Username }}">{{ .Author.DisplayName }}</a>
22 {{ else }}
23 <span class="shithub-avatar-sm shithub-identicon" data-seed="{{ .Author.IdenticonSeed }}" aria-hidden="true"></span>
24 <span>{{ .Detail.AuthorName }} &lt;{{ .Detail.AuthorEmail }}&gt;</span>
25 {{ end }}
26 <time datetime="{{ .Detail.AuthorWhen.Format "2006-01-02T15:04:05Z" }}">{{ relativeTime .Detail.AuthorWhen }}</time>
27 </div>
28 {{ if ne .Detail.CommitterEmail .Detail.AuthorEmail }}
29 <div class="shithub-commit-actor">
30 <span class="shithub-commit-role">Committed by</span>
31 {{ if .Committer.User }}
32 <a href="/{{ .Committer.Username }}">{{ .Committer.DisplayName }}</a>
33 {{ else }}
34 <span>{{ .Detail.CommitterName }}</span>
35 {{ end }}
36 </div>
37 {{ end }}
38 </div>
39
40 <dl class="shithub-commit-refs">
41 <dt>SHA</dt><dd><code>{{ .Detail.OID }}</code></dd>
42 {{ if .Detail.Parents }}
43 <dt>Parents</dt>
44 <dd>
45 {{ range .Detail.Parents }}
46 <a href="/{{ $.Owner }}/{{ $.Repo.Name }}/commit/{{ . }}"><code>{{ slice . 0 7 }}</code></a>
47 {{ end }}
48 </dd>
49 {{ end }}
50 <dt>Tree</dt>
51 <dd><a href="/{{ .Owner }}/{{ .Repo.Name }}/tree/{{ .Detail.OID }}"><code>{{ slice .Detail.TreeOID 0 7 }}</code></a></dd>
52 </dl>
53 </article>
54
55 <section class="shithub-commit-files">
56 <h3>{{ len .Detail.Files }} changed file{{ if ne (len .Detail.Files) 1 }}s{{ end }}</h3>
57 <table class="shithub-commit-files-table">
58 <thead>
59 <tr><th>Status</th><th>File</th><th class="shithub-num-col">+</th><th class="shithub-num-col">-</th></tr>
60 </thead>
61 <tbody>
62 {{ range .Detail.Files }}
63 <tr>
64 <td><span class="shithub-status-{{ .Status }}">{{ .Status }}</span></td>
65 <td>
66 {{ if eq .Status "R" }}<code>{{ .OldPath }}</code> → {{ end }}
67 <a href="/{{ $.Owner }}/{{ $.Repo.Name }}/blob/{{ $.Detail.OID }}/{{ .Path }}"><code>{{ .Path }}</code></a>
68 </td>
69 <td class="shithub-num-col shithub-add">{{ if .Binary }}bin{{ else }}{{ .Insert }}{{ end }}</td>
70 <td class="shithub-num-col shithub-del">{{ if .Binary }}{{ else }}{{ .Delete }}{{ end }}</td>
71 </tr>
72 {{ end }}
73 </tbody>
74 </table>
75 <p class="shithub-hint">Per-file diff bodies render once S19 ships.</p>
76 </section>
77 </section>
78 {{- end }}