mirror of
https://github.com/discourse/discourse.git
synced 2025-06-05 14:07:30 +08:00
FEATURE: better top pages
This commit is contained in:
@ -89,11 +89,17 @@ class TopicQuery
|
||||
score = "#{period}_score"
|
||||
create_list(:top, unordered: true) do |topics|
|
||||
topics.joins(:top_topic)
|
||||
.where("top_topics.#{score} > 1")
|
||||
.where("top_topics.#{score} > 0")
|
||||
.order("top_topics.#{score} DESC, topics.bumped_at DESC")
|
||||
end
|
||||
end
|
||||
|
||||
TopTopic.periods.each do |period|
|
||||
define_method("list_top_#{period}") do
|
||||
list_top_for(period)
|
||||
end
|
||||
end
|
||||
|
||||
def list_topics_by(user)
|
||||
create_list(:user_topics) do |topics|
|
||||
topics.where(user_id: user.id)
|
||||
|
Reference in New Issue
Block a user