FEATURE: Modal for profile featured topic & admin wrench refactor (#8545)

This commit is contained in:
Mark VanLandingham
2019-12-16 08:41:34 -08:00
committed by GitHub
parent 7b6bafc651
commit 8c4ffaea1b
21 changed files with 525 additions and 255 deletions

View File

@@ -303,6 +303,14 @@ class Search
posts.where('topics.closed')
end
advanced_filter(/^status:public$/) do |posts|
category_ids = Category
.where(read_restricted: false)
.pluck(:id)
posts.where("topics.category_id in (?)", category_ids)
end
advanced_filter(/^status:archived$/) do |posts|
posts.where('topics.archived')
end
@@ -370,6 +378,10 @@ class Search
posts.where("posts.user_id = #{@guardian.user.id}") if @guardian.user
end
advanced_filter(/^in:created$/) do |posts|
posts.where(user_id: @guardian.user.id, post_number: 1) if @guardian.user
end
advanced_filter(/^in:(watching|tracking)$/) do |posts, match|
if @guardian.user
level = TopicUser.notification_levels[match.to_sym]