mirror of
https://github.com/discourse/discourse.git
synced 2025-06-05 08:07:17 +08:00
FEATURE: Can bulk update the notification level of topics
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user