@@ -1,24 +1,39 @@ |
| 1 | 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"> |
| 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"> |
| 19 | 34 | {{- if .Viewer.ID }} |
| 20 | 35 | <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> |
| 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> |
| 22 | 37 | <details class="shithub-user-menu"> |
| 23 | 38 | <summary aria-label="User menu" aria-haspopup="menu"> |
| 24 | 39 | <img src="/avatars/{{ .Viewer.Username }}" alt="" class="shithub-user-menu-avatar" width="24" height="24"> |
@@ -50,9 +65,6 @@ |
| 50 | 65 | </button> |
| 51 | 66 | <div class="shithub-user-menu-divider" role="separator"></div> |
| 52 | 67 | <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 | 68 | <button type="button" role="menuitem" class="shithub-user-menu-item" disabled> |
| 57 | 69 | {{ octicon "beaker" }} <span>Feature preview</span> |
| 58 | 70 | </button> |
@@ -74,6 +86,16 @@ |
| 74 | 86 | <a href="/login" class="shithub-button shithub-button-ghost">Sign in</a> |
| 75 | 87 | <a href="/signup" class="shithub-button shithub-button-primary">Sign up</a> |
| 76 | 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" . }} |
| 77 | 98 | </div> |
| 99 | + {{ end }} |
| 78 | 100 | </header> |
| 79 | 101 | {{- end }} |