|
1 | 1 | {{$notificationUnreadCount := 0}} |
2 | 2 | {{if and .IsSigned .NotificationUnreadCount}} |
3 | | - {{$notificationUnreadCount = call .NotificationUnreadCount}} |
| 3 | + {{$notificationUnreadCount = call .NotificationUnreadCount ctx}} |
| 4 | +{{end}} |
| 5 | +{{$activeStopwatch := NIL}} |
| 6 | +{{if and .IsSigned EnableTimetracking .GetActiveStopwatch}} |
| 7 | + {{$activeStopwatch = call .GetActiveStopwatch ctx}} |
4 | 8 | {{end}} |
5 | | - |
6 | 9 | <nav id="navbar" aria-label="{{ctx.Locale.Tr "aria.navbar"}}"> |
7 | 10 | <div class="navbar-left"> |
8 | 11 | <!-- the logo --> |
|
12 | 15 |
|
13 | 16 | <!-- 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 | 17 | <div class="ui secondary menu navbar-mobile-right only-mobile"> |
15 | | - {{if and .IsSigned EnableTimetracking .ActiveStopwatch}} |
16 | | - <a id="mobile-stopwatch-icon" class="active-stopwatch item" href="{{.ActiveStopwatch.IssueLink}}" title="{{ctx.Locale.Tr "active_stopwatch"}}" data-seconds="{{.ActiveStopwatch.Seconds}}"> |
| 18 | + {{if $activeStopwatch}} |
| 19 | + <a id="mobile-stopwatch-icon" class="active-stopwatch item" href="{{$activeStopwatch.IssueLink}}" title="{{ctx.Locale.Tr "active_stopwatch"}}" data-seconds="{{$activeStopwatch.Seconds}}"> |
17 | 20 | <div class="tw-relative"> |
18 | 21 | {{svg "octicon-stopwatch"}} |
19 | 22 | <span class="header-stopwatch-dot"></span> |
|
82 | 85 | </div><!-- end content avatar menu --> |
83 | 86 | </div><!-- end dropdown avatar menu --> |
84 | 87 | {{else if .IsSigned}} |
85 | | - {{if and EnableTimetracking .ActiveStopwatch}} |
86 | | - <a class="item not-mobile active-stopwatch" href="{{.ActiveStopwatch.IssueLink}}" title="{{ctx.Locale.Tr "active_stopwatch"}}" data-seconds="{{.ActiveStopwatch.Seconds}}"> |
| 88 | + {{if $activeStopwatch}} |
| 89 | + <a class="item not-mobile active-stopwatch" href="{{$activeStopwatch.IssueLink}}" title="{{ctx.Locale.Tr "active_stopwatch"}}" data-seconds="{{$activeStopwatch.Seconds}}"> |
87 | 90 | <div class="tw-relative"> |
88 | 91 | {{svg "octicon-stopwatch"}} |
89 | 92 | <span class="header-stopwatch-dot"></span> |
|
186 | 189 | {{end}} |
187 | 190 | </div><!-- end full right menu --> |
188 | 191 |
|
189 | | - {{if and .IsSigned EnableTimetracking .ActiveStopwatch}} |
| 192 | + {{if $activeStopwatch}} |
190 | 193 | <div class="active-stopwatch-popup tippy-target"> |
191 | 194 | <div class="tw-flex tw-items-center tw-gap-2 tw-p-3"> |
192 | | - <a class="stopwatch-link tw-flex tw-items-center tw-gap-2 muted" href="{{.ActiveStopwatch.IssueLink}}"> |
| 195 | + <a class="stopwatch-link tw-flex tw-items-center tw-gap-2 muted" href="{{$activeStopwatch.IssueLink}}"> |
193 | 196 | {{svg "octicon-issue-opened" 16}} |
194 | | - <span class="stopwatch-issue">{{.ActiveStopwatch.RepoSlug}}#{{.ActiveStopwatch.IssueIndex}}</span> |
| 197 | + <span class="stopwatch-issue">{{$activeStopwatch.RepoSlug}}#{{$activeStopwatch.IssueIndex}}</span> |
195 | 198 | </a> |
196 | 199 | <div class="tw-flex tw-gap-1"> |
197 | | - <form class="stopwatch-commit form-fetch-action" method="post" action="{{.ActiveStopwatch.IssueLink}}/times/stopwatch/toggle"> |
| 200 | + <form class="stopwatch-commit form-fetch-action" method="post" action="{{$activeStopwatch.IssueLink}}/times/stopwatch/toggle"> |
198 | 201 | {{.CsrfTokenHtml}} |
199 | 202 | <button |
200 | 203 | type="submit" |
201 | 204 | class="ui button mini compact basic icon tw-mr-0" |
202 | 205 | data-tooltip-content="{{ctx.Locale.Tr "repo.issues.stop_tracking"}}" |
203 | 206 | >{{svg "octicon-square-fill"}}</button> |
204 | 207 | </form> |
205 | | - <form class="stopwatch-cancel form-fetch-action" method="post" action="{{.ActiveStopwatch.IssueLink}}/times/stopwatch/cancel"> |
| 208 | + <form class="stopwatch-cancel form-fetch-action" method="post" action="{{$activeStopwatch.IssueLink}}/times/stopwatch/cancel"> |
206 | 209 | {{.CsrfTokenHtml}} |
207 | 210 | <button |
208 | 211 | type="submit" |
|
0 commit comments