mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 19:14:43 +08:00
FEATURE: Add Archive Topics to Bulk actions
Add the ability to archive topics in bulk https://meta.discourse.org/t/archive-topics-via-bulk/20302
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