mirror of
https://git.phreedom.club/localhost_frssoft/bloat.git
synced 2024-11-22 12:01:27 +00:00
Add notification count in page title
This commit is contained in:
parent
4ac5022cf1
commit
a57a142328
|
@ -24,6 +24,7 @@ type CommonData struct {
|
||||||
Title string
|
Title string
|
||||||
CustomCSS string
|
CustomCSS string
|
||||||
CSRFToken string
|
CSRFToken string
|
||||||
|
Count int
|
||||||
AutoRefresh bool
|
AutoRefresh bool
|
||||||
Target string
|
Target string
|
||||||
}
|
}
|
||||||
|
|
|
@ -424,6 +424,7 @@ func (svc *service) ServeNotificationPage(ctx context.Context, c *model.Client,
|
||||||
commonData := svc.getCommonData(ctx, c, "notifications")
|
commonData := svc.getCommonData(ctx, c, "notifications")
|
||||||
commonData.AutoRefresh = c.Session.Settings.AutoRefreshNotifications
|
commonData.AutoRefresh = c.Session.Settings.AutoRefreshNotifications
|
||||||
commonData.Target = "main"
|
commonData.Target = "main"
|
||||||
|
commonData.Count = unreadCount
|
||||||
data := &renderer.NotificationData{
|
data := &renderer.NotificationData{
|
||||||
Notifications: notifications,
|
Notifications: notifications,
|
||||||
UnreadCount: unreadCount,
|
UnreadCount: unreadCount,
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
{{if .AutoRefresh}}
|
{{if .AutoRefresh}}
|
||||||
<meta http-equiv="refresh" content="30">
|
<meta http-equiv="refresh" content="30">
|
||||||
{{end}}
|
{{end}}
|
||||||
<title>{{.Title}}</title>
|
<title> {{if gt .Count 0}}({{.Count}}){{end}} {{.Title}} </title>
|
||||||
<link rel="stylesheet" href="/static/style.css">
|
<link rel="stylesheet" href="/static/style.css">
|
||||||
{{if .CustomCSS}}
|
{{if .CustomCSS}}
|
||||||
<link rel="stylesheet" href="{{.CustomCSS}}">
|
<link rel="stylesheet" href="{{.CustomCSS}}">
|
||||||
|
|
Loading…
Reference in a new issue