~gitpocket/gitpocket

1
c534f4e9e4f64f4e82a3b5ff40c84783059ea85d
mainfeed-discovery
gitpocket/templates/blob.html -rw-r--r--984 bytes ViewLogBlameView rawPermalink 7093e5fd3c 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
{{define "content"}}
{{$p := .Data.Page}}
{{template "crumbs" .Data}}
<p class="muted">{{size .Data.Size}} · <a href="/{{$p.Repo.Path}}/raw/{{$p.Ref}}/{{.Data.Path}}">raw</a> · <a href="/{{$p.Repo.Path}}/log/{{$p.Ref}}?path={{.Data.Path}}">history</a></p>
{{if .Data.Binary}}<p class="muted">binary file, see raw.</p>
{{else if .Data.Large}}<p class="muted">file too large to display, see raw.</p>
{{else}}
<table class="blob">{{range $i, $l := lines .Data.Content}}<tr><td class="n" id="L{{inc $i}}"><a href="#L{{inc $i}}">{{inc $i}}</a></td><td class="l">{{$l}}</td></tr>{{end}}</table>
{{end}}
{{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}}