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.

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