about summary refs log tree commit diff
path: root/app/views/admin
diff options
context:
space:
mode:
authorMatt Jankowski <mjankowski@thoughtbot.com>2017-04-18 13:36:18 -0400
committerEugen <eugen@zeonfederated.com>2017-04-18 19:36:18 +0200
commit66d8f99a30f9e6062f1bff37d5115beddce9b55d (patch)
tree5f7c752043054bc86fb57faa89332660688044bc /app/views/admin
parentf23281e31ead38a1cabbb73f0dbb8b36cb38cadb (diff)
Admin reports with accounts (#2092)
* Add a ReportFilter class

* Add reports and targeted_reports relationships to Account

* Use ReportFilter from admin/reports controller

* Link to admin/reports filtered views from admin account show view

* Add indexes to reports.account_id and reports.target_account_id
Diffstat (limited to 'app/views/admin')
-rw-r--r--app/views/admin/accounts/show.html.haml6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/views/admin/accounts/show.html.haml b/app/views/admin/accounts/show.html.haml
index 7609868e6..ebf2b5ac1 100644
--- a/app/views/admin/accounts/show.html.haml
+++ b/app/views/admin/accounts/show.html.haml
@@ -60,6 +60,12 @@
         = @account.media_attachments.count
         = surround '(', ')' do
           = number_to_human_size @account.media_attachments.sum('file_file_size')
+    %tr
+      %th= t('.created_reports')
+      %td= link_to pluralize(@account.reports.count, t('.report')), admin_reports_path(account_id: @account.id)
+    %tr
+      %th= t('.targeted_reports')
+      %td= link_to pluralize(@account.targeted_reports.count, t('.report')), admin_reports_path(target_account_id: @account.id)
 
 - if @account.local?
   %div{ style: 'float: right' }