diff options
-rw-r--r-- | renderer/model.go | 1 | ||||
-rw-r--r-- | service/service.go | 1 | ||||
-rw-r--r-- | templates/header.tmpl | 2 |
3 files changed, 3 insertions, 1 deletions
diff --git a/renderer/model.go b/renderer/model.go index 0d89af7..96907b3 100644 --- a/renderer/model.go +++ b/renderer/model.go @@ -24,6 +24,7 @@ type CommonData struct { Title string CustomCSS string CSRFToken string + Count int AutoRefresh bool Target string } diff --git a/service/service.go b/service/service.go index f5d78aa..2504f43 100644 --- a/service/service.go +++ b/service/service.go @@ -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, diff --git a/templates/header.tmpl b/templates/header.tmpl index ca2986d..8e67353 100644 --- a/templates/header.tmpl +++ b/templates/header.tmpl @@ -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}}"> |