HTML · 5883 bytes Raw Blame History
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">{{ 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 <nav class="shithub-nav-links" aria-label="Primary">
30 <a href="/explore">Explore</a>
31 <a href="/about">About</a>
32 </nav>
33 <div class="shithub-nav-actions">
34 {{- if .Viewer.ID }}
35 <a href="/notifications" class="shithub-button shithub-button-ghost" title="Notifications" aria-label="Notifications">{{ octicon "bell" }}</a>
36 <a href="/new" class="shithub-button shithub-button-ghost shithub-nav-new" title="New repository">{{ octicon "plus" }} <span class="shithub-nav-new-label">New</span></a>
37 <details class="shithub-user-menu">
38 <summary aria-label="User menu" aria-haspopup="menu">
39 <img src="/avatars/{{ .Viewer.Username }}" alt="" class="shithub-user-menu-avatar" width="24" height="24">
40 </summary>
41 <div class="shithub-user-menu-panel" role="menu">
42 <div class="shithub-user-menu-account">
43 <img src="/avatars/{{ .Viewer.Username }}" alt="" class="shithub-user-menu-account-avatar" width="40" height="40">
44 <div class="shithub-user-menu-account-copy">
45 <strong>{{ .Viewer.Username }}</strong>
46 <span>@{{ .Viewer.Username }}</span>
47 </div>
48 </div>
49 <button type="button" role="menuitem" class="shithub-user-menu-item" disabled>
50 {{ octicon "smiley" }} <span>Set status</span>
51 </button>
52 <div class="shithub-user-menu-divider" role="separator"></div>
53 <a role="menuitem" class="shithub-user-menu-item" href="/{{ .Viewer.Username }}">{{ octicon "person" }} <span>Profile</span></a>
54 <a role="menuitem" class="shithub-user-menu-item" href="/{{ .Viewer.Username }}?tab=repositories">{{ octicon "repo" }} <span>Repositories</span></a>
55 <a role="menuitem" class="shithub-user-menu-item" href="/{{ .Viewer.Username }}?tab=stars">{{ octicon "star" }} <span>Stars</span></a>
56 <button type="button" role="menuitem" class="shithub-user-menu-item" disabled>
57 {{ octicon "code-square" }} <span>Gists</span>
58 </button>
59 <a role="menuitem" class="shithub-user-menu-item" href="/settings/organizations">{{ octicon "organization" }} <span>Organizations</span></a>
60 <button type="button" role="menuitem" class="shithub-user-menu-item" disabled>
61 {{ octicon "globe" }} <span>Enterprises</span>
62 </button>
63 <button type="button" role="menuitem" class="shithub-user-menu-item" disabled>
64 {{ octicon "heart" }} <span>Sponsors</span>
65 </button>
66 <div class="shithub-user-menu-divider" role="separator"></div>
67 <a role="menuitem" class="shithub-user-menu-item" href="/settings/profile">{{ octicon "gear" }} <span>Settings</span></a>
68 <button type="button" role="menuitem" class="shithub-user-menu-item" disabled>
69 {{ octicon "beaker" }} <span>Feature preview</span>
70 </button>
71 <a role="menuitem" class="shithub-user-menu-item" href="/settings/appearance">{{ octicon "paintbrush" }} <span>Appearance</span></a>
72 <button type="button" role="menuitem" class="shithub-user-menu-item" disabled>
73 {{ octicon "accessibility" }} <span>Accessibility</span>
74 </button>
75 <button type="button" role="menuitem" class="shithub-user-menu-item" disabled>
76 {{ octicon "briefcase" }} <span>Try Enterprise</span><span class="shithub-user-menu-badge">Free</span>
77 </button>
78 <div class="shithub-user-menu-divider" role="separator"></div>
79 <form method="POST" action="/logout" class="shithub-user-menu-signout">
80 <input type="hidden" name="csrf_token" value="{{ .CSRFToken }}">
81 <button type="submit" role="menuitem" class="shithub-user-menu-item">{{ octicon "sign-out" }} <span>Sign out</span></button>
82 </form>
83 </div>
84 </details>
85 {{- else }}
86 <a href="/login" class="shithub-button shithub-button-ghost">Sign in</a>
87 <a href="/signup" class="shithub-button shithub-button-primary">Sign up</a>
88 {{- end }}
89 </div>
90 </div>
91 {{ if .Repo }}
92 <div class="shithub-nav-local">
93 {{ template "repo-subnav" . }}
94 </div>
95 {{ else if .Org }}
96 <div class="shithub-nav-local">
97 {{ template "org-subnav" . }}
98 </div>
99 {{ end }}
100 </header>
101 {{- end }}