internal/web/templates/search.html

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

26 lines · 1193 bytes

 1{{define "width"}}wide{{end}}
 2{{define "title"}}search · {{.Repo.OwnerName}}/{{.Repo.Name}}{{end}}
 3{{define "content"}}
 4<div class="pagehead">
 5  <h1>Search code</h1>
 6  <span class="grow"></span>
 7  <a class="button btn" href="/{{.Repo.OwnerName}}/{{.Repo.Name}}/symbols">Symbols</a>
 8</div>
 9<form method="get" action="/{{.Repo.OwnerName}}/{{.Repo.Name}}/search" class="searchform">
10  <input type="search" name="q" aria-label="Search file contents" value="{{.Query}}" placeholder="search file contents on {{.Ref}}">
11  <button type="submit" class="btn">Search</button>
12</form>
13{{if .QueryErr}}<p class="error" role="alert">{{.QueryErr}}</p>
14{{else if .Query}}
15{{if .Matches}}
16<p class="meta">{{len .Matches}} match{{if ne (len .Matches) 1}}es{{end}}{{if .Capped}} (capped — refine the query){{end}} on <code>{{.Ref}}</code></p>
17<ul class="matchlist">
18{{range .Matches}}<li>
19  <a class="matchpath" href="/{{$.Repo.OwnerName}}/{{$.Repo.Name}}/blob/{{$.Ref}}/{{.Path}}#L{{.Line}}">{{.Path}}:{{.Line}}</a>
20  <pre class="matchline" tabindex="0">{{.TextHTML}}</pre>
21</li>
22{{end}}
23</ul>
24{{else}}<p class="empty-note">no matches for “{{.Query}}” on <code>{{.Ref}}</code></p>{{end}}
25{{end}}
26{{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