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.

127 lines
6.2 KiB

  1. - content_for :header_tags do
  2. = javascript_pack_tag 'admin', integrity: true, async: true, crossorigin: 'anonymous'
  3. - content_for :page_title do
  4. = t('admin.reports.report', id: @report.id)
  5. - content_for :heading_actions do
  6. - if @report.unresolved?
  7. = link_to t('admin.reports.mark_as_resolved'), resolve_admin_report_path(@report), method: :post, class: 'button'
  8. - else
  9. = link_to t('admin.reports.mark_as_unresolved'), reopen_admin_report_path(@report), method: :post, class: 'button'
  10. .table-wrapper
  11. %table.table.inline-table
  12. %tbody
  13. %tr
  14. %th= t('admin.reports.reported_account')
  15. %td= admin_account_link_to @report.target_account
  16. %td= table_link_to 'flag', t('admin.reports.account.reports', count: @report.target_account.targeted_reports.count), admin_reports_path(target_account_id: @report.target_account.id)
  17. %td= table_link_to 'file', t('admin.reports.account.notes', count: @report.target_account.targeted_moderation_notes.count), admin_reports_path(target_account_id: @report.target_account.id)
  18. %tr
  19. %th= t('admin.reports.reported_by')
  20. - if @report.account.instance_actor?
  21. %td{ colspan: 3 }= site_hostname
  22. - elsif @report.account.local?
  23. %td= admin_account_link_to @report.account
  24. %td= table_link_to 'flag', t('admin.reports.account.reports', count: @report.account.targeted_reports.count), admin_reports_path(target_account_id: @report.account.id)
  25. %td= table_link_to 'file', t('admin.reports.account.notes', count: @report.account.targeted_moderation_notes.count), admin_reports_path(target_account_id: @report.account.id)
  26. - else
  27. %td{ colspan: 3 }= @report.account.domain
  28. %tr
  29. %th= t('admin.reports.created_at')
  30. %td{ colspan: 3 }
  31. %time.formatted{ datetime: @report.created_at.iso8601 }
  32. %tr
  33. %th= t('admin.reports.updated_at')
  34. %td{ colspan: 3 }
  35. %time.formatted{ datetime: @report.updated_at.iso8601 }
  36. %tr
  37. %th= t('admin.reports.status')
  38. %td
  39. - if @report.action_taken?
  40. = t('admin.reports.resolved')
  41. - else
  42. = t('admin.reports.unresolved')
  43. %td{ colspan: 2 }
  44. - if @report.action_taken?
  45. = table_link_to 'envelope-open', t('admin.reports.reopen'), admin_report_path(@report, outcome: 'reopen'), method: :put
  46. - if !@report.action_taken_by_account.nil?
  47. %tr
  48. %th= t('admin.reports.action_taken_by')
  49. %td{ colspan: 3 }
  50. = admin_account_link_to @report.action_taken_by_account
  51. - else
  52. %tr
  53. %th= t('admin.reports.assigned')
  54. %td
  55. - if @report.assigned_account.nil?
  56. \-
  57. - else
  58. = admin_account_link_to @report.assigned_account
  59. %td
  60. - if @report.assigned_account != current_user.account
  61. = table_link_to 'user', t('admin.reports.assign_to_self'), assign_to_self_admin_report_path(@report), method: :post
  62. %td
  63. - if !@report.assigned_account.nil?
  64. = table_link_to 'trash', t('admin.reports.unassign'), unassign_admin_report_path(@report), method: :post
  65. %hr.spacer
  66. %div{ style: 'overflow: hidden; margin-bottom: 20px; clear: both' }
  67. - if @report.unresolved?
  68. %div{ style: 'float: right' }
  69. - if @report.target_account.local?
  70. = link_to t('admin.accounts.warn'), new_admin_account_action_path(@report.target_account_id, type: 'none', report_id: @report.id), class: 'button'
  71. = link_to t('admin.accounts.disable'), new_admin_account_action_path(@report.target_account_id, type: 'disable', report_id: @report.id), class: 'button button--destructive'
  72. = link_to t('admin.accounts.silence'), new_admin_account_action_path(@report.target_account_id, type: 'silence', report_id: @report.id), class: 'button button--destructive'
  73. = link_to t('admin.accounts.perform_full_suspension'), new_admin_account_action_path(@report.target_account_id, type: 'suspend', report_id: @report.id), class: 'button button--destructive'
  74. %hr.spacer
  75. .speech-bubble
  76. .speech-bubble__bubble= simple_format(@report.comment.presence || t('admin.reports.comment.none'))
  77. .speech-bubble__owner
  78. - if @report.account.local?
  79. = admin_account_link_to @report.account
  80. - else
  81. = @report.account.domain
  82. %br/
  83. %time.formatted{ datetime: @report.created_at.iso8601 }
  84. - unless @report.statuses.empty?
  85. %hr.spacer/
  86. = form_for(@form, url: admin_report_reported_statuses_path(@report.id)) do |f|
  87. .batch-table
  88. .batch-table__toolbar
  89. %label.batch-table__toolbar__select.batch-checkbox-all
  90. = check_box_tag :batch_checkbox_all, nil, false
  91. .batch-table__toolbar__actions
  92. = f.button safe_join([fa_icon('eye-slash'), t('admin.statuses.batch.nsfw_on')]), name: :nsfw_on, class: 'table-action-link', type: :submit, data: { confirm: t('admin.reports.are_you_sure') }
  93. = f.button safe_join([fa_icon('eye'), t('admin.statuses.batch.nsfw_off')]), name: :nsfw_off, class: 'table-action-link', type: :submit, data: { confirm: t('admin.reports.are_you_sure') }
  94. = f.button safe_join([fa_icon('trash'), t('admin.statuses.batch.delete')]), name: :delete, class: 'table-action-link', type: :submit, data: { confirm: t('admin.reports.are_you_sure') }
  95. .batch-table__body
  96. = render partial: 'admin/reports/status', collection: @report.statuses, locals: { f: f }
  97. %hr.spacer/
  98. - @report_notes.each do |item|
  99. - if item.is_a?(Admin::ActionLog)
  100. = render partial: 'action_log', locals: { action_log: item }
  101. - else
  102. = render item
  103. = simple_form_for @report_note, url: admin_report_notes_path do |f|
  104. = render 'shared/error_messages', object: @report_note
  105. = f.input :report_id, as: :hidden
  106. .field-group
  107. = f.input :content, placeholder: t('admin.reports.notes.placeholder'), rows: 6
  108. .actions
  109. - if @report.unresolved?
  110. = f.button :button, t('admin.reports.notes.create_and_resolve'), name: :create_and_resolve, type: :submit
  111. - else
  112. = f.button :button, t('admin.reports.notes.create_and_unresolve'), name: :create_and_unresolve, type: :submit
  113. = f.button :button, t('admin.reports.notes.create'), type: :submit