internal/web/templates/blob.html
31 lines · 2359 bytes
1{{define "width"}}wide{{end}}
2{{define "title"}}{{.Path}} · {{.Repo.OwnerName}}/{{.Repo.Name}}{{end}}
3{{define "content"}}
4<h1 class="vh">{{.Path}}</h1>
5<div class="blobgrid">
6{{template "filenav" .Nav}}
7<div class="blobmain">
8<div class="pathbar">
9 {{template "refmenu" .}}
10 <span class="crumbs"><a href="/{{.Repo.OwnerName}}/{{.Repo.Name}}">{{.Repo.Name}}</a>/{{range .Crumbs}}<a href="{{.URL}}">{{.Name}}</a>/{{end}}<strong>{{.Base}}</strong></span>
11 <span class="spacer"></span>
12 <div class="btngroup">
13 {{if .Renderable}}{{if .Rendered}}<a class="button btn" aria-current="page" href="?"><strong>rendered</strong></a><a class="button btn" href="?view=source">source</a>{{else}}<a class="button btn" href="?">rendered</a><a class="button btn" aria-current="page" href="?view=source"><strong>source</strong></a>{{end}}{{end}}
14 <a class="button btn" href="/{{.Repo.OwnerName}}/{{.Repo.Name}}/log/{{.Ref}}?path={{.Path}}">history</a>
15 {{if not .Binary}}<a class="button btn" href="/{{.Repo.OwnerName}}/{{.Repo.Name}}/blame/{{.Ref}}/{{.Path}}">blame</a>{{end}}
16 <a class="button btn" href="/{{.Repo.OwnerName}}/{{.Repo.Name}}/raw/{{.Ref}}/{{.Path}}">raw</a>
17 {{if .Viewer}}<a class="button" href="/{{.Repo.OwnerName}}/{{.Repo.Name}}/edit/{{.Ref}}/{{.Path}}">edit</a>{{end}}
18 </div>
19</div>
20<p class="filefacts">{{if .Lines}}{{.Lines}} lines · {{end}}{{.Size}} bytes{{if .Exec}} · executable{{end}}{{if .Symlink}} · symlink{{end}}</p>
21{{if .Symbols}}<details class="symlist"><summary>{{len .Symbols}} symbol{{if ne (len .Symbols) 1}}s{{end}} in this file</summary>
22<ul>{{range .Symbols}}<li><a href="{{if $.Rendered}}?view=source{{end}}#L{{.Line}}"><code>{{.Name}}</code></a> <span class="meta">{{.Kind}}, line {{.Line}}</span></li>
23{{end}}</ul>
24</details>{{end}}
25{{if .Image}}<div class="blobimage"><a href="/{{.Repo.OwnerName}}/{{.Repo.Name}}/raw/{{.Ref}}/{{.Path}}"><img src="/{{.Repo.OwnerName}}/{{.Repo.Name}}/raw/{{.Ref}}/{{.Path}}" alt="{{.Base}}"></a><p class="meta">{{.Size}} bytes</p></div>
26{{else if .Binary}}<p class="empty-note">binary file, {{.Size}} bytes — <a href="/{{.Repo.OwnerName}}/{{.Repo.Name}}/raw/{{.Ref}}/{{.Path}}">download</a></p>
27{{else if .Rendered}}<section class="readme"><div class="rendered">{{.RenderedHTML}}</div></section>
28{{else}}<div class="code">{{.CodeHTML}}</div>{{end}}
29</div>
30</div>
31{{end}}