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.

212 lines
8.9 KiB

  1. - content_for :page_title do
  2. = t('admin.reports.report', id: @report.id)
  3. - content_for :heading_actions do
  4. - if @report.unresolved?
  5. = link_to t('admin.reports.mark_as_resolved'), resolve_admin_report_path(@report), method: :post, class: 'button'
  6. - else
  7. = link_to t('admin.reports.mark_as_unresolved'), reopen_admin_report_path(@report), method: :post, class: 'button'
  8. .report-header
  9. .report-header__card
  10. .account-card
  11. .account-card__header
  12. = image_tag @report.target_account.header.url, alt: ''
  13. .account-card__title
  14. .account-card__title__avatar
  15. = image_tag @report.target_account.avatar.url, alt: ''
  16. .display-name
  17. %bdi
  18. %strong.emojify.p-name= display_name(@report.target_account, custom_emojify: true)
  19. %span
  20. = acct(@report.target_account)
  21. = fa_icon('lock') if @report.target_account.locked?
  22. - if @report.target_account.note.present?
  23. .account-card__bio.emojify
  24. = prerender_custom_emojis(account_bio_format(@report.target_account), @report.target_account.emojis)
  25. .account-card__actions
  26. .account-card__counters
  27. .account-card__counters__item
  28. = friendly_number_to_human @report.target_account.statuses_count
  29. %small= t('accounts.posts', count: @report.target_account.statuses_count).downcase
  30. .account-card__counters__item
  31. = friendly_number_to_human @report.target_account.followers_count
  32. %small= t('accounts.followers', count: @report.target_account.followers_count).downcase
  33. .account-card__counters__item
  34. = friendly_number_to_human @report.target_account.following_count
  35. %small= t('accounts.following', count: @report.target_account.following_count).downcase
  36. .account-card__actions__button
  37. = link_to t('admin.reports.view_profile'), admin_account_path(@report.target_account_id), class: 'button'
  38. .report-header__details.report-header__details--horizontal
  39. .report-header__details__item
  40. .report-header__details__item__header
  41. %strong= t('admin.accounts.joined')
  42. .report-header__details__item__content
  43. %time.time-ago{ datetime: @report.target_account.created_at.iso8601, title: l(@report.target_account.created_at) }= l @report.target_account.created_at
  44. .report-header__details__item
  45. .report-header__details__item__header
  46. %strong= t('accounts.last_active')
  47. .report-header__details__item__content
  48. - if @report.target_account.last_status_at.present?
  49. %time.time-ago{ datetime: @report.target_account.last_status_at.to_date.iso8601, title: l(@report.target_account.last_status_at.to_date) }= l @report.target_account.last_status_at
  50. .report-header__details__item
  51. .report-header__details__item__header
  52. %strong= t('admin.accounts.strikes')
  53. .report-header__details__item__content
  54. = @report.target_account.previous_strikes_count
  55. .report-header__details
  56. .report-header__details__item
  57. .report-header__details__item__header
  58. %strong= t('admin.reports.created_at')
  59. .report-header__details__item__content
  60. %time.formatted{ datetime: @report.created_at.iso8601 }
  61. .report-header__details__item
  62. .report-header__details__item__header
  63. %strong= t('admin.reports.reported_by')
  64. .report-header__details__item__content
  65. - if @report.account.instance_actor?
  66. = site_hostname
  67. - elsif @report.account.local?
  68. = admin_account_link_to @report.account
  69. - else
  70. = @report.account.domain
  71. .report-header__details__item
  72. .report-header__details__item__header
  73. %strong= t('admin.reports.status')
  74. .report-header__details__item__content
  75. - if @report.action_taken?
  76. = t('admin.reports.resolved')
  77. - else
  78. = t('admin.reports.unresolved')
  79. - unless @report.target_account.local?
  80. .report-header__details__item
  81. .report-header__details__item__header
  82. %strong= t('admin.reports.forwarded')
  83. .report-header__details__item__content
  84. - if @report.forwarded?
  85. = t('simple_form.yes')
  86. - else
  87. = t('simple_form.no')
  88. - if !@report.action_taken_by_account.nil?
  89. .report-header__details__item
  90. .report-header__details__item__header
  91. %strong= t('admin.reports.action_taken_by')
  92. .report-header__details__item__content
  93. = admin_account_link_to @report.action_taken_by_account
  94. - else
  95. .report-header__details__item
  96. .report-header__details__item__header
  97. %strong= t('admin.reports.assigned')
  98. .report-header__details__item__content
  99. - if @report.assigned_account.nil?
  100. = t 'admin.reports.no_one_assigned'
  101. - else
  102. = admin_account_link_to @report.assigned_account
  103. - if @report.assigned_account != current_user.account
  104. = table_link_to 'user', t('admin.reports.assign_to_self'), assign_to_self_admin_report_path(@report), method: :post
  105. - elsif !@report.assigned_account.nil?
  106. = table_link_to 'trash', t('admin.reports.unassign'), unassign_admin_report_path(@report), method: :post
  107. %hr.spacer
  108. %h3= t 'admin.reports.category'
  109. %p= t 'admin.reports.category_description_html'
  110. = react_admin_component :report_reason_selector, id: @report.id, category: @report.category, rule_ids: @report.rule_ids&.map(&:to_s), disabled: @report.action_taken?
  111. - if @report.comment.present?
  112. - if @report.account.instance_actor?
  113. %p= t('admin.reports.comment_description_html', name: content_tag(:strong, site_hostname, class: 'username'))
  114. - elsif @report.account.local?
  115. %p= t('admin.reports.comment_description_html', name: content_tag(:strong, @report.account.username, class: 'username'))
  116. - else
  117. %p= t('admin.reports.comment_description_html', name: t('admin.reports.remote_user_placeholder', instance: @report.account.domain))
  118. .report-notes
  119. .report-notes__item
  120. - if @report.account.local? && !@report.account.instance_actor?
  121. = image_tag @report.account.avatar.url, class: 'report-notes__item__avatar'
  122. - else
  123. = image_tag(full_asset_url('avatars/original/missing.png', skip_pipeline: true), class: 'report-notes__item__avatar')
  124. .report-notes__item__header
  125. %span.username
  126. - if @report.account.instance_actor?
  127. = site_hostname
  128. - elsif @report.account.local?
  129. = link_to @report.account.username, admin_account_path(@report.account_id)
  130. - else
  131. = link_to @report.account.domain, admin_instance_path(@report.account.domain)
  132. %time.relative-formatted{ datetime: @report.created_at.iso8601 }
  133. = t('admin.report_notes.created_at')
  134. .report-notes__item__content
  135. = simple_format(h(@report.comment))
  136. %hr.spacer/
  137. %h3
  138. = t 'admin.reports.statuses'
  139. %small.section-skip-link
  140. = link_to '#actions' do
  141. = fa_icon 'angle-double-down'
  142. = t('admin.reports.skip_to_actions')
  143. %p
  144. = t 'admin.reports.statuses_description_html'
  145. = link_to safe_join([fa_icon('plus'), t('admin.reports.add_to_report')]), admin_account_statuses_path(@report.target_account_id, report_id: @report.id), class: 'table-action-link'
  146. = form_for(@form, url: batch_admin_account_statuses_path(@report.target_account_id, report_id: @report.id)) do |f|
  147. .batch-table
  148. .batch-table__toolbar
  149. %label.batch-table__toolbar__select.batch-checkbox-all
  150. = check_box_tag :batch_checkbox_all, nil, false
  151. .batch-table__toolbar__actions
  152. - if !@statuses.empty? && @report.unresolved?
  153. = f.button safe_join([fa_icon('times'), t('admin.statuses.batch.remove_from_report')]), name: :remove_from_report, class: 'table-action-link', type: :submit
  154. .batch-table__body
  155. - if @statuses.empty?
  156. = nothing_here 'nothing-here--under-tabs'
  157. - else
  158. = render partial: 'admin/reports/status', collection: @statuses, locals: { f: f }
  159. - if @report.unresolved?
  160. %hr.spacer/
  161. %p#actions= t 'admin.reports.actions_description_html'
  162. = render partial: 'admin/reports/actions'
  163. - unless @action_logs.empty?
  164. %hr.spacer/
  165. %h3= t 'admin.reports.action_log'
  166. .report-notes
  167. = render @action_logs
  168. %hr.spacer/
  169. %h3= t 'admin.reports.notes.title'
  170. %p= t 'admin.reports.notes_description_html'
  171. .report-notes
  172. = render @report_notes
  173. = simple_form_for @report_note, url: admin_report_notes_path do |f|
  174. = f.input :report_id, as: :hidden
  175. .field-group
  176. = f.input :content, placeholder: t('admin.reports.notes.placeholder'), rows: 6
  177. .actions
  178. - if @report.unresolved?
  179. = f.button :button, t('admin.reports.notes.create_and_resolve'), name: :create_and_resolve, type: :submit
  180. - else
  181. = f.button :button, t('admin.reports.notes.create_and_unresolve'), name: :create_and_unresolve, type: :submit
  182. = f.button :button, t('admin.reports.notes.create'), type: :submit