~gitpocket/gitpocket

1
a7ba5842247eb2aaebd1462924e46678ec05e3a2
mainfeed-discovery
gitpocket/templates/tree.html -rw-r--r--979 bytes ViewLogBlameView rawPermalink a7ba584224 feat(basin): minimal git host with ssh and smart https 1 months ago
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
{{define "content"}}
{{$p := .Data.Page}}
{{template "crumbs" .Data}}
<table class="tree">
{{range .Data.Entries}}
<tr>
<td class="mode">{{.Mode}}</td>
<td class="name">{{if eq .Type "tree"}}<a href="/{{$p.Repo.Path}}/tree/{{$p.Ref}}/{{if $.Data.Path}}{{$.Data.Path}}/{{end}}{{.Name}}/">{{.Name}}/</a>{{else if eq .Type "blob"}}<a href="/{{$p.Repo.Path}}/tree/{{$p.Ref}}/{{if $.Data.Path}}{{$.Data.Path}}/{{end}}{{.Name}}">{{.Name}}</a>{{else}}{{.Name}} <span class="muted">({{.Type}})</span>{{end}}</td>
<td class="size">{{if eq .Type "blob"}}{{size .Size}}{{end}}</td>
</tr>
{{end}}
</table>
{{end}}
{{define "crumbs"}}
{{$p := .Page}}
<p class="crumbs"><a href="/{{$p.Repo.Path}}/tree/{{$p.Ref}}/">{{$p.Repo.Name}}</a>{{range $i, $c := .Crumbs}}/<a href="/{{$p.Repo.Path}}/tree/{{$p.Ref}}/{{join $.Crumbs (inc $i)}}{{if lt (inc $i) (len $.Crumbs)}}/{{end}}">{{$c}}</a>{{end}} <span class="muted">at <a href="/{{$p.Repo.Path}}/log/{{$p.Ref}}">{{$p.Ref}}</a></span></p>
{{end}}