mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: show pinned topics for TL0 on top/year page
BUGFIX: word-wrap on topic-excerpt
This commit is contained in:
@@ -82,9 +82,12 @@ class TopicQuery
|
||||
def list_top_for(period)
|
||||
score = "#{period}_score"
|
||||
create_list(:top, unordered: true) do |topics|
|
||||
topics.joins(:top_topic)
|
||||
.where("top_topics.#{score} > 0")
|
||||
.order("top_topics.#{score} DESC, topics.bumped_at DESC")
|
||||
topics = topics.joins(:top_topic).where("top_topics.#{score} > 0")
|
||||
if period == :yearly && @user.try(:trust_level) == TrustLevel.levels[:newuser]
|
||||
topics.order(TopicQuerySQL.order_top_with_pinned_category_for(score))
|
||||
else
|
||||
topics.order(TopicQuerySQL.order_top_for(score))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user