mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-10 08:42:00 +02:00
* Fix #5796 Global shortcuts can be easily introduced by adding "data-shortcut-keys" to the elements --------- Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
47 lines
2.3 KiB
Handlebars
47 lines
2.3 KiB
Handlebars
{{- $data := ctx.RootData.PageGlobalData}}{{/* data may not exist, for example: rendering 503 page before the PageGlobalData middleware */}}
|
|
{{if and $data $data.IsSigned (not ctx.RootData.MustChangePassword) -}}
|
|
{{if EnableTimetracking}}
|
|
{{$activeStopwatch := call $data.GetActiveStopwatch -}}
|
|
{{/* always rendered so a real-time push can reveal it without a reload */}}
|
|
<button type="button" class="item btn active-stopwatch {{if not $activeStopwatch}}tw-hidden{{end}}" title="{{ctx.Locale.Tr "active_stopwatch"}}" data-global-init="initActiveStopwatchNotification" {{if $activeStopwatch}}data-seconds="{{$activeStopwatch.Seconds}}"{{end}}>
|
|
<span class="tw-relative flex-text-block">
|
|
{{svg "octicon-stopwatch"}}
|
|
<span class="header-stopwatch-dot"></span>
|
|
</span>
|
|
</button>
|
|
{{if not $activeStopwatch}}{{$activeStopwatch = dict}}{{end}}{{/* mock an empty stopwatch */}}
|
|
<div class="tippy-target">
|
|
<div class="flex-text-block tw-p-3">
|
|
<a class="stopwatch-link flex-text-block muted" href="{{$activeStopwatch.IssueLink}}">
|
|
{{svg "octicon-issue-opened" 16}}
|
|
<span class="stopwatch-issue">{{$activeStopwatch.RepoSlug}}#{{$activeStopwatch.IssueIndex}}</span>
|
|
</a>
|
|
<div class="flex-text-inline">
|
|
<form class="stopwatch-commit form-fetch-action" method="post" action="{{$activeStopwatch.IssueLink}}/times/stopwatch/stop">
|
|
<button
|
|
type="submit"
|
|
class="ui button mini compact basic icon"
|
|
data-tooltip-content="{{ctx.Locale.Tr "repo.issues.stop_tracking"}}"
|
|
>{{svg "octicon-square-fill"}}</button>
|
|
</form>
|
|
<form class="stopwatch-cancel form-fetch-action" method="post" action="{{$activeStopwatch.IssueLink}}/times/stopwatch/cancel">
|
|
<button
|
|
type="submit"
|
|
class="ui button mini compact basic icon"
|
|
data-tooltip-content="{{ctx.Locale.Tr "repo.issues.cancel_tracking"}}"
|
|
>{{svg "octicon-trash"}}</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{{end}}
|
|
|
|
{{$notificationUnreadCount := call $data.GetNotificationUnreadCount -}}
|
|
<a class="item" href="{{AppSubUrl}}/notifications" data-tooltip-content="{{ctx.Locale.Tr "notifications"}}" data-shortcut-keys="g n">
|
|
<div class="tw-relative flex-text-block">
|
|
{{svg "octicon-bell"}}
|
|
<span class="notification_count{{if not $notificationUnreadCount}} tw-hidden{{end}}">{{$notificationUnreadCount}}</span>
|
|
</div>
|
|
</a>
|
|
{{end}}
|