HTML · 2139 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">
8 <input type="text" name="q" placeholder="Search…" aria-label="Search" autocomplete="off">
9 <input type="hidden" name="type" value="repos">
10 </form>
11 <nav class="shithub-nav-links" aria-label="Primary">
12 <a href="/explore">Explore</a>
13 <a href="/about">About</a>
14 </nav>
15 <div class="shithub-nav-actions">
16 {{- if .Viewer.ID }}
17 <a href="/notifications" class="shithub-button shithub-button-ghost" title="Notifications" aria-label="Notifications">{{ octicon "bell" }}</a>
18 <a href="/new" class="shithub-button shithub-button-ghost" title="New repository">+ New</a>
19 <details class="shithub-user-menu">
20 <summary aria-label="User menu" aria-haspopup="menu">
21 <img src="/avatars/{{ .Viewer.Username }}" alt="" class="shithub-user-menu-avatar" width="24" height="24">
22 <span class="shithub-user-menu-name">{{ .Viewer.Username }}</span>
23 </summary>
24 <div class="shithub-user-menu-panel" role="menu">
25 <div class="shithub-user-menu-header">
26 Signed in as <strong>@{{ .Viewer.Username }}</strong>
27 </div>
28 <a role="menuitem" href="/{{ .Viewer.Username }}">Your profile</a>
29 <a role="menuitem" href="/{{ .Viewer.Username }}?tab=repositories">Your repositories</a>
30 <a role="menuitem" href="/organizations/new">New organization</a>
31 <a role="menuitem" href="/settings/profile">Settings</a>
32 <form method="POST" action="/logout" class="shithub-user-menu-signout">
33 <input type="hidden" name="csrf_token" value="{{ .CSRFToken }}">
34 <button type="submit" role="menuitem">Sign out</button>
35 </form>
36 </div>
37 </details>
38 {{- else }}
39 <a href="/login" class="shithub-button shithub-button-ghost">Sign in</a>
40 <a href="/signup" class="shithub-button shithub-button-primary">Sign up</a>
41 {{- end }}
42 </div>
43 </header>
44 {{- end }}