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