|
1 |
| -<nav class="ui container secondary stackable main menu" id="navbar" aria-label="{{.locale.Tr "aria.navbar"}}"> |
2 |
| - {{$notificationUnreadCount := 0}} |
3 |
| - {{if .IsSigned}} |
4 |
| - {{if .NotificationUnreadCount}}{{$notificationUnreadCount = call .NotificationUnreadCount}}{{end}} |
5 |
| - {{end}} |
6 |
| - <div class="item brand gt-sb"> |
| 1 | +{{$notificationUnreadCount := 0}} |
| 2 | +{{if and .IsSigned .NotificationUnreadCount}} |
| 3 | + {{$notificationUnreadCount = call .NotificationUnreadCount}} |
| 4 | +{{end}} |
| 5 | + |
| 6 | +<nav id="navbar" class="ui secondary stackable menu" aria-label="{{.locale.Tr "aria.navbar"}}"> |
| 7 | + <div class="item"> |
| 8 | + <!-- the logo --> |
7 | 9 | <a href="{{AppSubUrl}}/" aria-label="{{if .IsSigned}}{{.locale.Tr "dashboard"}}{{else}}{{.locale.Tr "home"}}{{end}}">
|
8 | 10 | <img width="30" height="30" src="{{AssetUrlPrefix}}/img/logo.svg" alt="{{.locale.Tr "logo"}}" aria-hidden="true">
|
9 | 11 | </a>
|
10 |
| - <div class="gt-df gt-ac"> |
| 12 | + |
| 13 | + <!-- mobile right menu, it must be here because in mobile view, each item is a flex column, the first item is a full row column --> |
| 14 | + <div class="ui secondary menu navbar-mobile-right gt-gap-2"> |
11 | 15 | {{if .IsSigned}}
|
12 |
| - <a href="{{AppSubUrl}}/notifications" class="mobile-only gt-mr-4 gt-mt-3" data-tooltip-content="{{.locale.Tr "notifications"}}" aria-label="{{.locale.Tr "notifications"}}"> |
13 |
| - <span class="fitted item"> |
| 16 | + <a class="item gt-mx-0 gt-p-3" href="{{AppSubUrl}}/notifications" data-tooltip-content="{{.locale.Tr "notifications"}}" aria-label="{{.locale.Tr "notifications"}}"> |
| 17 | + <div class="gt-relative"> |
14 | 18 | {{svg "octicon-bell"}}
|
15 |
| - <span class="notification_count{{if not $notificationUnreadCount}} gt-hidden{{end}}"> |
16 |
| - {{$notificationUnreadCount}} |
17 |
| - </span> |
18 |
| - </span> |
| 19 | + <span class="notification_count{{if not $notificationUnreadCount}} gt-hidden{{end}}">{{$notificationUnreadCount}}</span> |
| 20 | + </div> |
19 | 21 | </a>
|
20 | 22 | {{end}}
|
21 |
| - <button class="ui icon button mobile-only" id="navbar-expand-toggle"> |
22 |
| - {{svg "octicon-three-bars"}} |
23 |
| - </button> |
| 23 | + <button class="item ui icon mini button gt-p-3 gt-m-0" id="navbar-expand-toggle">{{svg "octicon-three-bars"}}</button> |
24 | 24 | </div>
|
25 | 25 | </div>
|
26 | 26 |
|
| 27 | + <!-- navbar links --> |
27 | 28 | {{if and .IsSigned .MustChangePassword}}
|
28 | 29 | {{/* No links */}}
|
29 | 30 | {{else if .IsSigned}}
|
30 | 31 | {{if not .UnitIssuesGlobalDisabled}}
|
31 |
| - <a class="item {{if .PageIsIssues}}active{{end}}" href="{{AppSubUrl}}/issues">{{.locale.Tr "issues"}}</a> |
| 32 | + <a class="item{{if .PageIsIssues}} active{{end}}" href="{{AppSubUrl}}/issues">{{.locale.Tr "issues"}}</a> |
32 | 33 | {{end}}
|
33 | 34 | {{if not .UnitPullsGlobalDisabled}}
|
34 |
| - <a class="item {{if .PageIsPulls}}active{{end}}" href="{{AppSubUrl}}/pulls">{{.locale.Tr "pull_requests"}}</a> |
| 35 | + <a class="item{{if .PageIsPulls}} active{{end}}" href="{{AppSubUrl}}/pulls">{{.locale.Tr "pull_requests"}}</a> |
35 | 36 | {{end}}
|
36 | 37 | {{if not (and .UnitIssuesGlobalDisabled .UnitPullsGlobalDisabled)}}
|
37 |
| - {{if .ShowMilestonesDashboardPage}}<a class="item {{if .PageIsMilestonesDashboard}}active{{end}}" href="{{AppSubUrl}}/milestones">{{.locale.Tr "milestones"}}</a>{{end}} |
| 38 | + {{if .ShowMilestonesDashboardPage}} |
| 39 | + <a class="item{{if .PageIsMilestonesDashboard}} active{{end}}" href="{{AppSubUrl}}/milestones">{{.locale.Tr "milestones"}}</a> |
| 40 | + {{end}} |
38 | 41 | {{end}}
|
39 |
| - <a class="item {{if .PageIsExplore}}active{{end}}" href="{{AppSubUrl}}/explore/repos">{{.locale.Tr "explore"}}</a> |
| 42 | + <a class="item{{if .PageIsExplore}} active{{end}}" href="{{AppSubUrl}}/explore/repos">{{.locale.Tr "explore"}}</a> |
40 | 43 | {{else if .IsLandingPageOrganizations}}
|
41 |
| - <a class="item {{if .PageIsExplore}}active{{end}}" href="{{AppSubUrl}}/explore/organizations">{{.locale.Tr "explore"}}</a> |
| 44 | + <a class="item{{if .PageIsExplore}} active{{end}}" href="{{AppSubUrl}}/explore/organizations">{{.locale.Tr "explore"}}</a> |
42 | 45 | {{else}}
|
43 |
| - <a class="item {{if .PageIsExplore}}active{{end}}" href="{{AppSubUrl}}/explore/repos">{{.locale.Tr "explore"}}</a> |
| 46 | + <a class="item{{if .PageIsExplore}} active{{end}}" href="{{AppSubUrl}}/explore/repos">{{.locale.Tr "explore"}}</a> |
44 | 47 | {{end}}
|
45 | 48 |
|
46 | 49 | {{template "custom/extra_links" .}}
|
47 | 50 |
|
48 |
| - {{/* TODO |
49 |
| - <div class="item"> |
50 |
| - <div class="ui icon input"> |
51 |
| - <input class="searchbox" type="text" placeholder="{{.locale.Tr "search_project"}}"> |
52 |
| - <i class="icon gt-df gt-ac gt-jc">{{svg "octicon-search" 16}}</i> |
53 |
| - </div> |
54 |
| - </div> |
55 |
| - */}} |
56 |
| - |
| 51 | + {{if not .IsSigned}} |
| 52 | + <a class="item" target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io">{{.locale.Tr "help"}}</a> |
| 53 | + {{end}} |
57 | 54 |
|
58 |
| - {{if and .IsSigned .MustChangePassword}} |
59 |
| - <div class="right stackable menu"> |
60 |
| - <div class="ui dropdown jump item" tabindex="-1" data-tooltip-content="{{.locale.Tr "user_profile_and_more"}}"> |
61 |
| - <span class="text"> |
62 |
| - {{avatar $.Context .SignedUser 24 "tiny"}} |
63 |
| - <span class="sr-only">{{.locale.Tr "user_profile_and_more"}}</span> |
64 |
| - <span class="mobile-only">{{.SignedUser.Name}}</span> |
65 |
| - <span class="fitted not-mobile" tabindex="-1">{{svg "octicon-triangle-down"}}</span> |
| 55 | + <!-- the full dropdown menus --> |
| 56 | + <div class="right menu"> |
| 57 | + {{if and .IsSigned .MustChangePassword}} |
| 58 | + <div class="ui dropdown jump item" data-tooltip-content="{{.locale.Tr "user_profile_and_more"}}"> |
| 59 | + <span class="text gt-df gt-ac"> |
| 60 | + {{avatar $.Context .SignedUser 24 "gt-mr-2"}} |
| 61 | + <span class="mobile-only gt-ml-2">{{.SignedUser.Name}}</span> |
| 62 | + <span class="not-mobile">{{svg "octicon-triangle-down"}}</span> |
66 | 63 | </span>
|
67 |
| - <div class="menu user-menu" tabindex="-1"> |
| 64 | + <div class="menu user-menu"> |
68 | 65 | <div class="ui header">
|
69 | 66 | {{.locale.Tr "signed_in_as"}} <strong>{{.SignedUser.Name}}</strong>
|
70 | 67 | </div>
|
71 | 68 |
|
72 | 69 | <div class="divider"></div>
|
73 | 70 | <a class="item link-action" href data-url="{{AppSubUrl}}/user/logout" data-redirect="{{AppSubUrl}}/">
|
74 | 71 | {{svg "octicon-sign-out"}}
|
75 |
| - {{.locale.Tr "sign_out"}}<!-- Sign Out --> |
| 72 | + {{.locale.Tr "sign_out"}} |
76 | 73 | </a>
|
77 | 74 | </div><!-- end content avatar menu -->
|
78 | 75 | </div><!-- end dropdown avatar menu -->
|
79 |
| - </div> |
80 |
| - {{else if .IsSigned}} |
81 |
| - <div class="right stackable menu gt-mr-4"> |
| 76 | + {{else if .IsSigned}} |
82 | 77 | {{if EnableTimetracking}}
|
83 |
| - <a class="active-stopwatch-trigger item ui gt-mx-0{{if not .ActiveStopwatch}} gt-hidden{{end}}" href="{{.ActiveStopwatch.IssueLink}}"> |
84 |
| - <span class="fitted gt-relative"> |
| 78 | + <a class="active-stopwatch-trigger item ui gt-mx-0{{if not .ActiveStopwatch}} gt-hidden{{end}}" href="{{.ActiveStopwatch.IssueLink}}" title="{{.locale.Tr "active_stopwatch"}}"> |
| 79 | + <div class="gt-relative"> |
85 | 80 | {{svg "octicon-stopwatch"}}
|
86 | 81 | <span class="header-stopwatch-dot"></span>
|
87 |
| - <span class="sr-mobile-only">{{.locale.Tr "active_stopwatch"}}</span> |
88 |
| - </span> |
| 82 | + </div> |
| 83 | + <span class="mobile-only gt-ml-2">{{.locale.Tr "active_stopwatch"}}</span> |
89 | 84 | </a>
|
90 |
| - <div class="active-stopwatch-popup tippy-target"> |
| 85 | + <div class="active-stopwatch-popup tippy-target gt-p-3"> |
91 | 86 | <div class="gt-df gt-ac">
|
92 | 87 | <a class="stopwatch-link gt-df gt-ac" href="{{.ActiveStopwatch.IssueLink}}">
|
93 | 88 | {{svg "octicon-issue-opened" 16 "gt-mr-3"}}
|
|
100 | 95 | {{.CsrfTokenHtml}}
|
101 | 96 | <button
|
102 | 97 | type="submit"
|
103 |
| - class="ui button mini compact basic icon fitted" |
| 98 | + class="ui button mini compact basic icon" |
104 | 99 | data-tooltip-content="{{.locale.Tr "repo.issues.stop_tracking"}}"
|
105 | 100 | >{{svg "octicon-square-fill"}}</button>
|
106 | 101 | </form>
|
107 | 102 | <form class="stopwatch-cancel" method="POST" action="{{.ActiveStopwatch.IssueLink}}/times/stopwatch/cancel">
|
108 | 103 | {{.CsrfTokenHtml}}
|
109 | 104 | <button
|
110 | 105 | type="submit"
|
111 |
| - class="ui button mini compact basic icon fitted" |
| 106 | + class="ui button mini compact basic icon" |
112 | 107 | data-tooltip-content="{{.locale.Tr "repo.issues.cancel_tracking"}}"
|
113 | 108 | >{{svg "octicon-trash"}}</button>
|
114 | 109 | </form>
|
|
117 | 112 | {{end}}
|
118 | 113 |
|
119 | 114 | <a href="{{AppSubUrl}}/notifications" class="item not-mobile gt-mx-0" data-tooltip-content="{{.locale.Tr "notifications"}}" aria-label="{{.locale.Tr "notifications"}}">
|
120 |
| - <span class="fitted item"> |
| 115 | + <div class="gt-relative"> |
121 | 116 | {{svg "octicon-bell"}}
|
122 |
| - <span class="notification_count{{if not $notificationUnreadCount}} gt-hidden{{end}}"> |
123 |
| - {{$notificationUnreadCount}} |
124 |
| - </span> |
125 |
| - </span> |
| 117 | + <span class="notification_count{{if not $notificationUnreadCount}} gt-hidden{{end}}">{{$notificationUnreadCount}}</span> |
| 118 | + </div> |
126 | 119 | </a>
|
127 | 120 |
|
128 | 121 | <div class="ui dropdown jump item gt-mx-0 gt-pr-3" data-tooltip-content="{{.locale.Tr "create_new"}}">
|
129 | 122 | <span class="text">
|
130 |
| - <span class="fitted">{{svg "octicon-plus"}}</span> |
131 |
| - <span class="sr-mobile-only">{{.locale.Tr "create_new"}}</span> |
132 |
| - <span class="fitted not-mobile">{{svg "octicon-triangle-down"}}</span> |
| 123 | + {{svg "octicon-plus"}} |
| 124 | + <span class="not-mobile">{{svg "octicon-triangle-down"}}</span> |
| 125 | + <span class="mobile-only">{{.locale.Tr "create_new"}}</span> |
133 | 126 | </span>
|
134 | 127 | <div class="menu">
|
135 | 128 | <a class="item" href="{{AppSubUrl}}/repo/create">
|
136 |
| - <span class="fitted">{{svg "octicon-plus"}}</span> {{.locale.Tr "new_repo"}} |
| 129 | + {{svg "octicon-plus"}} {{.locale.Tr "new_repo"}} |
137 | 130 | </a>
|
138 | 131 | {{if not .DisableMigrations}}
|
139 | 132 | <a class="item" href="{{AppSubUrl}}/repo/migrate">
|
140 |
| - <span class="fitted">{{svg "octicon-repo-push"}}</span> {{.locale.Tr "new_migrate"}} |
| 133 | + {{svg "octicon-repo-push"}} {{.locale.Tr "new_migrate"}} |
141 | 134 | </a>
|
142 | 135 | {{end}}
|
143 | 136 | {{if .SignedUser.CanCreateOrganization}}
|
144 | 137 | <a class="item" href="{{AppSubUrl}}/org/create">
|
145 |
| - <span class="fitted">{{svg "octicon-organization"}}</span> {{.locale.Tr "new_org"}} |
| 138 | + {{svg "octicon-organization"}} {{.locale.Tr "new_org"}} |
146 | 139 | </a>
|
147 | 140 | {{end}}
|
148 | 141 | </div><!-- end content create new menu -->
|
149 | 142 | </div><!-- end dropdown menu create new -->
|
150 | 143 |
|
151 | 144 | <div class="ui dropdown jump item gt-mx-0 gt-pr-3" data-tooltip-content="{{.locale.Tr "user_profile_and_more"}}">
|
152 |
| - <span class="text"> |
153 |
| - {{avatar $.Context .SignedUser 24 "tiny"}} |
154 |
| - <span class="sr-only">{{.locale.Tr "user_profile_and_more"}}</span> |
155 |
| - <span class="mobile-only">{{.SignedUser.Name}}</span> |
156 |
| - <span class="fitted not-mobile" tabindex="-1">{{svg "octicon-triangle-down"}}</span> |
| 145 | + <span class="text gt-df gt-ac"> |
| 146 | + {{avatar $.Context .SignedUser 24 "gt-mr-2"}} |
| 147 | + <span class="mobile-only gt-ml-2">{{.SignedUser.Name}}</span> |
| 148 | + <span class="not-mobile">{{svg "octicon-triangle-down"}}</span> |
157 | 149 | </span>
|
158 |
| - <div class="menu user-menu" tabindex="-1"> |
| 150 | + <div class="menu user-menu"> |
159 | 151 | <div class="ui header">
|
160 | 152 | {{.locale.Tr "signed_in_as"}} <strong>{{.SignedUser.Name}}</strong>
|
161 | 153 | </div>
|
162 | 154 |
|
163 | 155 | <div class="divider"></div>
|
164 | 156 | <a class="item" href="{{.SignedUser.HomeLink}}">
|
165 | 157 | {{svg "octicon-person"}}
|
166 |
| - {{.locale.Tr "your_profile"}}<!-- Your profile --> |
| 158 | + {{.locale.Tr "your_profile"}} |
167 | 159 | </a>
|
168 | 160 | {{if not .DisableStars}}
|
169 | 161 | <a class="item" href="{{.SignedUser.HomeLink}}?tab=stars">
|
|
173 | 165 | {{end}}
|
174 | 166 | <a class="item" href="{{AppSubUrl}}/notifications/subscriptions">
|
175 | 167 | {{svg "octicon-bell"}}
|
176 |
| - {{.locale.Tr "notification.subscriptions"}}<!-- Subscriptions --> |
| 168 | + {{.locale.Tr "notification.subscriptions"}} |
177 | 169 | </a>
|
178 | 170 | <a class="{{if .PageIsUserSettings}}active {{end}}item" href="{{AppSubUrl}}/user/settings">
|
179 | 171 | {{svg "octicon-tools"}}
|
180 |
| - {{.locale.Tr "your_settings"}}<!-- Your settings --> |
| 172 | + {{.locale.Tr "your_settings"}} |
181 | 173 | </a>
|
182 | 174 | <a class="item" target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io">
|
183 | 175 | {{svg "octicon-question"}}
|
184 |
| - {{.locale.Tr "help"}}<!-- Help --> |
| 176 | + {{.locale.Tr "help"}} |
185 | 177 | </a>
|
186 | 178 | {{if .IsAdmin}}
|
187 | 179 | <div class="divider"></div>
|
|
199 | 191 | </a>
|
200 | 192 | </div><!-- end content avatar menu -->
|
201 | 193 | </div><!-- end dropdown avatar menu -->
|
202 |
| - </div><!-- end signed user right menu --> |
203 |
| - {{else}} |
204 |
| - <a class="item" target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io">{{.locale.Tr "help"}}</a> |
205 |
| - <div class="right stackable menu"> |
| 194 | + {{else}} |
206 | 195 | {{if .ShowRegistrationButton}}
|
207 | 196 | <a class="item{{if .PageIsSignUp}} active{{end}}" href="{{AppSubUrl}}/user/sign_up">
|
208 | 197 | {{svg "octicon-person"}} {{.locale.Tr "register"}}
|
|
211 | 200 | <a class="item{{if .PageIsSignIn}} active{{end}}" rel="nofollow" href="{{AppSubUrl}}/user/login{{if not .PageIsSignIn}}?redirect_to={{.CurrentURL}}{{end}}">
|
212 | 201 | {{svg "octicon-sign-in"}} {{.locale.Tr "sign_in"}}
|
213 | 202 | </a>
|
214 |
| - </div><!-- end anonymous user right menu --> |
215 |
| - {{end}} |
| 203 | + {{end}} |
| 204 | + </div><!-- end full right menu --> |
216 | 205 | </nav>
|
0 commit comments