Added/Updated admin dashboard tables
• Added: - New Account filtering - PreviewCard viewing/sorting/filtering deleting (todo) - DeletePreviewCardWorker, Service - Status viewing/sorting/filtering deleting - ChatMessage viewing/sorting/filtering deleting (todo) - Account > Follows view • Updated: - LinkBlock to sort alphabetically - Groups to be under "Moderation" instead of "Admin" in navigation.rb - Status in admin to have group name/link - Reports reset button - Group filtering/sorting - LinkBlock filtering/sorting - Account now has bio and few more data points in dashboard
This commit is contained in:
26
app/models/form/preview_card_batch.rb
Normal file
26
app/models/form/preview_card_batch.rb
Normal file
@@ -0,0 +1,26 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class Form::PreviewCardBatch
|
||||
include ActiveModel::Model
|
||||
include AccountableConcern
|
||||
|
||||
attr_accessor :preview_card_ids, :action, :current_account
|
||||
|
||||
def save
|
||||
case action
|
||||
when 'delete'
|
||||
delete_preview_cards
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def delete_preview_cards
|
||||
PreviewCard.where(id: preview_card_ids).reorder(nil).find_each do |preview_card|
|
||||
DeletePreviewCardWorker.perform_async(preview_card.id)
|
||||
log_action :destroy, preview_card
|
||||
end
|
||||
|
||||
true
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user