Add notification count in page title

This commit is contained in:
r 2020-02-26 10:27:17 +00:00
parent 4ac5022cf1
commit a57a142328
3 changed files with 3 additions and 1 deletions

View file

@ -24,6 +24,7 @@ type CommonData struct {
Title string
CustomCSS string
CSRFToken string
Count int
AutoRefresh bool
Target string
}

View file

@ -424,6 +424,7 @@ func (svc *service) ServeNotificationPage(ctx context.Context, c *model.Client,
commonData := svc.getCommonData(ctx, c, "notifications")
commonData.AutoRefresh = c.Session.Settings.AutoRefreshNotifications
commonData.Target = "main"
commonData.Count = unreadCount
data := &renderer.NotificationData{
Notifications: notifications,
UnreadCount: unreadCount,

View file

@ -13,7 +13,7 @@
{{if .AutoRefresh}}
<meta http-equiv="refresh" content="30">
{{end}}
<title>{{.Title}}</title>
<title> {{if gt .Count 0}}({{.Count}}){{end}} {{.Title}} </title>
<link rel="stylesheet" href="/static/style.css">
{{if .CustomCSS}}
<link rel="stylesheet" href="{{.CustomCSS}}">