Adding index overview for reports in admin UI
This commit is contained in:
parent
f722aa8c75
commit
24ba7c9762
7 changed files with 54 additions and 2 deletions
17
app/controllers/admin/reports_controller.rb
Normal file
17
app/controllers/admin/reports_controller.rb
Normal file
|
@ -0,0 +1,17 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Admin::ReportsController < ApplicationController
|
||||
before_action :require_admin!
|
||||
|
||||
layout 'admin'
|
||||
|
||||
def index
|
||||
@reports = Report.includes(:account, :target_account).paginate(page: params[:page], per_page: 40)
|
||||
@reports = params[:action_taken].present? ? @reports.resolved : @reports.unresolved
|
||||
end
|
||||
|
||||
def show
|
||||
@report = Report.find(params[:id])
|
||||
@statuses = Status.where(id: @report.status_ids)
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue