about summary refs log tree commit diff
path: root/app/views/admin/reports
diff options
context:
space:
mode:
authorMatt Jankowski <mjankowski@thoughtbot.com>2017-05-02 14:56:28 -0400
committerEugen Rochko <eugen@zeonfederated.com>2017-05-02 20:56:28 +0200
commitb5eec3423044f66066d64bd5c9422f40113c543a (patch)
tree253ae02c771888fe7c84d32383bc838fb626a45c /app/views/admin/reports
parent212868216230120b63b162ab40cf271deadadd63 (diff)
Add admin area view partials for each record type (#2700)
Diffstat (limited to 'app/views/admin/reports')
-rw-r--r--app/views/admin/reports/_report.html.haml21
-rw-r--r--app/views/admin/reports/index.html.haml20
2 files changed, 22 insertions, 19 deletions
diff --git a/app/views/admin/reports/_report.html.haml b/app/views/admin/reports/_report.html.haml
new file mode 100644
index 000000000..2be1f8f2a
--- /dev/null
+++ b/app/views/admin/reports/_report.html.haml
@@ -0,0 +1,21 @@
+%tr
+  %td.id
+    = "##{report.id}"
+  %td.target
+    = link_to report.target_account.acct, admin_account_path(report.target_account.id)
+  %td.reporter
+    = link_to report.account.acct, admin_account_path(report.account.id)
+  %td.comment
+    %span{title: report.comment}
+      = truncate(report.comment, length: 30, separator: ' ')
+  %td.stats
+    - unless report.statuses.empty?
+      %span{title: t('admin.accounts.statuses')}
+        = fa_icon('comment')
+        = report.statuses.count
+    - unless report.media_attachments.empty?
+      %span{title: t('admin.accounts.media_attachments')}
+        = fa_icon('camera')
+        = report.media_attachments.count
+  %td
+    = table_link_to 'circle', t('admin.reports.view'), admin_report_path(report)
diff --git a/app/views/admin/reports/index.html.haml b/app/views/admin/reports/index.html.haml
index 7db9af6d1..f1c4a93c4 100644
--- a/app/views/admin/reports/index.html.haml
+++ b/app/views/admin/reports/index.html.haml
@@ -21,24 +21,6 @@
         %th= t('admin.reports.report_contents')
         %th
     %tbody
-      - @reports.each do |report|
-        %tr
-          -# %td= check_box_tag 'select', report.id
-          %td= "##{report.id}"
-          %td= link_to report.target_account.acct, admin_account_path(report.target_account.id)
-          %td= link_to report.account.acct, admin_account_path(report.account.id)
-          %td
-            %span{title: report.comment}
-              = truncate(report.comment, length: 30, separator: ' ')
-          %td
-            - unless report.statuses.empty?
-              %span{title: t('admin.accounts.statuses')}
-                = fa_icon('comment')
-                = report.statuses.count
-            - unless report.media_attachments.empty?
-              %span{title: t('admin.accounts.media_attachments')}
-                = fa_icon('camera')
-                = report.media_attachments.count
-          %td= table_link_to 'circle', t('admin.reports.view'), admin_report_path(report)
+      = render @reports
 
 = paginate @reports