mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
If there are pending posts in a topic, display a message at the bottom
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
require_dependency 'pinned_check'
|
||||
require_dependency 'new_post_manager'
|
||||
|
||||
class TopicViewSerializer < ApplicationSerializer
|
||||
include PostStreamSerializerMixin
|
||||
@@ -30,7 +31,8 @@ class TopicViewSerializer < ApplicationSerializer
|
||||
:slug,
|
||||
:category_id,
|
||||
:word_count,
|
||||
:deleted_at
|
||||
:deleted_at,
|
||||
:pending_posts_count
|
||||
|
||||
attributes :draft,
|
||||
:draft_key,
|
||||
@@ -206,4 +208,8 @@ class TopicViewSerializer < ApplicationSerializer
|
||||
object.topic_user.try(:bookmarked)
|
||||
end
|
||||
|
||||
def include_pending_posts_count
|
||||
scope.user.staff? && NewPostManager.queue_enabled?
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user