If there are pending posts in a topic, display a message at the bottom

This commit is contained in:
Robin Ward
2015-04-27 15:55:10 -04:00
parent ecafbb0a63
commit 8c930c97e0
5 changed files with 36 additions and 1 deletions

View File

@@ -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