internal/web/templates/blob.html

6521399c1c78577eb00f1bcf8947c0900b9cb62e
gitbay/internal/web/templates/blob.html

33 lines · 3125 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" data-commit="{{.Commit}}" data-permalink="/{{.Repo.OwnerName}}/{{.Repo.Name}}/blob/{{.Commit}}/{{.Path}}">
 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    {{if and (not .Binary) (not .Image)}}<button type="button" class="btn" data-copy-url="/{{.Repo.OwnerName}}/{{.Repo.Name}}/raw/{{.Ref}}/{{.Path}}">copy</button>{{end}}
17    <a class="button btn" href="/{{.Repo.OwnerName}}/{{.Repo.Name}}/raw/{{.Ref}}/{{.Path}}">raw</a>
18    {{if .Viewer}}<a class="button" href="/{{.Repo.OwnerName}}/{{.Repo.Name}}/edit/{{.Ref}}/{{.Path}}">edit</a>{{end}}
19  </div>
20</div>
21{{with .Tip}}{{if .SHA}}<div class="blobtip"><span class="who">{{template "authorname" dict "Name" .Author "User" .User "Email" .Email}}</span> <a class="subject" href="/{{$.Repo.OwnerName}}/{{$.Repo.Name}}/commit/{{.SHA}}">{{.Subject}}</a><span class="spacer"></span><a class="sha" href="/{{$.Repo.OwnerName}}/{{$.Repo.Name}}/commit/{{.SHA}}"><code>{{short .SHA}}</code></a> <span class="age"{{if not .When.IsZero}} title="{{whenT .When}}"{{end}}>{{ago .When}}</span></div>{{end}}{{end}}
22<p class="filefacts">{{if .Lines}}{{.Lines}} lines · {{end}}{{.Size}} bytes{{if .Exec}} · executable{{end}}{{if .Symlink}} · symlink{{end}}</p>
23{{if .Symbols}}<details class="symlist"><summary>{{len .Symbols}} symbol{{if ne (len .Symbols) 1}}s{{end}} in this file</summary>
24<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>
25{{end}}</ul>
26</details>{{end}}
27{{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>
28{{else if .Binary}}<p class="empty-note">binary file, {{.Size}} bytes — <a href="/{{.Repo.OwnerName}}/{{.Repo.Name}}/raw/{{.Ref}}/{{.Path}}">download</a></p>
29{{else if .Rendered}}<section class="readme"><div class="rendered">{{.RenderedHTML}}</div></section>
30{{else}}<div class="code">{{.CodeHTML}}</div>{{end}}
31</div>
32</div>
33{{end}}
Keyboard shortcuts

Global

⌘K
Command palette & jump
/
Focus search
?
Show this help
g d
Dashboard
g e
Explore repositories
g n
Notifications

Repository & editor

t
Find file in repository
y
Copy immutable SHA permalink
g c
Code tab
g i
Issues tab
g m
Merge requests tab
g b
Builds tab
⌘↵
Submit active form