Merge pull request #2814 from cpradio/add-bulk-archive-option

FEATURE: Add Archive Topics to Bulk actions
This commit is contained in:
Robin Ward
2014-09-22 15:01:40 -04:00
5 changed files with 54 additions and 6 deletions

View File

@@ -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)