| 1 | {{ define "nav-offcanvas" -}} |
| 2 | <div class="shithub-offcanvas" data-offcanvas hidden> |
| 3 | <button type="button" class="shithub-offcanvas-backdrop" aria-label="Close navigation menu" data-offcanvas-close></button> |
| 4 | <aside class="shithub-offcanvas-panel" id="shithub-global-navigation" role="dialog" aria-modal="true" aria-label="Global navigation" tabindex="-1"> |
| 5 | <div class="shithub-offcanvas-head"> |
| 6 | <a href="/" class="shithub-offcanvas-mark" aria-label="shithub home">{{ octicon "shithub" }}</a> |
| 7 | <button type="button" class="shithub-offcanvas-close" aria-label="Close navigation menu" data-offcanvas-close>{{ octicon "x" }}</button> |
| 8 | </div> |
| 9 | |
| 10 | <nav class="shithub-offcanvas-nav" aria-label="Global navigation"> |
| 11 | {{ if .Viewer.ID }} |
| 12 | <a href="/explore" class="shithub-offcanvas-link">{{ octicon "home" }} <span>Home</span></a> |
| 13 | {{ else }} |
| 14 | <a href="/" class="shithub-offcanvas-link">{{ octicon "home" }} <span>Home</span></a> |
| 15 | {{ end }} |
| 16 | <a href="/search?type=issues" class="shithub-offcanvas-link">{{ octicon "issue-opened" }} <span>All issues</span></a> |
| 17 | <a href="/search?type=pullrequests" class="shithub-offcanvas-link">{{ octicon "git-pull-request" }} <span>All pull requests</span></a> |
| 18 | <a href="/search?type=repositories" class="shithub-offcanvas-link">{{ octicon "repo" }} <span>All repositories</span></a> |
| 19 | <a href="/projects" class="shithub-offcanvas-link">{{ octicon "table" }} <span>Projects</span></a> |
| 20 | <a href="/discussions" class="shithub-offcanvas-link">{{ octicon "comment-discussion" }} <span>Discussions</span></a> |
| 21 | <a href="/codespaces" class="shithub-offcanvas-link">{{ octicon "code-square" }} <span>Codespaces</span></a> |
| 22 | </nav> |
| 23 | |
| 24 | <nav class="shithub-offcanvas-nav shithub-offcanvas-nav-secondary" aria-label="Explore"> |
| 25 | <a href="/explore" class="shithub-offcanvas-link">{{ octicon "rocket" }} <span>Explore</span></a> |
| 26 | <a href="/marketplace" class="shithub-offcanvas-link">{{ octicon "package" }} <span>Marketplace</span></a> |
| 27 | </nav> |
| 28 | |
| 29 | {{ if or .Repo .Org .Viewer.ID }} |
| 30 | <section class="shithub-offcanvas-repos" aria-labelledby="shithub-offcanvas-repos-heading"> |
| 31 | <div class="shithub-offcanvas-section-head"> |
| 32 | <h2 id="shithub-offcanvas-repos-heading">Top repositories</h2> |
| 33 | <a href="/search?type=repositories" aria-label="Search repositories">{{ octicon "search" }}</a> |
| 34 | </div> |
| 35 | <div class="shithub-offcanvas-repo-list"> |
| 36 | {{ if .Repo }} |
| 37 | <a href="/{{ .Owner }}/{{ .Repo.Name }}" class="shithub-offcanvas-repo-item"> |
| 38 | <img src="/avatars/{{ .Owner }}" alt="" width="20" height="20"> |
| 39 | <span>{{ .Owner }}/{{ .Repo.Name }}</span> |
| 40 | </a> |
| 41 | {{ else if .Org }} |
| 42 | <a href="/orgs/{{ .Org.Slug }}/repositories" class="shithub-offcanvas-repo-item"> |
| 43 | <img src="/avatars/{{ .Org.Slug }}" alt="" width="20" height="20"> |
| 44 | <span>{{ .Org.Slug }} repositories</span> |
| 45 | </a> |
| 46 | {{ else if .Viewer.ID }} |
| 47 | <a href="/{{ .Viewer.Username }}?tab=repositories" class="shithub-offcanvas-repo-item"> |
| 48 | <img src="/avatars/{{ .Viewer.Username }}" alt="" width="20" height="20"> |
| 49 | <span>{{ .Viewer.Username }} repositories</span> |
| 50 | </a> |
| 51 | {{ end }} |
| 52 | </div> |
| 53 | {{ if .Repo }} |
| 54 | <a href="/{{ .Owner }}?tab=repositories" class="shithub-offcanvas-show-more">Show more</a> |
| 55 | {{ else if .Org }} |
| 56 | <a href="/orgs/{{ .Org.Slug }}/repositories" class="shithub-offcanvas-show-more">Show more</a> |
| 57 | {{ else if .Viewer.ID }} |
| 58 | <a href="/{{ .Viewer.Username }}?tab=repositories" class="shithub-offcanvas-show-more">Show more</a> |
| 59 | {{ end }} |
| 60 | </section> |
| 61 | {{ end }} |
| 62 | |
| 63 | {{ if .Viewer.ID }} |
| 64 | <div class="shithub-offcanvas-notice" data-offcanvas-notice> |
| 65 | <span>{{ octicon "issue-opened" }}</span> |
| 66 | <p>Teams have moved to <a href="/settings/organizations">settings</a></p> |
| 67 | <button type="button" aria-label="Dismiss" data-offcanvas-notice-close>{{ octicon "x" }}</button> |
| 68 | </div> |
| 69 | {{ end }} |
| 70 | </aside> |
| 71 | </div> |
| 72 | {{- end }} |