mirror of
https://github.com/discourse/discourse.git
synced 2025-06-02 16:12:05 +08:00
FEATURE: New 'Reviewable' model to make reviewable items generic
Includes support for flags, reviewable users and queued posts, with REST API backwards compatibility. Co-Authored-By: romanrizzi <romanalejandro@gmail.com> Co-Authored-By: jjaffeux <j.jaffeux@gmail.com>
This commit is contained in:
@ -8,7 +8,6 @@ class CurrentUserSerializer < BasicUserSerializer
|
||||
:read_first_notification?,
|
||||
:admin?,
|
||||
:notification_channel_position,
|
||||
:site_flagged_posts_count,
|
||||
:moderator?,
|
||||
:staff?,
|
||||
:title,
|
||||
@ -30,8 +29,7 @@ class CurrentUserSerializer < BasicUserSerializer
|
||||
:muted_category_ids,
|
||||
:dismissed_banner_key,
|
||||
:is_anonymous,
|
||||
:post_queue_new_count,
|
||||
:show_queued_posts,
|
||||
:reviewable_count,
|
||||
:read_faq,
|
||||
:automatically_unpin_topics,
|
||||
:mailing_list_mode,
|
||||
@ -58,10 +56,6 @@ class CurrentUserSerializer < BasicUserSerializer
|
||||
scope.can_create_topic?(nil)
|
||||
end
|
||||
|
||||
def include_site_flagged_posts_count?
|
||||
object.staff?
|
||||
end
|
||||
|
||||
def read_faq
|
||||
object.user_stat.read_faq?
|
||||
end
|
||||
@ -106,10 +100,6 @@ class CurrentUserSerializer < BasicUserSerializer
|
||||
object.user_option.redirected_to_top
|
||||
end
|
||||
|
||||
def site_flagged_posts_count
|
||||
PostAction.flagged_posts_count
|
||||
end
|
||||
|
||||
def can_send_private_email_messages
|
||||
scope.can_send_private_messages_to_email?
|
||||
end
|
||||
@ -189,20 +179,8 @@ class CurrentUserSerializer < BasicUserSerializer
|
||||
object.anonymous?
|
||||
end
|
||||
|
||||
def post_queue_new_count
|
||||
QueuedPost.new_count
|
||||
end
|
||||
|
||||
def include_post_queue_new_count?
|
||||
object.staff?
|
||||
end
|
||||
|
||||
def show_queued_posts
|
||||
true
|
||||
end
|
||||
|
||||
def include_show_queued_posts?
|
||||
object.staff? && (NewPostManager.queue_enabled? || QueuedPost.new_count > 0)
|
||||
def reviewable_count
|
||||
Reviewable.list_for(object).count
|
||||
end
|
||||
|
||||
def mailing_list_mode
|
||||
|
Reference in New Issue
Block a user