You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

71 lines
2.8 KiB

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