Add ability to view previous edits of a status in admin UI (#19462)
* Add ability to view previous edits of a status in admin UI * Change moderator access to posts to be controlled by a separate policy
This commit is contained in:
parent
dee69be60e
commit
f8ca3bb2a1
16 changed files with 232 additions and 55 deletions
|
@ -3,18 +3,23 @@
|
|||
module Admin
|
||||
class StatusesController < BaseController
|
||||
before_action :set_account
|
||||
before_action :set_statuses
|
||||
before_action :set_statuses, except: :show
|
||||
before_action :set_status, only: :show
|
||||
|
||||
PER_PAGE = 20
|
||||
|
||||
def index
|
||||
authorize :status, :index?
|
||||
authorize [:admin, :status], :index?
|
||||
|
||||
@status_batch_action = Admin::StatusBatchAction.new
|
||||
end
|
||||
|
||||
def show
|
||||
authorize [:admin, @status], :show?
|
||||
end
|
||||
|
||||
def batch
|
||||
authorize :status, :index?
|
||||
authorize [:admin, :status], :index?
|
||||
|
||||
@status_batch_action = Admin::StatusBatchAction.new(admin_status_batch_action_params.merge(current_account: current_account, report_id: params[:report_id], type: action_from_button))
|
||||
@status_batch_action.save!
|
||||
|
@ -32,6 +37,7 @@ module Admin
|
|||
|
||||
def after_create_redirect_path
|
||||
report_id = @status_batch_action&.report_id || params[:report_id]
|
||||
|
||||
if report_id.present?
|
||||
admin_report_path(report_id)
|
||||
else
|
||||
|
@ -43,6 +49,10 @@ module Admin
|
|||
@account = Account.find(params[:account_id])
|
||||
end
|
||||
|
||||
def set_status
|
||||
@status = @account.statuses.find(params[:id])
|
||||
end
|
||||
|
||||
def set_statuses
|
||||
@statuses = Admin::StatusFilter.new(@account, filter_params).results.preload(:application, :preloadable_poll, :media_attachments, active_mentions: :account, reblog: [:account, :application, :preloadable_poll, :media_attachments, active_mentions: :account]).page(params[:page]).per(PER_PAGE)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue