~gitpocket/gitpocket

1
266053a6e7bb9c2b05622beea635d12c2088a60d
mainfeed-discovery
gitpocket/templates/tree.html -rw-r--r--1.2 KiB ViewLogBlameView rawPermalink 266053a6e7 feat(basin): light theme, highlighting, latex, avatar crop, rate limits 3 days ago
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
{{define "content"}}
{{$p := .Data.Page}}
{{template "crumbs" .Data}}
<table class="tree">
{{range .Data.Entries}}{{$c := index $.Data.Last .Name}}
<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>
<td class="last">{{if $c.Hash}}<a href="/{{$p.Repo.Path}}/commit/{{$c.Hash}}">{{$c.Subject}}</a>{{end}}</td>
<td class="when">{{if $c.Hash}}{{ago $c.Time}}{{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}}