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

templates/views/index.html

c0427d5fc7c0fcf8606c546071085e8af231fb81 · 1.5 KB · 40 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">
16 <thead>
17 <tr>
18 <th>Repository</th>
19 <th>Description</th>
20 <th class="text-right">Last Updated</th>
21 </tr>
22 </thead>
23 <tbody>
24 {{ range .Repos }}
25 <tr>
26 <td class="repo-name">
27 <a href="/{{ .Slug }}/">{{ .Title }}</a>
28 {{ with .Owner }}<span class="repo-owner">{{ . }}</span>{{ end }}
29 </td>
30 <td class="repo-desc">{{ with .Description }}{{ . }}{{ else }}<span class="muted">No description set</span>{{ end }}</td>
31 <td class="repo-meta">{{ with .LastCommit }}<time datetime="{{ rfc3339 . }}">{{ date . }}</time>{{ else }}<span class="muted">empty</span>{{ end }}</td>
32 </tr>
33 {{ else }}
34 <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>
35 {{ end }}
36 </tbody>
37 </table>
38 </div>
39 {{ end }}
40 {{ end }}