mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Centralize Top rendering, remove old code paths. Fix some bugs.
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user