internal/web/templates/tree.html

e4fa4034379ae93e3cf6f1084ed577a7e02b530c
gitbay/internal/web/templates/tree.html history · blame · raw

36 lines · 2258 bytes

 1{{define "title"}}{{.Repo.OwnerName}}/{{.Repo.Name}}{{end}}
 2{{define "content"}}
 3{{if .DirPath}}<h1 class="vh">{{.DirPath}}</h1>{{end}}
 4<div class="pathbar">
 5  {{template "refmenu" .}}
 6  <span class="crumbs"><a href="/{{.Repo.OwnerName}}/{{.Repo.Name}}">{{.Repo.Name}}</a>/{{range .Crumbs}}<a href="{{.URL}}">{{.Name}}</a>/{{end}}</span>
 7  <span class="spacer"></span>
 8  <a class="act" href="/{{.Repo.OwnerName}}/{{.Repo.Name}}/search">Find file</a>
 9  <a class="act" href="/{{.Repo.OwnerName}}/{{.Repo.Name}}/log/{{.Ref}}">History</a>
10  <a class="act" href="/{{.Repo.OwnerName}}/{{.Repo.Name}}/archive/{{.Ref}}.tar.gz">Download</a>
11</div>
12{{if .Entries}}<p class="clone">Clone: <code>git clone {{.CloneURL}}</code></p>{{end}}
13{{with .Tip}}{{if .SHA}}<div class="tipbar">
14  <span class="who">{{.Author}}</span>
15  <a class="subject" href="/{{$.Repo.OwnerName}}/{{$.Repo.Name}}/commit/{{.SHA}}">{{.Subject}}</a>
16  <span class="spacer"></span>
17  <a class="sha" href="/{{$.Repo.OwnerName}}/{{$.Repo.Name}}/commit/{{.SHA}}"><code>{{short .SHA}}</code></a>
18  <span class="age">{{ago .When}}</span>
19</div>{{end}}{{end}}
20<div class="tablewrap">
21<table class="tree">
22<tr class="cols"><th scope="col">name</th><th scope="col" class="lastcommit">last commit</th><th scope="col" class="age">updated</th></tr>
23{{range .Entries}}{{$c := index $.LastCommits .Name}}<tr>
24  {{if eq .Type "tree"}}<td class="name dir"><a href="/{{$.Repo.OwnerName}}/{{$.Repo.Name}}/tree/{{$.Ref}}/{{$.Prefix}}{{.Name}}">{{.Name}}/</a></td>
25  {{else}}<td class="name"><a href="/{{$.Repo.OwnerName}}/{{$.Repo.Name}}/blob/{{$.Ref}}/{{$.Prefix}}{{.Name}}">{{.Name}}</a></td>{{end}}
26  <td class="lastcommit">{{with $c.Subject}}<a href="/{{$.Repo.OwnerName}}/{{$.Repo.Name}}/commit/{{$c.SHA}}" title="{{.}}">{{.}}</a>{{end}}</td>
27  <td class="age">{{ago $c.When}}</td>
28</tr>
29{{else}}<tr><td class="name empty" colspan="3">this repository is empty — push something:<br><code>git remote add origin {{.CloneURL}}</code></td></tr>{{end}}
30</table>
31</div>
32{{if .ReadmeHTML}}<section class="readme">
33<div class="cardhead"><a href="/{{.Repo.OwnerName}}/{{.Repo.Name}}/blob/{{.Ref}}/{{.Prefix}}{{.ReadmeName}}">{{.ReadmeName}}</a></div>
34<div class="rendered">{{.ReadmeHTML}}</div>
35</section>{{end}}
36{{end}}