| 1 | {{ define "nav" -}} |
| 2 | <header class="shithub-nav{{ if .Repo }} has-context{{ else if .Org }} has-context{{ end }}" role="banner"> |
| 3 | <div class="shithub-nav-global"> |
| 4 | <div class="shithub-nav-context"> |
| 5 | <button type="button" class="shithub-nav-menu" aria-label="Open navigation menu" aria-controls="shithub-global-navigation" aria-expanded="false" data-offcanvas-open>{{ octicon "three-bars" }}</button> |
| 6 | <a href="/" class="shithub-nav-brand" aria-label="shithub home"> |
| 7 | {{ octicon "shithub" }} |
| 8 | <span class="shithub-nav-brand-word">shithub</span> |
| 9 | </a> |
| 10 | {{ if .Repo }} |
| 11 | <nav class="shithub-nav-breadcrumb" aria-label="Repository"> |
| 12 | <a href="/{{ .Owner }}">{{ .Owner }}</a> |
| 13 | <span aria-hidden="true">/</span> |
| 14 | <a href="/{{ .Owner }}/{{ .Repo.Name }}" class="is-strong">{{ .Repo.Name }}</a> |
| 15 | </nav> |
| 16 | {{ else if .Org }} |
| 17 | <nav class="shithub-nav-breadcrumb" aria-label="Organization"> |
| 18 | <a href="/{{ .Org.Slug }}" class="is-strong">{{ .Org.Slug }}</a> |
| 19 | </nav> |
| 20 | {{ end }} |
| 21 | </div> |
| 22 | <form action="/search" method="get" class="shithub-nav-search" role="search" data-search-root> |
| 23 | <span class="shithub-nav-search-icon">{{ octicon "search" }}</span> |
| 24 | <input type="text" name="q"{{ with .GlobalSearchQuery }} value="{{ . }}"{{ end }} placeholder="Type / to search" aria-label="Search" autocomplete="off" aria-haspopup="listbox" aria-expanded="false" aria-controls="global-search-suggestions" data-search-input> |
| 25 | <span class="shithub-nav-search-key" aria-hidden="true">/</span> |
| 26 | <input type="hidden" name="type" value="repositories"> |
| 27 | <div id="global-search-suggestions" class="shithub-nav-search-popover" data-search-results hidden></div> |
| 28 | </form> |
| 29 | {{ if and (not .Repo) (not .Org) }} |
| 30 | <nav class="shithub-nav-links" aria-label="Primary"> |
| 31 | <a href="/explore">Explore</a> |
| 32 | <a href="/about">About</a> |
| 33 | </nav> |
| 34 | {{ end }} |
| 35 | <div class="shithub-nav-actions"> |
| 36 | {{- if .Viewer.ID }} |
| 37 | <a href="/settings/organizations" class="shithub-button shithub-button-ghost shithub-button-icon shithub-nav-icon" title="Your organizations" aria-label="Your organizations">{{ octicon "people" }}</a> |
| 38 | <span class="shithub-nav-actions-divider" aria-hidden="true"></span> |
| 39 | <details class="shithub-nav-action-menu shithub-create-menu"> |
| 40 | <summary class="shithub-button shithub-button-ghost shithub-nav-create" aria-label="Create new" title="Create new"> |
| 41 | {{ octicon "plus" }} {{ octicon "triangle-down" }} |
| 42 | </summary> |
| 43 | <div class="shithub-nav-action-panel" role="menu"> |
| 44 | <a role="menuitem" class="shithub-nav-action-item" href="/issues/new">{{ octicon "issue-opened" }} <span>New issue</span></a> |
| 45 | <a role="menuitem" class="shithub-nav-action-item" href="/new">{{ octicon "repo" }} <span>New repository</span></a> |
| 46 | <span role="menuitem" aria-disabled="true" class="shithub-nav-action-item is-disabled">{{ octicon "upload" }} <span>Import repository</span></span> |
| 47 | <div class="shithub-nav-action-divider" role="separator"></div> |
| 48 | <a role="menuitem" class="shithub-nav-action-item" href="/organizations/plan">{{ octicon "organization" }} <span>New organization</span></a> |
| 49 | <span role="menuitem" aria-disabled="true" class="shithub-nav-action-item is-disabled">{{ octicon "table" }} <span>New project</span></span> |
| 50 | </div> |
| 51 | </details> |
| 52 | <a href="/issues/assigned" class="shithub-button shithub-button-ghost shithub-button-icon shithub-nav-icon" title="All issues" aria-label="All issues">{{ octicon "issue-opened" }}</a> |
| 53 | <a href="/pulls" class="shithub-button shithub-button-ghost shithub-button-icon shithub-nav-icon" title="All pull requests" aria-label="All pull requests">{{ octicon "git-pull-request" }}</a> |
| 54 | <a href="/repos" class="shithub-button shithub-button-ghost shithub-button-icon shithub-nav-icon" title="All repositories" aria-label="All repositories">{{ octicon "repo" }}</a> |
| 55 | <a href="/notifications?filter=unread" class="shithub-button shithub-button-ghost shithub-button-icon shithub-nav-icon" title="Notifications" aria-label="Notifications">{{ octicon "bell" }}</a> |
| 56 | <details class="shithub-user-menu"> |
| 57 | <summary aria-label="User menu" aria-haspopup="menu"> |
| 58 | <img src="/avatars/{{ .Viewer.Username }}" alt="" class="shithub-user-menu-avatar" width="24" height="24"> |
| 59 | </summary> |
| 60 | <div class="shithub-user-menu-panel" role="menu"> |
| 61 | <div class="shithub-user-menu-account"> |
| 62 | <img src="/avatars/{{ .Viewer.Username }}" alt="" class="shithub-user-menu-account-avatar" width="40" height="40"> |
| 63 | <div class="shithub-user-menu-account-copy"> |
| 64 | <strong>{{ .Viewer.Username }}</strong> |
| 65 | <span>@{{ .Viewer.Username }}</span> |
| 66 | </div> |
| 67 | </div> |
| 68 | <button type="button" role="menuitem" class="shithub-user-menu-item" disabled> |
| 69 | {{ octicon "smiley" }} <span>Set status</span> |
| 70 | </button> |
| 71 | <div class="shithub-user-menu-divider" role="separator"></div> |
| 72 | <a role="menuitem" class="shithub-user-menu-item" href="/{{ .Viewer.Username }}">{{ octicon "person" }} <span>Profile</span></a> |
| 73 | <a role="menuitem" class="shithub-user-menu-item" href="/{{ .Viewer.Username }}?tab=repositories">{{ octicon "repo" }} <span>Repositories</span></a> |
| 74 | <a role="menuitem" class="shithub-user-menu-item" href="/{{ .Viewer.Username }}?tab=stars">{{ octicon "star" }} <span>Stars</span></a> |
| 75 | <button type="button" role="menuitem" class="shithub-user-menu-item" disabled> |
| 76 | {{ octicon "code-square" }} <span>Gists</span> |
| 77 | </button> |
| 78 | <a role="menuitem" class="shithub-user-menu-item" href="/settings/organizations">{{ octicon "organization" }} <span>Organizations</span></a> |
| 79 | <button type="button" role="menuitem" class="shithub-user-menu-item" disabled> |
| 80 | {{ octicon "globe" }} <span>Enterprises</span> |
| 81 | </button> |
| 82 | <button type="button" role="menuitem" class="shithub-user-menu-item" disabled> |
| 83 | {{ octicon "heart" }} <span>Sponsors</span> |
| 84 | </button> |
| 85 | <div class="shithub-user-menu-divider" role="separator"></div> |
| 86 | <a role="menuitem" class="shithub-user-menu-item" href="/settings/profile">{{ octicon "gear" }} <span>Settings</span></a> |
| 87 | <button type="button" role="menuitem" class="shithub-user-menu-item" disabled> |
| 88 | {{ octicon "beaker" }} <span>Feature preview</span> |
| 89 | </button> |
| 90 | <a role="menuitem" class="shithub-user-menu-item" href="/settings/appearance">{{ octicon "paintbrush" }} <span>Appearance</span></a> |
| 91 | <button type="button" role="menuitem" class="shithub-user-menu-item" disabled> |
| 92 | {{ octicon "accessibility" }} <span>Accessibility</span> |
| 93 | </button> |
| 94 | <button type="button" role="menuitem" class="shithub-user-menu-item" disabled> |
| 95 | {{ octicon "briefcase" }} <span>Try Enterprise</span><span class="shithub-user-menu-badge">Free</span> |
| 96 | </button> |
| 97 | <div class="shithub-user-menu-divider" role="separator"></div> |
| 98 | <form method="POST" action="/logout" class="shithub-user-menu-signout"> |
| 99 | <input type="hidden" name="csrf_token" value="{{ .CSRFToken }}"> |
| 100 | <button type="submit" role="menuitem" class="shithub-user-menu-item">{{ octicon "sign-out" }} <span>Sign out</span></button> |
| 101 | </form> |
| 102 | </div> |
| 103 | </details> |
| 104 | {{- else }} |
| 105 | <a href="/login" class="shithub-button shithub-button-ghost">Sign in</a> |
| 106 | <a href="/signup" class="shithub-button shithub-button-primary">Sign up</a> |
| 107 | {{- end }} |
| 108 | </div> |
| 109 | </div> |
| 110 | {{ if .Repo }} |
| 111 | <div class="shithub-nav-local"> |
| 112 | {{ template "repo-subnav" . }} |
| 113 | </div> |
| 114 | {{ else if .Org }} |
| 115 | <div class="shithub-nav-local"> |
| 116 | {{ template "org-subnav" . }} |
| 117 | </div> |
| 118 | {{ end }} |
| 119 | </header> |
| 120 | {{ template "nav-offcanvas" . }} |
| 121 | {{- end }} |