about summary refs log tree commit diff
path: root/app/controllers/admin
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-02-16 02:28:10 +0100
committerEugen Rochko <eugen@zeonfederated.com>2017-02-16 02:28:10 +0100
commit24ba7c9762a583f3e1105162f4a43a22a17a4627 (patch)
tree986ce96eb821cdb964f509d42678a397c7060c6b /app/controllers/admin
parentf722aa8c7560c91a054868e7a0294c06a210415e (diff)
Adding index overview for reports in admin UI
Diffstat (limited to 'app/controllers/admin')
-rw-r--r--app/controllers/admin/reports_controller.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/app/controllers/admin/reports_controller.rb b/app/controllers/admin/reports_controller.rb
new file mode 100644
index 000000000..3eb5ab517
--- /dev/null
+++ b/app/controllers/admin/reports_controller.rb
@@ -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