mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Merge pull request #2814 from cpradio/add-bulk-archive-option
FEATURE: Add Archive Topics to Bulk actions
This commit is contained in:
@@ -8,7 +8,7 @@ class TopicsBulkAction
|
||||
end
|
||||
|
||||
def self.operations
|
||||
%w(change_category close change_notification_level reset_read dismiss_posts delete)
|
||||
%w(change_category close archive change_notification_level reset_read dismiss_posts delete)
|
||||
end
|
||||
|
||||
def perform!
|
||||
@@ -61,6 +61,15 @@ class TopicsBulkAction
|
||||
end
|
||||
end
|
||||
|
||||
def archive
|
||||
topics.each do |t|
|
||||
if guardian.can_moderate?(t)
|
||||
t.update_status('archived', true, @user)
|
||||
@changed_ids << t.id
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def delete
|
||||
topics.each do |t|
|
||||
t.trash! if guardian.can_delete?(t)
|
||||
|
||||
Reference in New Issue
Block a user