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.

117 lines
5.5 KiB

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