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.

139 lines
6.4 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. - unless @report.target_account.local?
  47. %tr
  48. %th= t('admin.reports.forwarded')
  49. %td{ colspan: 3 }
  50. - if @report.forwarded.nil?
  51. \-
  52. - elsif @report.forwarded?
  53. = t('simple_form.yes')
  54. - else
  55. = t('simple_form.no')
  56. - if !@report.action_taken_by_account.nil?
  57. %tr
  58. %th= t('admin.reports.action_taken_by')
  59. %td{ colspan: 3 }
  60. = admin_account_link_to @report.action_taken_by_account
  61. - else
  62. %tr
  63. %th= t('admin.reports.assigned')
  64. %td
  65. - if @report.assigned_account.nil?
  66. \-
  67. - else
  68. = admin_account_link_to @report.assigned_account
  69. %td
  70. - if @report.assigned_account != current_user.account
  71. = table_link_to 'user', t('admin.reports.assign_to_self'), assign_to_self_admin_report_path(@report), method: :post
  72. %td
  73. - if !@report.assigned_account.nil?
  74. = table_link_to 'trash', t('admin.reports.unassign'), unassign_admin_report_path(@report), method: :post
  75. %hr.spacer
  76. %div.action-buttons
  77. %div
  78. - if @report.unresolved?
  79. %div
  80. - if @report.target_account.local?
  81. = link_to t('admin.accounts.warn'), new_admin_account_action_path(@report.target_account_id, type: 'none', report_id: @report.id), class: 'button'
  82. = 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'
  83. = 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'
  84. = 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'
  85. %hr.spacer
  86. .speech-bubble
  87. .speech-bubble__bubble= simple_format(@report.comment.presence || t('admin.reports.comment.none'))
  88. .speech-bubble__owner
  89. - if @report.account.local?
  90. = admin_account_link_to @report.account
  91. - else
  92. = @report.account.domain
  93. %br/
  94. %time.formatted{ datetime: @report.created_at.iso8601 }
  95. - unless @report.statuses.empty?
  96. %hr.spacer/
  97. = form_for(@form, url: admin_report_reported_statuses_path(@report.id)) do |f|
  98. .batch-table
  99. .batch-table__toolbar
  100. %label.batch-table__toolbar__select.batch-checkbox-all
  101. = check_box_tag :batch_checkbox_all, nil, false
  102. .batch-table__toolbar__actions
  103. = 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') }
  104. = 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') }
  105. = 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') }
  106. .batch-table__body
  107. = render partial: 'admin/reports/status', collection: @report.statuses, locals: { f: f }
  108. %hr.spacer/
  109. - @report_notes.each do |item|
  110. - if item.is_a?(Admin::ActionLog)
  111. = render partial: 'action_log', locals: { action_log: item }
  112. - else
  113. = render item
  114. = simple_form_for @report_note, url: admin_report_notes_path do |f|
  115. = render 'shared/error_messages', object: @report_note
  116. = f.input :report_id, as: :hidden
  117. .field-group
  118. = f.input :content, placeholder: t('admin.reports.notes.placeholder'), rows: 6
  119. .actions
  120. - if @report.unresolved?
  121. = f.button :button, t('admin.reports.notes.create_and_resolve'), name: :create_and_resolve, type: :submit
  122. - else
  123. = f.button :button, t('admin.reports.notes.create_and_unresolve'), name: :create_and_unresolve, type: :submit
  124. = f.button :button, t('admin.reports.notes.create'), type: :submit