mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Show all Hot rankings at once with a toggle button
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user