FIX: Centralize Top rendering, remove old code paths. Fix some bugs.

This commit is contained in:
Robin Ward
2014-08-28 14:34:31 -04:00
parent 30b102aa98
commit 69cb5bc425
15 changed files with 42 additions and 250 deletions

View File

@@ -4,7 +4,8 @@ class TopicListSerializer < ApplicationSerializer
:more_topics_url,
:draft,
:draft_key,
:draft_sequence
:draft_sequence,
:for_period
has_many :topics, serializer: TopicListItemSerializer, embed: :objects
@@ -12,6 +13,10 @@ class TopicListSerializer < ApplicationSerializer
scope.can_create?(Topic)
end
def include_for_period?
for_period.present?
end
def include_more_topics_url?
object.more_topics_url.present? && (object.topics.size == SiteSetting.topics_per_page)
end