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.

129 lines
6.1 KiB

  1. - content_for :header_tags do
  2. = javascript_pack_tag 'admin', 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.action-buttons
  67. %div
  68. - if @report.unresolved?
  69. %div
  70. - if @report.target_account.local?
  71. = link_to t('admin.accounts.warn'), new_admin_account_action_path(@report.target_account_id, type: 'none', report_id: @report.id), class: 'button'
  72. = 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'
  73. = 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'
  74. = 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'
  75. %hr.spacer
  76. .speech-bubble
  77. .speech-bubble__bubble= simple_format(@report.comment.presence || t('admin.reports.comment.none'))
  78. .speech-bubble__owner
  79. - if @report.account.local?
  80. = admin_account_link_to @report.account
  81. - else
  82. = @report.account.domain
  83. %br/
  84. %time.formatted{ datetime: @report.created_at.iso8601 }
  85. - unless @report.statuses.empty?
  86. %hr.spacer/
  87. = form_for(@form, url: admin_report_reported_statuses_path(@report.id)) do |f|
  88. .batch-table
  89. .batch-table__toolbar
  90. %label.batch-table__toolbar__select.batch-checkbox-all
  91. = check_box_tag :batch_checkbox_all, nil, false
  92. .batch-table__toolbar__actions
  93. = 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') }
  94. = 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') }
  95. = 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') }
  96. .batch-table__body
  97. = render partial: 'admin/reports/status', collection: @report.statuses, locals: { f: f }
  98. %hr.spacer/
  99. - @report_notes.each do |item|
  100. - if item.is_a?(Admin::ActionLog)
  101. = render partial: 'action_log', locals: { action_log: item }
  102. - else
  103. = render item
  104. = simple_form_for @report_note, url: admin_report_notes_path do |f|
  105. = render 'shared/error_messages', object: @report_note
  106. = f.input :report_id, as: :hidden
  107. .field-group
  108. = f.input :content, placeholder: t('admin.reports.notes.placeholder'), rows: 6
  109. .actions
  110. - if @report.unresolved?
  111. = f.button :button, t('admin.reports.notes.create_and_resolve'), name: :create_and_resolve, type: :submit
  112. - else
  113. = f.button :button, t('admin.reports.notes.create_and_unresolve'), name: :create_and_unresolve, type: :submit
  114. = f.button :button, t('admin.reports.notes.create'), type: :submit