mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 03:51:07 +08:00
REFACTOR: Fixes poor class hierarchy for listing topics
- Upgrades Ember to latest - Fixes a bunch of bugs with page titles and missing "active" states
This commit is contained in:
@ -24,23 +24,6 @@ module TopicQuerySQL
|
||||
END DESC"
|
||||
end
|
||||
|
||||
def order_hotness(user)
|
||||
if user
|
||||
# When logged in take into accounts what pins you've closed
|
||||
"CASE
|
||||
WHEN (COALESCE(topics.pinned_at, '#{lowest_date}') > COALESCE(tu.cleared_pinned_at, '#{lowest_date}'))
|
||||
THEN 100
|
||||
ELSE hot_topics.score + (COALESCE(categories.hotness, 5.0) / 11.0)
|
||||
END DESC"
|
||||
else
|
||||
# When anonymous, don't use topic_user
|
||||
"CASE
|
||||
WHEN topics.pinned_at IS NOT NULL THEN 100
|
||||
ELSE hot_topics.score + (COALESCE(categories.hotness, 5.0) / 11.0)
|
||||
END DESC"
|
||||
end
|
||||
end
|
||||
|
||||
def order_by_category_sql(dir)
|
||||
"CASE WHEN categories.id = #{SiteSetting.uncategorized_category_id.to_i} THEN '' ELSE categories.name END #{dir}"
|
||||
end
|
||||
|
Reference in New Issue
Block a user