1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
{{define "content"}}
{{if .User}}
<div class="row">
<h2>Your repositories</h2>
<a class="button" href="/create">New repository</a>
</div>
{{template "repolist" .Data.Repos}}
{{else}}
<section class="hero">
<h1><img src="/static/logo.svg" alt="">{{.Host}}</h1>
<p>A small git host. Push over SSH or HTTPS, browse trees, logs and diffs, and read READMEs with Markdown and LaTeX rendering. No JavaScript is needed to use it.</p>
<p class="muted">{{.Data.Public}} public repositories from {{.Data.Users}} users.</p>
<p><a class="button" href="/login">Log in</a> <a class="button secondary" href="/register">Register</a></p>
</section>
<h2>Recent repositories</h2>
{{template "repolist" .Data.Repos}}
{{end}}
{{end}}
{{define "repolist"}}
{{if .}}<ul class="repos">{{range .}}<li><div><a href="/{{.Path}}">{{.Path}}</a>{{if .Private}} <span class="tag">private</span>{{end}}</div>{{if .Description}}<div class="muted">{{.Description}}</div>{{end}}<div class="when">{{ago .Created}}</div></li>{{end}}</ul>{{else}}<p class="muted">Nothing here yet.</p>{{end}}
{{end}}
|