0
0
Fork 0

Adding index overview for reports in admin UI

This commit is contained in:
Eugen Rochko 2017-02-16 02:28:10 +01:00
parent f722aa8c75
commit 24ba7c9762
7 changed files with 54 additions and 2 deletions

View 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