gitea源码

1234567891011121314151617181920212223242526
  1. {{- $itemExtraClass := .ItemExtraClass -}}
  2. {{- $data := .PageGlobalData -}}
  3. {{if and $data $data.IsSigned}}{{/* data may not exist, for example: rendering 503 page before the PageGlobalData middleware */}}
  4. {{- $activeStopwatch := call $data.GetActiveStopwatch -}}
  5. {{- $notificationUnreadCount := call $data.GetNotificationUnreadCount -}}
  6. {{if $activeStopwatch}}
  7. <a class="item active-stopwatch {{$itemExtraClass}}" href="{{$activeStopwatch.IssueLink}}" title="{{ctx.Locale.Tr "active_stopwatch"}}" data-seconds="{{$activeStopwatch.Seconds}}">
  8. <div class="tw-relative">
  9. {{svg "octicon-stopwatch"}}
  10. <span class="header-stopwatch-dot"></span>
  11. </div>
  12. </a>
  13. {{end}}
  14. <a class="item {{$itemExtraClass}}" href="{{AppSubUrl}}/notifications" data-tooltip-content="{{ctx.Locale.Tr "notifications"}}">
  15. <div class="tw-relative">
  16. {{svg "octicon-bell"}}
  17. <span class="notification_count{{if not $notificationUnreadCount}} tw-hidden{{end}}">{{$notificationUnreadCount}}</span>
  18. </div>
  19. </a>
  20. {{if $data.IsSiteAdmin}}
  21. <a class="item {{$itemExtraClass}}" href="{{AppSubUrl}}/-/admin" data-tooltip-content="{{ctx.Locale.Tr "admin_panel"}}">
  22. {{svg "octicon-server"}}
  23. </a>
  24. {{end}}
  25. {{end}}