aboutsummaryrefslogtreecommitdiffstats
path: root/templates/base
diff options
context:
space:
mode:
authorTyrone Yeh <siryeh@gmail.com>2022-07-04 22:44:34 +0800
committerGitHub <noreply@github.com>2022-07-04 22:44:34 +0800
commitc174bdc494e44ac6b52373e86b7a3ac225091a80 (patch)
tree702377983d27808d72ae96d921e5f7595d9d7fc8 /templates/base
parent2921d3c8c9ea17941e4da4381e6fb3177cd7d37d (diff)
downloadgitea-c174bdc494e44ac6b52373e86b7a3ac225091a80.tar.gz
gitea-c174bdc494e44ac6b52373e86b7a3ac225091a80.zip
Adjust template for #20069 smallbell (#20108)
* Adjust template for #20069 smallbell * Adjust notification Unread Count variable to global and count bell position with mobile * Adjust bell icon style * Adjust smallbell to middle * Avoid using inline styles * move notificationUnreadCount to a general code block, reduce changed lines * Solved conflicts Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: 6543 <6543@obermui.de>
Diffstat (limited to 'templates/base')
-rw-r--r--templates/base/head_navbar.tmpl19
1 files changed, 15 insertions, 4 deletions
diff --git a/templates/base/head_navbar.tmpl b/templates/base/head_navbar.tmpl
index b04d8bcbb3..91529dc163 100644
--- a/templates/base/head_navbar.tmpl
+++ b/templates/base/head_navbar.tmpl
@@ -1,8 +1,22 @@
<div class="ui container" id="navbar">
+ {{$notificationUnreadCount := 0}}
+ {{if .IsSigned}}
+ {{if .NotificationUnreadCount}}{{$notificationUnreadCount = call .NotificationUnreadCount}}{{end}}
+ {{end}}
<div class="item brand" style="justify-content: space-between;">
<a href="{{AppSubUrl}}/" aria-label="{{if .IsSigned}}{{.locale.Tr "dashboard"}}{{else}}{{.locale.Tr "home"}}{{end}}">
<img class="ui mini image" width="30" height="30" src="{{AssetUrlPrefix}}/img/logo.svg" alt="{{.locale.Tr "logo"}}" aria-hidden="true">
</a>
+ {{if .IsSigned}}
+ <a href="{{AppSubUrl}}/notifications" class="tooltip mobile-only" data-content='{{.i18n.Tr "notifications"}}'>
+ <span class="text black">
+ <span class="fitted">{{svg "octicon-bell"}}</span>
+ <span class="ui red label mini{{if not $notificationUnreadCount}} hidden{{end}} notification_count">
+ {{$notificationUnreadCount}}
+ </span>
+ </span>
+ </a>
+ {{end}}
<div class="ui basic icon button mobile-only" id="navbar-expand-toggle">
<i class="sidebar icon"></i>
</div>
@@ -100,12 +114,9 @@
</div>
</div>
- <a href="{{AppSubUrl}}/notifications" class="item tooltip" data-content='{{.locale.Tr "notifications"}}'>
+ <a href="{{AppSubUrl}}/notifications" class="item tooltip not-mobile" data-content='{{.locale.Tr "notifications"}}'>
<span class="text">
<span class="fitted">{{svg "octicon-bell"}}</span>
- <span class="sr-mobile-only">{{.locale.Tr "notifications"}}</span>
- {{$notificationUnreadCount := 0}}
- {{if .NotificationUnreadCount}}{{$notificationUnreadCount = call .NotificationUnreadCount}}{{end}}
<span class="ui red label {{if not $notificationUnreadCount}}hidden{{end}} notification_count">
{{$notificationUnreadCount}}
</span>