~gitpocket/gitpocket

1
7c7724c4769647a77f129d7b6bc2e84057cb2cec
mainfeed-discovery
gitpocket/templates/search.html -rw-r--r--976 bytes ViewLogBlameView rawPermalink 9791329566 feat(basin): search file contents with git grep 18 hours ago
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
{{define "content"}}
{{$p := .Data.Page}}
<form method="get" action="/{{$p.Repo.Path}}/search" class="search">
<input type="hidden" name="ref" value="{{$p.Ref}}">
<input name="q" value="{{.Data.Query}}" placeholder="Search file contents" autofocus>
<div class="sort"><span class="muted">Case insensitive, fixed string, at <a href="/{{$p.Repo.Path}}/tree/{{$p.Ref}}/">{{$p.Ref}}</a></span><button class="btn">Search ▸</button></div>
</form>
{{if .Data.Query}}
<p class="muted">{{.Data.Count}} matches{{if .Data.Truncated}}, showing the first 500{{end}}</p>
{{range .Data.Groups}}
<div class="hits">
<h4><a href="/{{$p.Repo.Path}}/tree/{{$p.Ref}}/{{.Path}}">{{.Path}}</a></h4>
<table class="blob">{{range .Matches}}<tr><td class="n"><a href="/{{$p.Repo.Path}}/tree/{{$p.Ref}}/{{.Path}}#L{{.Line}}">{{.Line}}</a></td><td class="l">{{mark .Text $.Data.Query}}</td></tr>{{end}}</table>
</div>
{{end}}
{{if not .Data.Groups}}<p class="info">No matches.</p>{{end}}
{{end}}
{{end}}