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.

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