index.html.haml 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. - content_for :page_title do
  2. = t('admin.reports.title')
  3. .filters
  4. .filter-subset
  5. %strong= t('admin.reports.status')
  6. %ul
  7. %li= filter_link_to t('admin.reports.unresolved'), resolved: nil
  8. %li= filter_link_to t('admin.reports.resolved'), resolved: '1'
  9. .filter-subset
  10. %strong= t('admin.reports.target_origin')
  11. %ul
  12. %li= filter_link_to t('admin.accounts.location.all'), target_origin: nil
  13. %li= filter_link_to t('admin.accounts.location.local'), target_origin: 'local'
  14. %li= filter_link_to t('admin.accounts.location.remote'), target_origin: 'remote'
  15. = form_tag admin_reports_url, method: 'GET', class: 'simple_form' do
  16. .fields-group
  17. - ReportFilter::KEYS.each do |key|
  18. = hidden_field_tag key, params[key] if params[key].present?
  19. - %i(by_target_domain).each do |key|
  20. .input.string.optional
  21. = text_field_tag key, params[key], class: 'string optional', placeholder: I18n.t("admin.reports.#{key}")
  22. .actions
  23. %button.button= t('admin.accounts.search')
  24. = link_to t('admin.accounts.reset'), admin_reports_path, class: 'button negative'
  25. - @reports.group_by(&:target_account_id).each_value do |reports|
  26. - target_account = reports.first.target_account
  27. .report-card
  28. .report-card__profile
  29. = account_link_to target_account, '', path: admin_account_path(target_account.id)
  30. .report-card__profile__stats
  31. = link_to t('admin.reports.account.notes', count: target_account.targeted_moderation_notes.count), admin_account_path(target_account.id)
  32. %br/
  33. - if target_account.suspended?
  34. %span.red= t('admin.accounts.suspended')
  35. - elsif target_account.silenced?
  36. %span.red= t('admin.accounts.silenced')
  37. - elsif target_account.user&.disabled?
  38. %span.red= t('admin.accounts.disabled')
  39. - else
  40. %span.neutral= t('admin.accounts.no_limits_imposed')
  41. .report-card__summary
  42. - reports.each do |report|
  43. .report-card__summary__item
  44. .report-card__summary__item__reported-by
  45. - if report.account.instance_actor?
  46. = site_hostname
  47. - elsif report.account.local?
  48. = admin_account_link_to report.account
  49. - else
  50. = report.account.domain
  51. .report-card__summary__item__content
  52. = link_to admin_report_path(report) do
  53. .one-line= report.comment.presence || t('admin.reports.comment.none')
  54. %span.report-card__summary__item__content__icon{ title: t('admin.accounts.statuses') }
  55. = fa_icon('comment')
  56. = report.status_ids.size
  57. %span.report-card__summary__item__content__icon{ title: t('admin.accounts.media_attachments') }
  58. = fa_icon('camera')
  59. = report.media_attachments_count
  60. - if report.forwarded?
  61. ·
  62. = t('admin.reports.forwarded_to', domain: target_account.domain)
  63. .report-card__summary__item__assigned
  64. - if report.assigned_account.present?
  65. = admin_account_link_to report.assigned_account
  66. - else
  67. \-
  68. = paginate @reports