| @@ -15,19 +15,19 @@ |
| 15 | 15 | <div class="shell"> |
| 16 | 16 | |
| 17 | 17 | <nav class="rail" aria-label="Site"> |
| 18 | | <a class="brand" href="/" aria-label="{{.Site}} home">{{template "mark"}}<span class="vh">{{.Site}}</span></a> |
| 18 | <a class="brand" href="/" aria-label="{{.Site}} home"{{if eq (str . "Tab") "dashboard"}} aria-current="page"{{end}}>{{template "mark"}}<span class="brandname" aria-hidden="true">{{.Site}}</span><span class="vh">{{.Site}}</span></a> |
| 19 | 19 | {{$items := railOptItems .}} |
| 20 | | {{/* A square is .railopt when the phone rail drops it into the More |
| 21 | | menu below. Every one of those destinations — strip, menu and |
| 22 | | the foot's own Log out link — renders off $items, so the strip |
| 23 | | and the menu can never drift out of step. */}} |
| 24 | 20 | <ul class="raillist"> |
| 25 | | {{if .Viewer}}<li>{{template "raillink" dict "Href" "/" "Icon" "home" "Name" "Dashboard" "Current" (eq (str . "Tab") "dashboard")}}</li>{{end}} |
| 26 | | <li>{{template "raillink" dict "Href" "/explore" "Icon" "compass" "Name" "Explore" "Current" (eq (str . "Tab") "explore")}}</li> |
| 21 | <li>{{template "raillink" dict "Href" "/explore" "Icon" "compass" "Name" "Explore" "Label" "Explore" "Current" (eq (str . "Tab") "explore")}}</li> |
| 22 | {{if .Viewer}}<li class="railpins-item"><details class="railpins"> |
| 23 | <summary class="railicon raildrop-trigger" aria-label="Pinned repositories" title="Pinned repositories">{{template "icon" "bookmark"}}<span class="raillabel" aria-hidden="true">Pinned</span><span class="railcaret" aria-hidden="true">▾</span><span class="vh">Pinned repositories</span></summary> |
| 24 | <div class="raildrop"> |
| 25 | {{range .Rail.Pins}}<a href="/{{.Owner}}/{{.Name}}">{{.Owner}}/{{.Name}}</a>{{else}}<span class="none">No pinned repos</span>{{end}} |
| 26 | <hr class="railsep"> |
| 27 | <a href="/{{.Viewer}}/-/repositories">All repositories →</a> |
| 28 | </div> |
| 29 | </details></li>{{end}} |
| 27 | 30 | <li class="railsearch-mob">{{template "raillink" dict "Href" "/search" "Icon" "search" "Name" "Search" "Current" (eq (str . "Tab") "sitesearch")}}</li> |
| 28 | | {{if .Viewer}}<li>{{template "raillink" dict "Href" "/notifications" "Icon" "bell" "Name" "Notifications" "Current" (eq (str . "Tab") "notifications") "Count" .Rail.Unread}}</li> |
| 29 | | <li class="railopt"><details class="railpins"><summary class="railicon" aria-label="Pinned repositories" title="Pinned repositories">{{template "icon" "bookmark"}}<span class="vh">Pinned repositories</span></summary><div class="raildrop">{{range .Rail.Pins}}<a href="/{{.Owner}}/{{.Name}}">{{.Owner}}/{{.Name}}</a>{{else}}<span class="none">No pinned repos</span>{{end}}<a href="/{{.Viewer}}/-/repositories">All repositories →</a></div></details></li> |
| 30 | | <li class="railopt">{{template "raillink" (index $items 0)}}</li>{{end}} |
| 31 | 31 | </ul> |
| 32 | 32 | <form method="get" action="/search" class="railsearch" role="search"> |
| 33 | 33 | <input type="search" name="q" aria-label="Search repositories, issues, and merge requests" placeholder="Search repositories, issues, MRs…"> |
| @@ -35,16 +35,22 @@ |
| 35 | 35 | </form> |
| 36 | 36 | <span class="railgap"></span> |
| 37 | 37 | <div class="railfoot"> |
| 38 | | {{if .Viewer}}<details class="railmore"> |
| 39 | | <summary class="railicon" aria-label="More" title="More">{{template "icon" "ellipsis"}}<span class="vh">More</span></summary> |
| 38 | {{if .Viewer}} |
| 39 | <details class="railcreate"> |
| 40 | <summary class="railicon raildrop-trigger" aria-label="Create new" title="Create new">{{template "icon" "plus"}}<span class="railcaret" aria-hidden="true">▾</span><span class="vh">Create new</span></summary> |
| 40 | 41 | <div class="raildrop"> |
| 41 | | {{range $items}}{{if .Show}}<a href="{{.Href}}">{{template "icon" .Icon}} {{.Name}}</a>{{end}}{{end}} |
| 42 | <a href="/new#create">{{template "icon" "plus"}} New repository</a> |
| 43 | <a href="/new#import">{{template "icon" "file"}} Import repository</a> |
| 44 | <a href="/new#org">{{template "icon" "person"}} New organization</a> |
| 42 | 45 | </div> |
| 43 | 46 | </details> |
| 47 | {{template "raillink" dict "Href" "/notifications" "Icon" "bell" "Name" "Notifications" "Current" (eq (str . "Tab") "notifications") "Count" .Rail.Unread}} |
| 44 | 48 | <details class="railusermenu"> |
| 45 | | <summary class="railavatar" aria-label="Account menu" title="{{.Viewer}}"><span class="avatar">{{initial .Viewer}}</span></summary> |
| 49 | <summary class="railavatar" aria-label="Account menu" title="{{.Viewer}}"><span class="avatar">{{initial .Viewer}}</span><span class="railcaret" aria-hidden="true">▾</span></summary> |
| 46 | 50 | <div class="raildrop"> |
| 47 | 51 | <a class="railuser" href="/{{.Viewer}}">{{template "icon" "person"}} <span><strong>{{.Viewer}}</strong></span></a> |
| 52 | <a href="/{{.Viewer}}/-/repositories">{{template "icon" "folder"}} Your repositories</a> |
| 53 | <a href="/{{.Viewer}}/-/bookmarks">{{template "icon" "bookmark"}} Bookmarks</a> |
| 48 | 54 | <hr class="railsep"> |
| 49 | 55 | {{$settings := index $items 1}}<a{{if $settings.Current}} aria-current="page"{{end}} href="{{$settings.Href}}">{{template "icon" $settings.Icon}} {{$settings.Name}}</a> |
| 50 | 56 | {{$admin := index $items 2}}{{if $admin.Show}}<a{{if $admin.Current}} aria-current="page"{{end}} href="{{$admin.Href}}">{{template "icon" $admin.Icon}} {{$admin.Name}}</a>{{end}} |
| @@ -52,7 +58,7 @@ |
| 52 | 58 | {{$logout := index $items 3}}<a href="{{$logout.Href}}">{{template "icon" $logout.Icon}} {{$logout.Name}}</a> |
| 53 | 59 | </div> |
| 54 | 60 | </details> |
| 55 | | {{else}}<a class="railicon" href="/login" aria-label="Sign in" title="Sign in">{{template "icon" "person"}}<span class="vh">Sign in</span></a>{{end}} |
| 61 | {{else}}<a class="railicon" href="/login" aria-label="Sign in" title="Sign in">{{template "icon" "person"}}<span class="raillabel" aria-hidden="true">Sign in</span><span class="vh">Sign in</span></a>{{end}} |
| 56 | 62 | </div> |
| 57 | 63 | </nav> |
| 58 | 64 | |
| @@ -135,7 +141,7 @@ |
| 135 | 141 | |
| 136 | 142 | {{/* raillink draws one square in the rail: the icon, the name for a |
| 137 | 143 | screen reader and in the tooltip, and the bell's unread badge. */}} |
| 138 | | {{define "raillink"}}<a class="railicon" {{if .Current}}aria-current="page" {{end}}href="{{.Href}}" aria-label="{{.Name}}" title="{{.Name}}">{{template "icon" .Icon}}<span class="vh">{{.Name}}</span>{{with .Count}}<b class="count">{{.}}</b>{{end}}</a>{{end}} |
| 144 | {{define "raillink"}}<a class="railicon" {{if .Current}}aria-current="page" {{end}}href="{{.Href}}" aria-label="{{.Name}}" title="{{.Name}}">{{template "icon" .Icon}}{{with .Label}}<span class="raillabel" aria-hidden="true">{{.}}</span>{{end}}<span class="vh">{{.Name}}</span>{{with .Count}}<b class="count">{{.}}</b>{{end}}</a>{{end}} |
| 139 | 145 | |
| 140 | 146 | {{define "mark"}}<svg class="mark" width="19" height="19" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2.25 18.75 12H5.25z" fill="#ff6b3d"/><rect x="3" y="13.5" width="18" height="3" fill="currentColor"/><rect x="7.5" y="18" width="9" height="3" fill="currentColor"/></svg>{{end}} |
| 141 | 147 | {{define "width"}}reading{{end}} |