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

templates/views/index.html

8d1bb5bfdd2cba82488775b46308efed740132a8 · 1.8 KB · 45 lines raw

1 {{ define "index.html" }}{{ template "base" . }}{{ end }}
2 {{ define "styles" }}<link rel="stylesheet" href="{{ static "css/repo-list.css" }}">{{ end }}
3 {{ define "main" }}
4 {{ $secs := mod "sections" }}
5
6 <header class="page-head">
7 <h1 class="page-title">{{ .Site.Name }}</h1>
8 <p class="page-subtitle">{{ len (mod "repos") }} repositories{{ if gt (len $secs) 1 }} in {{ len $secs }} sections{{ end }}</p>
9 </header>
10
11 {{ range $secs }}
12 {{/* An unnamed section means gsg.section is unset everywhere: render flat. */}}
13 {{ with .Name }}<h2 id="{{ slug . }}" class="page-subtitle">{{ . }}</h2>{{ end }}
14 <div class="table-wrap">
15 <table class="table table-repos">
16 <colgroup>
17 <col class="col-repo">
18 <col class="col-desc">
19 <col class="col-meta">
20 </colgroup>
21 <thead>
22 <tr>
23 <th><span class="label-full">Repository</span><span class="label-short">Repo</span></th>
24 <th>Description</th>
25 <th class="text-right"><span class="label-full">Last Updated</span><span class="label-short">Updated</span></th>
26 </tr>
27 </thead>
28 <tbody>
29 {{ range .Repos }}
30 <tr>
31 <td class="repo-name">
32 <a href="/{{ .Slug }}/">{{ .Title }}</a>
33 {{ with .Owner }}<span class="repo-owner">{{ . }}</span>{{ end }}
34 </td>
35 <td class="repo-desc">{{ with .Description }}{{ . }}{{ else }}<span class="muted">No description set</span>{{ end }}</td>
36 <td class="repo-meta">{{ with .LastCommit }}<time datetime="{{ rfc3339 . }}">{{ date . }}</time>{{ else }}<span class="muted">empty</span>{{ end }}</td>
37 </tr>
38 {{ else }}
39 <tr><td colspan="3" class="text-center text-muted" style="padding: 2rem;">No repositories yet. Create a bare repo under the configured root.</td></tr>
40 {{ end }}
41 </tbody>
42 </table>
43 </div>
44 {{ end }}
45 {{ end }}