~gitpocket/gitpocket

gitpocket/templates/search.html -rw-r--r--3.7 KiB ViewLogBlameView rawPermalink fd16cceea0 feat(org): let members edit org profile, picture and membership 2 hours ago
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{{define "content"}}
{{$d := .Data}}
<div class="searchwrap">
<form class="bigsearch" method="get" action="/search"><input name="q" value="{{$d.Query}}" placeholder="Search repositories, people, languages" autofocus><input type="hidden" name="type" value="{{$d.Type}}"><button class="btn primary">Search</button></form>
<div class="searchpage">
<aside class="facets">
<section class="facetbox">
<h4>Filter by</h4>
<nav class="facetlist">
<a href="?q={{$d.Query}}&type=repos"{{if eq $d.Type "repos"}} class="active"{{end}}><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M3 2.5h8.5a1 1 0 0 1 1 1v9.5H4.5A1.5 1.5 0 0 1 3 11.5z"/><path d="M3 11.5A1.5 1.5 0 0 1 4.5 10h8"/></svg><span class="fname">Repositories</span><span class="count">{{len $d.Repos}}</span></a>
<a href="?q={{$d.Query}}&type=users"{{if eq $d.Type "users"}} class="active"{{end}}><svg viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="5.5" r="2.7"/><path d="M2.8 13.5c.6-2.6 2.7-4 5.2-4s4.6 1.4 5.2 4"/></svg><span class="fname">Users</span><span class="count">{{len $d.Users}}</span></a>
</nav>
</section>
{{if $d.Languages}}<section class="facetbox">
<h4>Languages</h4>
<nav class="facetlist">{{range $d.Languages}}<a href="?q={{.Query}}&type={{$d.Type}}"{{if eq .Name $d.Lang}} class="active"{{end}}><i class="dot" style="background:{{.Colour}}"></i><span class="fname">{{.Name}}</span><span class="count">{{.Count}}</span></a>{{end}}</nav>
{{with $d.Lang}}<a class="clearfacet" href="?q={{$d.Base}}&type={{$d.Type}}">× Clear {{.}}</a>{{end}}
</section>{{end}}
</aside>
<div class="results">
{{if eq $d.Type "repos"}}
<div class="resulthead"><h3 class="plain">{{len $d.Repos}} repositor{{if eq (len $d.Repos) 1}}y{{else}}ies{{end}}{{with $d.Query}} matching <q>{{.}}</q>{{end}}</h3>
<nav class="sorts"><a href="?q={{$d.Query}}&type=repos{{with $d.Lang}}&lang={{.}}{{end}}"{{if not $d.Sort}} class="active"{{end}}>Best match</a><a href="?q={{$d.Query}}&type=repos&sort=updated{{with $d.Lang}}&lang={{.}}{{end}}"{{if eq $d.Sort "updated"}} class="active"{{end}}>Recently updated</a><a href="?q={{$d.Query}}&type=repos&sort=stars{{with $d.Lang}}&lang={{.}}{{end}}"{{if eq $d.Sort "stars"}} class="active"{{end}}>Most stars</a></nav></div>
{{range $d.Repos}}<div class="hit"><h4><a class="owner" href="/~{{.Owner.Name}}">~{{.Owner.Name}}</a>/<a href="/{{.Path}}">{{.Name}}</a></h4>{{with .Description}}<p>{{.}}</p>{{end}}{{if .Tags}}<p class="tags">{{range .Tags}}<a href="/search?q=tag:{{.}}">#{{.}}</a>{{end}}</p>{{end}}<p class="meta">{{with .Language}}<span><i class="dot" style="background:{{.Colour}}"></i>{{.Name}}</span>{{end}}{{if .Stars}}<span>☆ {{.Stars}}</span>{{end}}<span>Updated {{ago .Updated}}</span></p></div>{{else}}<p class="info">No repositories match. Try a shorter query or clear the language filter.</p>{{end}}
{{else}}
<div class="resulthead"><h3 class="plain">{{len $d.Users}} user{{if ne (len $d.Users) 1}}s{{end}}{{with $d.Query}} matching <q>{{.}}</q>{{end}}{{with $d.Lang}} writing {{.}}{{end}}</h3></div>
{{range $d.Users}}<div class="hit user{{if .Org}} org{{end}}"><a href="/~{{.Name}}" class="hitavatar">{{if .Profile.Avatar}}<img src="/~{{.Name}}/avatar?v={{.Profile.Avatar}}" alt="">{{else}}<span>{{slice .Name 0 1}}</span>{{end}}</a><div><h4><a href="/~{{.Name}}">{{with .Profile.Display}}{{.}}{{else}}~{{.Name}}{{end}}</a> <span class="muted">~{{.Name}}</span></h4>{{with .Profile.Bio}}<p class="bio">{{.}}</p>{{end}}<p class="meta">{{with .Profile.Location}}<span>{{.}}</span>{{end}}<span>{{.Repos}} public repositor{{if eq .Repos 1}}y{{else}}ies{{end}}</span><span>{{if .Org}}Since{{else}}Joined{{end}} {{.Created.Format "January 2006"}}</span></p></div></div>{{else}}<p class="info">No users match.</p>{{end}}
{{end}}
</div>
</div>
</div>
{{end}}