Show all Hot rankings at once with a toggle button

This commit is contained in:
Robin Ward
2013-04-03 15:24:26 -04:00
parent bb18b6cb9b
commit 33f349a1e6
9 changed files with 103 additions and 54 deletions

View File

@@ -43,11 +43,7 @@ class TopicListItemSerializer < ListableTopicSerializer
end
def include_rank_details?
return false unless object.topic_list.present?
return false unless scope.user.present?
return false unless scope.user.admin?
object.topic_list.filter == :hot
object.topic_list.try(:has_rank_details?)
end
def posters

View File

@@ -5,10 +5,19 @@ class TopicListSerializer < ApplicationSerializer
:filter_summary,
:draft,
:draft_key,
:draft_sequence
:draft_sequence,
:can_view_rank_details
has_many :topics, serializer: TopicListItemSerializer, embed: :objects
def can_view_rank_details
true
end
def include_can_view_rank_details?
object.has_rank_details?
end
def can_create_topic
scope.can_create?(Topic)
end