internal/web/templates/globalsearch.html

v1.27.0
gitbay/internal/web/templates/globalsearch.html history · blame · raw

36 lines · 2054 bytes

 1{{define "width"}}wide{{end}}
 2{{define "title"}}search · {{.Site}}{{end}}
 3{{define "content"}}
 4<div class="listhead">
 5  <h1>Search</h1>
 6  <nav class="filters">
 7    <a {{if eq .Kind ""}}class="active" aria-current="page" {{end}}href="?q={{.Query}}">everything</a>
 8    <a {{if eq .Kind "repo"}}class="active" aria-current="page" {{end}}href="?q={{.Query}}&amp;kind=repo">repositories</a>
 9    <a {{if eq .Kind "issue"}}class="active" aria-current="page" {{end}}href="?q={{.Query}}&amp;kind=issue">issues</a>
10    <a {{if eq .Kind "mr"}}class="active" aria-current="page" {{end}}href="?q={{.Query}}&amp;kind=mr">merge requests</a>
11  </nav>
12  {{if and .Query (not .QueryErr)}}<p class="meta">{{len .Results}} {{if eq (len .Results) 1}}result{{else}}results{{end}} for <q>{{.Query}}</q>{{if .Kind}} in {{.Kind}}{{end}}</p>{{end}}
13</div>
14<form method="get" action="/search" class="searchform">
15  <input type="search" name="q" aria-label="Search" value="{{.Query}}" placeholder="repository names and topics, issue and merge request text" autofocus>
16  {{if .Kind}}<input type="hidden" name="kind" value="{{.Kind}}">{{end}}
17  <button type="submit" class="btn">Search</button>
18</form>
19{{if .QueryErr}}<p class="error" role="alert">{{.QueryErr}}</p>
20{{else if .Query}}
21{{if .Results}}
22<ul class="issuelist">
23{{range .Results}}<li>
24  <div class="issuemain">
25    <p class="title"><a href="{{.Href}}">{{if .Number}}{{.Title}}{{else}}{{.Repo}}{{end}}</a></p>
26    <p class="meta">{{if .Number}}<a href="/{{.Repo}}">{{.Repo}}</a>{{.Marker}}{{.Number}} opened by <a href="/{{.Author}}">{{.Author}}</a>{{else if .Title}}{{.Title}}{{else}}repository{{end}}</p>
27  </div>
28  {{if .State}}<span class="chip chip-{{.State}}">{{.State}}</span>{{end}}
29</li>
30{{end}}
31</ul>
32{{else}}<p class="empty-note">no matches for “{{.Query}}”</p>{{end}}
33{{else}}
34<p class="empty-note">Repository names, descriptions and topics, and the title and body of every issue and merge request you can read. File contents are searched per repository, from a repository's Code tab.</p>
35{{end}}
36{{end}}