HTML · 4939 bytes Raw Blame History
1 {{ define "nav" -}}
2 <header class="shithub-nav" role="banner">
3 <a href="/" class="shithub-nav-brand" aria-label="shithub home">
4 {{ octicon "shithub" }}
5 <span>shithub</span>
6 </a>
7 <form action="/search" method="get" class="shithub-nav-search" role="search" data-search-root>
8 <span class="shithub-nav-search-icon">{{ octicon "search" }}</span>
9 <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>
10 <span class="shithub-nav-search-key" aria-hidden="true">/</span>
11 <input type="hidden" name="type" value="repositories">
12 <div id="global-search-suggestions" class="shithub-nav-search-popover" data-search-results hidden></div>
13 </form>
14 <nav class="shithub-nav-links" aria-label="Primary">
15 <a href="/explore">Explore</a>
16 <a href="/about">About</a>
17 </nav>
18 <div class="shithub-nav-actions">
19 {{- if .Viewer.ID }}
20 <a href="/notifications" class="shithub-button shithub-button-ghost" title="Notifications" aria-label="Notifications">{{ octicon "bell" }}</a>
21 <a href="/new" class="shithub-button shithub-button-ghost" title="New repository">+ New</a>
22 <details class="shithub-user-menu">
23 <summary aria-label="User menu" aria-haspopup="menu">
24 <img src="/avatars/{{ .Viewer.Username }}" alt="" class="shithub-user-menu-avatar" width="24" height="24">
25 </summary>
26 <div class="shithub-user-menu-panel" role="menu">
27 <div class="shithub-user-menu-account">
28 <img src="/avatars/{{ .Viewer.Username }}" alt="" class="shithub-user-menu-account-avatar" width="40" height="40">
29 <div class="shithub-user-menu-account-copy">
30 <strong>{{ .Viewer.Username }}</strong>
31 <span>@{{ .Viewer.Username }}</span>
32 </div>
33 </div>
34 <button type="button" role="menuitem" class="shithub-user-menu-item" disabled>
35 {{ octicon "smiley" }} <span>Set status</span>
36 </button>
37 <div class="shithub-user-menu-divider" role="separator"></div>
38 <a role="menuitem" class="shithub-user-menu-item" href="/{{ .Viewer.Username }}">{{ octicon "person" }} <span>Profile</span></a>
39 <a role="menuitem" class="shithub-user-menu-item" href="/{{ .Viewer.Username }}?tab=repositories">{{ octicon "repo" }} <span>Repositories</span></a>
40 <a role="menuitem" class="shithub-user-menu-item" href="/{{ .Viewer.Username }}?tab=stars">{{ octicon "star" }} <span>Stars</span></a>
41 <button type="button" role="menuitem" class="shithub-user-menu-item" disabled>
42 {{ octicon "code-square" }} <span>Gists</span>
43 </button>
44 <a role="menuitem" class="shithub-user-menu-item" href="/settings/organizations">{{ octicon "organization" }} <span>Organizations</span></a>
45 <button type="button" role="menuitem" class="shithub-user-menu-item" disabled>
46 {{ octicon "globe" }} <span>Enterprises</span>
47 </button>
48 <button type="button" role="menuitem" class="shithub-user-menu-item" disabled>
49 {{ octicon "heart" }} <span>Sponsors</span>
50 </button>
51 <div class="shithub-user-menu-divider" role="separator"></div>
52 <a role="menuitem" class="shithub-user-menu-item" href="/settings/profile">{{ octicon "gear" }} <span>Settings</span></a>
53 <button type="button" role="menuitem" class="shithub-user-menu-item" disabled>
54 {{ octicon "copilot" }} <span>Copilot settings</span>
55 </button>
56 <button type="button" role="menuitem" class="shithub-user-menu-item" disabled>
57 {{ octicon "beaker" }} <span>Feature preview</span>
58 </button>
59 <a role="menuitem" class="shithub-user-menu-item" href="/settings/appearance">{{ octicon "paintbrush" }} <span>Appearance</span></a>
60 <button type="button" role="menuitem" class="shithub-user-menu-item" disabled>
61 {{ octicon "accessibility" }} <span>Accessibility</span>
62 </button>
63 <button type="button" role="menuitem" class="shithub-user-menu-item" disabled>
64 {{ octicon "briefcase" }} <span>Try Enterprise</span><span class="shithub-user-menu-badge">Free</span>
65 </button>
66 <div class="shithub-user-menu-divider" role="separator"></div>
67 <form method="POST" action="/logout" class="shithub-user-menu-signout">
68 <input type="hidden" name="csrf_token" value="{{ .CSRFToken }}">
69 <button type="submit" role="menuitem" class="shithub-user-menu-item">{{ octicon "sign-out" }} <span>Sign out</span></button>
70 </form>
71 </div>
72 </details>
73 {{- else }}
74 <a href="/login" class="shithub-button shithub-button-ghost">Sign in</a>
75 <a href="/signup" class="shithub-button shithub-button-primary">Sign up</a>
76 {{- end }}
77 </div>
78 </header>
79 {{- end }}