diff --git a/html/template/sync/component/sidebar.html b/html/template/sync/component/sidebar.html
index 2d7ad0ed..800df9d9 100644
--- a/html/template/sync/component/sidebar.html
+++ b/html/template/sync/component/sidebar.html
@@ -84,6 +84,16 @@
>
+
+
+ unread notifications
+
diff --git a/platform/notification.go b/platform/notification.go
index 8f56a71a..3c61d3b7 100644
--- a/platform/notification.go
+++ b/platform/notification.go
@@ -30,6 +30,7 @@ type Notification struct {
type UserNotificationCounts struct {
Communications uint `json:"communication"`
Home uint `json:"home"`
+ Review uint `json:"review"`
}
// Clear all notifications for a given user with the given path
@@ -117,10 +118,17 @@ func NotificationCountsForUser(ctx context.Context, u User) (*UserNotificationCo
if err != nil {
return nil, fmt.Errorf("Failed to get nuisance notification count: %w", err)
}
- log.Debug().Int64("reports", count_reports).Int64("home", count_home).Int("user", u.ID).Msg("calculated notification counts")
+ count_review, err := u.Organization.model.ReviewTasks(
+ models.SelectWhere.ReviewTasks.Reviewed.IsNull(),
+ ).Count(ctx, db.PGInstance.BobDB)
+ if err != nil {
+ return nil, fmt.Errorf("Failed to get review notification count: %w", err)
+ }
+ log.Debug().Int64("reports", count_reports).Int64("home", count_home).Int64("review", count_review).Int("user", u.ID).Msg("calculated notification counts")
return &UserNotificationCounts{
Communications: uint(count_reports),
Home: uint(count_home),
+ Review: uint(count_review),
}, nil
}