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