mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
Rename 'popular' to 'latest'. First stab at 'Hot' tab.
This commit is contained in:
@ -103,8 +103,8 @@ class TopicQuery
|
||||
TopicList.new(@user, results)
|
||||
end
|
||||
|
||||
# The popular view of topics
|
||||
def list_popular
|
||||
# The latest view of topics
|
||||
def list_latest
|
||||
TopicList.new(@user, default_list)
|
||||
end
|
||||
|
||||
@ -121,6 +121,16 @@ class TopicQuery
|
||||
end
|
||||
end
|
||||
|
||||
def list_hot
|
||||
return_list(unordered: true) do |list|
|
||||
|
||||
# Let's not include topic categories on hot
|
||||
list = list.where("categories.topic_id <> topics.id")
|
||||
|
||||
list =list.order("coalesce(categories.hotness, 5) desc, topics.bumped_at desc")
|
||||
end
|
||||
end
|
||||
|
||||
def list_new
|
||||
TopicList.new(@user, new_results)
|
||||
end
|
||||
|
Reference in New Issue
Block a user