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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
{{define "gitnav"}}
<div class="git-nav">
<a href="{{.Base}}/"><strong>{{.RepoName}}</strong></a>
{{if .Ref}}<span class="hash">@ {{.Ref}}</span>{{end}}
· <a href="{{.Base}}/">summary</a>
<a href="{{.Base}}/refs">refs</a>
{{if .LogURL}}<a href="{{.LogURL}}">log</a>{{end}}
</div>
{{end}}
{{define "crumbs"}}
{{if .}}
<div class="crumbs mono">
{{range .}}{{if .URL}}<a href="{{.URL}}">{{.Name}}</a>{{else}}{{.Name}}{{end}} / {{end}}
</div>
{{end}}
{{end}}
{{define "summary"}}
{{template "gitnav" .Nav}}
<h1>{{.Nav.RepoName}}</h1>
<table class="refs">
<tr><td class="who">branches</td><td>{{range .Branches}}<a href="{{.URL}}">{{.Name}}</a> {{else}}<span class="hash">none</span>{{end}}</td></tr>
<tr><td class="who">tags</td><td>{{range .Tags}}<a href="{{.URL}}">{{.Name}}</a> {{else}}<span class="hash">none</span>{{end}}</td></tr>
</table>
<h2>Files</h2>
{{template "treetable" .Entries}}
{{if .Readme}}<h2>README</h2>
<div class="markdown-readme">{{.Readme}}</div>{{end}}
{{end}}
{{define "tree"}}
{{template "gitnav" .Nav}}
<h1>{{.Title}}</h1>
{{template "crumbs" .Crumbs}}
{{template "treetable" .Entries}}
{{end}}
{{define "treetable"}}
<table class="tree">
{{range .}}
<tr><td class="name"><a href="{{.URL}}">{{.Name}}{{if .IsDir}}/{{end}}</a></td><td class="size">{{.Size}}</td></tr>
{{else}}
<tr><td class="hash">(empty)</td></tr>
{{end}}
</table>
{{end}}
{{define "blob"}}
{{template "gitnav" .Nav}}
{{template "crumbs" .Crumbs}}
<div class="blob-meta">{{.Path}} · {{.Size}}{{if .RawURL}} · <a href="{{.RawURL}}">raw</a>{{end}}</div>
{{if .Binary}}
<p>Binary file not shown. <a href="{{.RawURL}}">Download raw</a>.</p>
{{else}}
<div class="blob-controls">
<span class="label">view:</span>
{{range .Renderers}}<a class="renderer{{if .Active}} active{{end}}" href="{{.URL}}">{{.Label}}</a>{{end}}
<a class="force-toggle{{if .Force}} on{{end}}" href="{{.ForceURL}}">{{if .Force}}☑{{else}}☐{{end}} force</a>
</div>
<div class="blob">{{.Body}}</div>
{{end}}
{{end}}
{{define "log"}}
{{template "gitnav" .Nav}}
<h1>Commits · {{.Nav.Ref}}</h1>
<table class="log">
{{range .Commits}}
<tr>
<td class="subject"><a href="{{.URL}}">{{.Subject}}</a></td>
<td class="who">{{.Author}}</td>
<td class="when">{{.When}}</td>
<td><a class="hash" href="{{.URL}}">{{.Short}}</a></td>
</tr>
{{else}}
<tr><td class="hash">(no commits)</td></tr>
{{end}}
</table>
{{end}}
{{define "commit"}}
{{template "gitnav" .Nav}}
<div class="commit-meta">
<div class="subject">{{.Subject}}</div>
<div class="hash mono">commit {{.Hash}}</div>
<div>{{.Author}} · {{.When}}</div>
{{range .Parents}}<div class="mono">parent <a href="{{.URL}}">{{.Short}}</a></div>{{end}}
{{if .Body}}<pre>{{.Body}}</pre>{{end}}
</div>
{{.Diff}}
{{end}}
{{define "refs"}}
{{template "gitnav" .Nav}}
<h1>Branches</h1>
<table class="refs">
{{range .Branches}}<tr><td class="name"><a href="{{.URL}}">{{.Name}}</a></td><td><a class="hash" href="{{.LogURL}}">log</a></td><td class="hash">{{.Short}}</td></tr>
{{else}}<tr><td class="hash">none</td></tr>{{end}}
</table>
<h1>Tags</h1>
<table class="refs">
{{range .Tags}}<tr><td class="name"><a href="{{.URL}}">{{.Name}}</a></td><td class="hash">{{.Short}}</td></tr>
{{else}}<tr><td class="hash">none</td></tr>{{end}}
</table>
{{end}}
|