| 1 | {{ define "page" -}} |
| 2 | <div class="shithub-quick-dropdown" role="listbox" aria-label="Search suggestions"> |
| 3 | {{ if or .Repos .Issues .Users }} |
| 4 | {{ if .Repos }} |
| 5 | <section class="shithub-quick-section" aria-labelledby="quick-repositories-heading"> |
| 6 | <h3 id="quick-repositories-heading">Repositories</h3> |
| 7 | <ul> |
| 8 | {{ range .Repos }} |
| 9 | <li> |
| 10 | <a href="/{{ .OwnerUsername }}/{{ .Name }}" role="option"> |
| 11 | <span class="shithub-quick-leading">{{ octicon "repo" }}</span> |
| 12 | <span class="shithub-quick-title">{{ .OwnerUsername }}/{{ .Name }}</span> |
| 13 | {{ if eq .Visibility "private" }}<span class="shithub-pill shithub-pill-private">Private</span>{{ end }} |
| 14 | </a> |
| 15 | </li> |
| 16 | {{ end }} |
| 17 | </ul> |
| 18 | </section> |
| 19 | {{ end }} |
| 20 | {{ if .Issues }} |
| 21 | <section class="shithub-quick-section" aria-labelledby="quick-issues-heading"> |
| 22 | <h3 id="quick-issues-heading">Issues and pull requests</h3> |
| 23 | <ul> |
| 24 | {{ range .Issues }} |
| 25 | <li> |
| 26 | <a href="/{{ .OwnerUsername }}/{{ .RepoName }}/{{ if eq .Kind "pr" }}pulls{{ else }}issues{{ end }}/{{ .Number }}" role="option"> |
| 27 | <span class="shithub-quick-leading">{{ if eq .Kind "pr" }}{{ octicon "git-pull-request" }}{{ else }}{{ octicon "issue-opened" }}{{ end }}</span> |
| 28 | <span class="shithub-quick-title">{{ .Title }}</span> |
| 29 | <span class="shithub-quick-context">{{ .OwnerUsername }}/{{ .RepoName }}#{{ .Number }}</span> |
| 30 | </a> |
| 31 | </li> |
| 32 | {{ end }} |
| 33 | </ul> |
| 34 | </section> |
| 35 | {{ end }} |
| 36 | {{ if .Users }} |
| 37 | <section class="shithub-quick-section" aria-labelledby="quick-users-heading"> |
| 38 | <h3 id="quick-users-heading">Users</h3> |
| 39 | <ul> |
| 40 | {{ range .Users }} |
| 41 | <li> |
| 42 | <a href="/{{ .Username }}" role="option"> |
| 43 | <img src="/avatars/{{ .Username }}" alt="" width="20" height="20" class="shithub-quick-avatar"> |
| 44 | <span class="shithub-quick-title">{{ if .DisplayName }}{{ .DisplayName }}{{ else }}{{ .Username }}{{ end }}</span> |
| 45 | <span class="shithub-quick-context">@{{ .Username }}</span> |
| 46 | </a> |
| 47 | </li> |
| 48 | {{ end }} |
| 49 | </ul> |
| 50 | </section> |
| 51 | {{ end }} |
| 52 | {{ else }} |
| 53 | <p class="shithub-quick-empty">No results found.</p> |
| 54 | {{ end }} |
| 55 | <div class="shithub-quick-footer"> |
| 56 | <a href="{{ .SearchHref }}">See all results for <strong>{{ .Query }}</strong></a> |
| 57 | </div> |
| 58 | </div> |
| 59 | {{- end }} |