Skip to content

Commit 3814116

Browse files
tyroneyehwxiaoguanglunny6543
authored andcommitted
Adjust template for go-gitea#20069 smallbell (go-gitea#20108)
* Adjust template for go-gitea#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 <[email protected]> Co-authored-by: Lunny Xiao <[email protected]> Co-authored-by: 6543 <[email protected]>
1 parent 31c847c commit 3814116

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

templates/base/head_navbar.tmpl

+15-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,22 @@
11
<div class="ui container" id="navbar">
2+
{{$notificationUnreadCount := 0}}
3+
{{if .IsSigned}}
4+
{{if .NotificationUnreadCount}}{{$notificationUnreadCount = call .NotificationUnreadCount}}{{end}}
5+
{{end}}
26
<div class="item brand" style="justify-content: space-between;">
37
<a href="{{AppSubUrl}}/" aria-label="{{if .IsSigned}}{{.locale.Tr "dashboard"}}{{else}}{{.locale.Tr "home"}}{{end}}">
48
<img class="ui mini image" width="30" height="30" src="{{AssetUrlPrefix}}/img/logo.svg" alt="{{.locale.Tr "logo"}}" aria-hidden="true">
59
</a>
10+
{{if .IsSigned}}
11+
<a href="{{AppSubUrl}}/notifications" class="tooltip mobile-only" data-content='{{.i18n.Tr "notifications"}}'>
12+
<span class="text black">
13+
<span class="fitted">{{svg "octicon-bell"}}</span>
14+
<span class="ui red label mini{{if not $notificationUnreadCount}} hidden{{end}} notification_count">
15+
{{$notificationUnreadCount}}
16+
</span>
17+
</span>
18+
</a>
19+
{{end}}
620
<div class="ui basic icon button mobile-only" id="navbar-expand-toggle">
721
<i class="sidebar icon"></i>
822
</div>
@@ -100,12 +114,9 @@
100114
</div>
101115
</div>
102116

103-
<a href="{{AppSubUrl}}/notifications" class="item tooltip" data-content='{{.locale.Tr "notifications"}}'>
117+
<a href="{{AppSubUrl}}/notifications" class="item tooltip not-mobile" data-content='{{.locale.Tr "notifications"}}'>
104118
<span class="text">
105119
<span class="fitted">{{svg "octicon-bell"}}</span>
106-
<span class="sr-mobile-only">{{.locale.Tr "notifications"}}</span>
107-
{{$notificationUnreadCount := 0}}
108-
{{if .NotificationUnreadCount}}{{$notificationUnreadCount = call .NotificationUnreadCount}}{{end}}
109120
<span class="ui red label {{if not $notificationUnreadCount}}hidden{{end}} notification_count">
110121
{{$notificationUnreadCount}}
111122
</span>

0 commit comments

Comments
 (0)