FEATURE: Can bulk update the notification level of topics

This commit is contained in:
Robin Ward
2014-02-14 17:38:55 -05:00
parent d0ecccb7e4
commit 3f3c07f136
11 changed files with 113 additions and 5 deletions

View File

@ -8,7 +8,7 @@ class TopicsBulkAction
end
def self.operations
%w(change_category close)
%w(change_category close change_notification_level)
end
def perform!
@ -27,6 +27,15 @@ class TopicsBulkAction
end
end
def change_notification_level
topics.each do |t|
if guardian.can_see?(t)
TopicUser.change(@user, t.id, notification_level: @operation[:notification_level_id].to_i)
@changed_ids << t.id
end
end
end
def close
topics.each do |t|
if guardian.can_moderate?(t)