Add UI to view report details, remove reported statuses, quick links to resolve/silence/suspend from report

This commit is contained in:
Eugen Rochko
2017-02-17 00:42:52 +01:00
parent 9c88d1b99e
commit d0f087db2d
4 changed files with 118 additions and 3 deletions

View File

@ -2,6 +2,7 @@
class Admin::ReportsController < ApplicationController
before_action :require_admin!
before_action :set_report, except: [:index]
layout 'admin'
@ -11,7 +12,34 @@ class Admin::ReportsController < ApplicationController
end
def show
@report = Report.find(params[:id])
@statuses = Status.where(id: @report.status_ids)
end
def resolve
@report.update(action_taken: true)
redirect_to admin_report_path(@report)
end
def suspend
Admin::SuspensionWorker.perform_async(@report.target_account.id)
@report.update(action_taken: true)
redirect_to admin_report_path(@report)
end
def silence
@report.target_account.update(silenced: true)
@report.update(action_taken: true)
redirect_to admin_report_path(@report)
end
def remove
RemovalWorker.perform_async(params[:status_id])
redirect_to admin_report_path(@report)
end
private
def set_report
@report = Report.find(params[:id])
end
end