mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 11:02:46 +08:00
Switch to count of all notifications
This commit is contained in:
parent
5dfd3fc8eb
commit
637371e60a
|
@ -28,7 +28,7 @@
|
|||
{{#link-to 'user.notifications'}}
|
||||
<i class='glyph fa fa-comment'></i>
|
||||
{{i18n user.notifications}}
|
||||
<span class='count'>({{unread_notification_count}})</span>
|
||||
<span class='count'>({{notification_count}})</span>
|
||||
<span class='fa fa-chevron-right'></span>
|
||||
{{/link-to}}
|
||||
{{/link-to}}
|
||||
|
|
|
@ -43,7 +43,7 @@ class UserSerializer < BasicUserSerializer
|
|||
:suspended_till,
|
||||
:uploaded_avatar_id,
|
||||
:badge_count,
|
||||
:unread_notification_count,
|
||||
:notification_count,
|
||||
:has_title_badges,
|
||||
:edit_history_public,
|
||||
:custom_fields
|
||||
|
@ -77,7 +77,7 @@ class UserSerializer < BasicUserSerializer
|
|||
:tracked_category_ids,
|
||||
:watched_category_ids,
|
||||
:private_messages_stats,
|
||||
:unread_notification_count,
|
||||
:notification_count,
|
||||
:disable_jump_reply,
|
||||
:gravatar_avatar_upload_id,
|
||||
:custom_avatar_upload_id,
|
||||
|
@ -244,8 +244,8 @@ class UserSerializer < BasicUserSerializer
|
|||
object.badges.where(allow_title: true).count > 0
|
||||
end
|
||||
|
||||
def unread_notification_count
|
||||
Notification.where(user_id: object.id, read: false).count
|
||||
def notification_count
|
||||
Notification.where(user_id: object.id).count
|
||||
end
|
||||
|
||||
def include_edit_history_public?
|
||||
|
|
Loading…
Reference in New Issue
Block a user