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.

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