mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
Rename 'popular' to 'latest'. First stab at 'Hot' tab.
This commit is contained in:
parent
d1945057fd
commit
36269cfbaa
52 changed files with 946 additions and 323 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue