|
| 1 | +{{$notificationUnreadCount := 0}} |
| 2 | +{{if and .IsSigned .NotificationUnreadCount}} |
| 3 | + {{$notificationUnreadCount = call .NotificationUnreadCount}} |
| 4 | +{{end}} |
| 5 | + |
1 | 6 | <nav id="navbar" class="ui secondary stackable menu" 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"> |
| 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"> |
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"> |
14 |
| - {{svg "octicon-bell"}} |
15 |
| - <span class="notification_count{{if not $notificationUnreadCount}} gt-hidden{{end}}"> |
16 |
| - {{$notificationUnreadCount}} |
17 |
| - </span> |
18 |
| - </span> |
| 16 | + <a class="item" href="{{AppSubUrl}}/notifications" data-tooltip-content="{{.locale.Tr "notifications"}}" aria-label="{{.locale.Tr "notifications"}}"> |
| 17 | + {{svg "octicon-bell"}} |
| 18 | + <span class="notification_count{{if not $notificationUnreadCount}} gt-hidden{{end}}">{{$notificationUnreadCount}}</span> |
19 | 19 | </a>
|
20 | 20 | {{end}}
|
21 |
| - <button class="ui icon button mobile-only" id="navbar-expand-toggle"> |
22 |
| - {{svg "octicon-three-bars"}} |
23 |
| - </button> |
| 21 | + <div class="item gt-pr-0"> |
| 22 | + <button class="ui icon button" id="navbar-expand-toggle">{{svg "octicon-three-bars"}}</button> |
| 23 | + </div> |
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 | 42 | <a class="item{{if .PageIsExplore}} active{{end}}" href="{{AppSubUrl}}/explore/repos">{{.locale.Tr "explore"}}</a>
|
40 | 43 | {{else if .IsLandingPageOrganizations}}
|
41 | 44 | <a class="item{{if .PageIsExplore}} active{{end}}" href="{{AppSubUrl}}/explore/organizations">{{.locale.Tr "explore"}}</a>
|
42 | 45 | {{else}}
|
43 | 46 | <a class="item{{if .PageIsExplore}} active{{end}}" href="{{AppSubUrl}}/explore/repos">{{.locale.Tr "explore"}}</a>
|
44 | 47 | {{end}}
|
| 48 | + |
45 | 49 | {{template "custom/extra_links" .}}
|
46 |
| - {{if and .IsSigned .MustChangePassword}} |
47 |
| - <div class="right stackable menu"> |
48 |
| - <div class="ui dropdown jump item" tabindex="-1" data-tooltip-content="{{.locale.Tr "user_profile_and_more"}}"> |
| 50 | + |
| 51 | + {{if not .IsSigned}} |
| 52 | + <a class="item" target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io">{{.locale.Tr "help"}}</a> |
| 53 | + {{end}} |
| 54 | + |
| 55 | + <!-- the full dropdown menus --> |
| 56 | + <div class="right menu gt-pr-4"> |
| 57 | + {{if and .IsSigned .MustChangePassword}} |
| 58 | + <div class="ui dropdown jump item" data-tooltip-content="{{.locale.Tr "user_profile_and_more"}}"> |
49 | 59 | <span class="text">
|
50 |
| - {{avatar $.Context .SignedUser 24 "tiny"}} |
51 |
| - <span class="sr-only">{{.locale.Tr "user_profile_and_more"}}</span> |
52 |
| - <span class="mobile-only">{{.SignedUser.Name}}</span> |
53 |
| - <span class="fitted not-mobile" tabindex="-1">{{svg "octicon-triangle-down"}}</span> |
| 60 | + {{avatar $.Context .SignedUser 24 "gt-mr-0"}} |
| 61 | + <span class="mobile-only gt-ml-2">{{.SignedUser.Name}}</span> |
| 62 | + <span class="not-mobile">{{svg "octicon-triangle-down"}}</span> |
54 | 63 | </span>
|
55 |
| - <div class="menu user-menu" tabindex="-1"> |
| 64 | + <div class="menu user-menu"> |
56 | 65 | <div class="ui header">
|
57 | 66 | {{.locale.Tr "signed_in_as"}} <strong>{{.SignedUser.Name}}</strong>
|
58 | 67 | </div>
|
59 | 68 |
|
60 | 69 | <div class="divider"></div>
|
61 | 70 | <a class="item link-action" href data-url="{{AppSubUrl}}/user/logout" data-redirect="{{AppSubUrl}}/">
|
62 | 71 | {{svg "octicon-sign-out"}}
|
63 |
| - {{.locale.Tr "sign_out"}}<!-- Sign Out --> |
| 72 | + {{.locale.Tr "sign_out"}} |
64 | 73 | </a>
|
65 | 74 | </div><!-- end content avatar menu -->
|
66 | 75 | </div><!-- end dropdown avatar menu -->
|
67 |
| - </div> |
68 |
| - {{else if .IsSigned}} |
69 |
| - <div class="right stackable menu gt-mr-4"> |
| 76 | + {{else if .IsSigned}} |
70 | 77 | {{if EnableTimetracking}}
|
71 |
| - <a class="active-stopwatch-trigger item ui gt-mx-0{{if not .ActiveStopwatch}} gt-hidden{{end}}" href="{{.ActiveStopwatch.IssueLink}}"> |
72 |
| - <span class="fitted gt-relative"> |
73 |
| - {{svg "octicon-stopwatch"}} |
74 |
| - <span class="header-stopwatch-dot"></span> |
75 |
| - <span class="sr-mobile-only">{{.locale.Tr "active_stopwatch"}}</span> |
76 |
| - </span> |
| 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 | + {{svg "octicon-stopwatch"}}<span class="header-stopwatch-dot"></span> |
| 80 | + <span class="mobile-only">{{.locale.Tr "active_stopwatch"}}</span> |
77 | 81 | </a>
|
78 | 82 | <div class="active-stopwatch-popup tippy-target">
|
79 | 83 | <div class="gt-df gt-ac">
|
|
88 | 92 | {{.CsrfTokenHtml}}
|
89 | 93 | <button
|
90 | 94 | type="submit"
|
91 |
| - class="ui button mini compact basic icon fitted" |
| 95 | + class="ui button mini compact basic icon" |
92 | 96 | data-tooltip-content="{{.locale.Tr "repo.issues.stop_tracking"}}"
|
93 | 97 | >{{svg "octicon-square-fill"}}</button>
|
94 | 98 | </form>
|
95 | 99 | <form class="stopwatch-cancel" method="POST" action="{{.ActiveStopwatch.IssueLink}}/times/stopwatch/cancel">
|
96 | 100 | {{.CsrfTokenHtml}}
|
97 | 101 | <button
|
98 | 102 | type="submit"
|
99 |
| - class="ui button mini compact basic icon fitted" |
| 103 | + class="ui button mini compact basic icon" |
100 | 104 | data-tooltip-content="{{.locale.Tr "repo.issues.cancel_tracking"}}"
|
101 | 105 | >{{svg "octicon-trash"}}</button>
|
102 | 106 | </form>
|
|
105 | 109 | {{end}}
|
106 | 110 |
|
107 | 111 | <a href="{{AppSubUrl}}/notifications" class="item not-mobile gt-mx-0" data-tooltip-content="{{.locale.Tr "notifications"}}" aria-label="{{.locale.Tr "notifications"}}">
|
108 |
| - <span class="fitted item"> |
109 |
| - {{svg "octicon-bell"}} |
110 |
| - <span class="notification_count{{if not $notificationUnreadCount}} gt-hidden{{end}}"> |
111 |
| - {{$notificationUnreadCount}} |
112 |
| - </span> |
113 |
| - </span> |
| 112 | + {{svg "octicon-bell"}} |
| 113 | + <span class="notification_count{{if not $notificationUnreadCount}} gt-hidden{{end}}">{{$notificationUnreadCount}}</span> |
114 | 114 | </a>
|
115 | 115 |
|
116 | 116 | <div class="ui dropdown jump item gt-mx-0 gt-pr-3" data-tooltip-content="{{.locale.Tr "create_new"}}">
|
117 | 117 | <span class="text">
|
118 |
| - <span class="fitted">{{svg "octicon-plus"}}</span> |
119 |
| - <span class="sr-mobile-only">{{.locale.Tr "create_new"}}</span> |
120 |
| - <span class="fitted not-mobile">{{svg "octicon-triangle-down"}}</span> |
| 118 | + {{svg "octicon-plus"}} |
| 119 | + <span class="not-mobile">{{svg "octicon-triangle-down"}}</span> |
| 120 | + <span class="mobile-only">{{.locale.Tr "create_new"}}</span> |
121 | 121 | </span>
|
122 | 122 | <div class="menu">
|
123 | 123 | <a class="item" href="{{AppSubUrl}}/repo/create">
|
124 |
| - <span class="fitted">{{svg "octicon-plus"}}</span> {{.locale.Tr "new_repo"}} |
| 124 | + {{svg "octicon-plus"}} {{.locale.Tr "new_repo"}} |
125 | 125 | </a>
|
126 | 126 | {{if not .DisableMigrations}}
|
127 | 127 | <a class="item" href="{{AppSubUrl}}/repo/migrate">
|
128 |
| - <span class="fitted">{{svg "octicon-repo-push"}}</span> {{.locale.Tr "new_migrate"}} |
| 128 | + {{svg "octicon-repo-push"}} {{.locale.Tr "new_migrate"}} |
129 | 129 | </a>
|
130 | 130 | {{end}}
|
131 | 131 | {{if .SignedUser.CanCreateOrganization}}
|
132 | 132 | <a class="item" href="{{AppSubUrl}}/org/create">
|
133 |
| - <span class="fitted">{{svg "octicon-organization"}}</span> {{.locale.Tr "new_org"}} |
| 133 | + {{svg "octicon-organization"}} {{.locale.Tr "new_org"}} |
134 | 134 | </a>
|
135 | 135 | {{end}}
|
136 | 136 | </div><!-- end content create new menu -->
|
137 | 137 | </div><!-- end dropdown menu create new -->
|
138 | 138 |
|
139 | 139 | <div class="ui dropdown jump item gt-mx-0 gt-pr-3" data-tooltip-content="{{.locale.Tr "user_profile_and_more"}}">
|
140 | 140 | <span class="text">
|
141 |
| - {{avatar $.Context .SignedUser 24 "tiny"}} |
142 |
| - <span class="sr-only">{{.locale.Tr "user_profile_and_more"}}</span> |
143 |
| - <span class="mobile-only">{{.SignedUser.Name}}</span> |
144 |
| - <span class="fitted not-mobile" tabindex="-1">{{svg "octicon-triangle-down"}}</span> |
| 141 | + {{avatar $.Context .SignedUser 24 "gt-mr-0"}} |
| 142 | + <span class="mobile-only gt-ml-2">{{.SignedUser.Name}}</span> |
| 143 | + <span class="not-mobile">{{svg "octicon-triangle-down"}}</span> |
145 | 144 | </span>
|
146 |
| - <div class="menu user-menu" tabindex="-1"> |
| 145 | + <div class="menu user-menu"> |
147 | 146 | <div class="ui header">
|
148 | 147 | {{.locale.Tr "signed_in_as"}} <strong>{{.SignedUser.Name}}</strong>
|
149 | 148 | </div>
|
150 | 149 |
|
151 | 150 | <div class="divider"></div>
|
152 | 151 | <a class="item" href="{{.SignedUser.HomeLink}}">
|
153 | 152 | {{svg "octicon-person"}}
|
154 |
| - {{.locale.Tr "your_profile"}}<!-- Your profile --> |
| 153 | + {{.locale.Tr "your_profile"}} |
155 | 154 | </a>
|
156 | 155 | {{if not .DisableStars}}
|
157 | 156 | <a class="item" href="{{.SignedUser.HomeLink}}?tab=stars">
|
|
161 | 160 | {{end}}
|
162 | 161 | <a class="item" href="{{AppSubUrl}}/notifications/subscriptions">
|
163 | 162 | {{svg "octicon-bell"}}
|
164 |
| - {{.locale.Tr "notification.subscriptions"}}<!-- Subscriptions --> |
| 163 | + {{.locale.Tr "notification.subscriptions"}} |
165 | 164 | </a>
|
166 | 165 | <a class="{{if .PageIsUserSettings}}active {{end}}item" href="{{AppSubUrl}}/user/settings">
|
167 | 166 | {{svg "octicon-tools"}}
|
168 |
| - {{.locale.Tr "your_settings"}}<!-- Your settings --> |
| 167 | + {{.locale.Tr "your_settings"}} |
169 | 168 | </a>
|
170 | 169 | <a class="item" target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io">
|
171 | 170 | {{svg "octicon-question"}}
|
172 |
| - {{.locale.Tr "help"}}<!-- Help --> |
| 171 | + {{.locale.Tr "help"}} |
173 | 172 | </a>
|
174 | 173 | {{if .IsAdmin}}
|
175 | 174 | <div class="divider"></div>
|
|
187 | 186 | </a>
|
188 | 187 | </div><!-- end content avatar menu -->
|
189 | 188 | </div><!-- end dropdown avatar menu -->
|
190 |
| - </div><!-- end signed user right menu --> |
191 |
| - {{else}} |
192 |
| - <a class="item" target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io">{{.locale.Tr "help"}}</a> |
193 |
| - <div class="right stackable menu"> |
| 189 | + {{else}} |
194 | 190 | {{if .ShowRegistrationButton}}
|
195 | 191 | <a class="item{{if .PageIsSignUp}} active{{end}}" href="{{AppSubUrl}}/user/sign_up">
|
196 | 192 | {{svg "octicon-person"}} {{.locale.Tr "register"}}
|
|
199 | 195 | <a class="item{{if .PageIsSignIn}} active{{end}}" rel="nofollow" href="{{AppSubUrl}}/user/login{{if not .PageIsSignIn}}?redirect_to={{.CurrentURL}}{{end}}">
|
200 | 196 | {{svg "octicon-sign-in"}} {{.locale.Tr "sign_in"}}
|
201 | 197 | </a>
|
202 |
| - </div><!-- end anonymous user right menu --> |
203 |
| - {{end}} |
| 198 | + {{end}} |
| 199 | + </div><!-- end full right menu --> |
204 | 200 | </nav>
|
0 commit comments