preview.html.haml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. - target_acct = @report.target_account.acct
  2. - warning_action = { 'delete' => 'delete_statuses', 'mark_as_sensitive' => 'mark_statuses_as_sensitive' }.fetch(@moderation_action, @moderation_action)
  3. - content_for :page_title do
  4. = t('admin.reports.confirm_action', acct: target_acct)
  5. = form_tag admin_report_actions_path(@report), class: 'simple_form', method: :post do
  6. = hidden_field_tag :moderation_action, @moderation_action
  7. %p.hint= t("admin.reports.summary.action_preambles.#{@moderation_action}_html", acct: target_acct)
  8. %ul.hint
  9. %li.warning-hint= t("admin.reports.summary.actions.#{@moderation_action}_html", acct: target_acct)
  10. - if @moderation_action == 'suspend'
  11. %li.warning-hint= t('admin.reports.summary.delete_data_html', acct: target_acct)
  12. - if %w(silence suspend).include?(@moderation_action)
  13. %li.warning-hint= t('admin.reports.summary.close_reports_html', acct: target_acct)
  14. - else
  15. %li= t('admin.reports.summary.close_report', id: @report.id)
  16. %li= t('admin.reports.summary.record_strike_html', acct: target_acct)
  17. - if @report.target_account.local? && !@report.spam?
  18. %li= t('admin.reports.summary.send_email_html', acct: target_acct)
  19. %hr.spacer/
  20. - if @report.target_account.local?
  21. %p.hint= t('admin.reports.summary.preview_preamble_html', acct: target_acct)
  22. .strike-card
  23. - unless warning_action == 'none'
  24. %p= t "user_mailer.warning.explanation.#{warning_action}", instance: Rails.configuration.x.local_domain
  25. .fields-group
  26. = text_area_tag :text, nil, placeholder: t('admin.reports.summary.warning_placeholder')
  27. - unless @report.other?
  28. %p
  29. %strong= t('user_mailer.warning.reason')
  30. = t("user_mailer.warning.categories.#{@report.category}")
  31. - if @report.violation? && @report.rule_ids.present?
  32. %ul.strike-card__rules
  33. - @report.rules.each do |rule|
  34. %li
  35. %span.strike-card__rules__text= rule.text
  36. - if @report.status_ids.present? && !@report.status_ids.empty?
  37. %p
  38. %strong= t('user_mailer.warning.statuses')
  39. .strike-card__statuses-list
  40. - status_map = @report.statuses.includes(:application, :media_attachments).index_by(&:id)
  41. - @report.status_ids.each do |status_id|
  42. .strike-card__statuses-list__item
  43. - if (status = status_map[status_id.to_i])
  44. .one-liner
  45. .emojify= one_line_preview(status)
  46. - status.ordered_media_attachments.each do |media_attachment|
  47. %abbr{ title: media_attachment.description }
  48. = fa_icon 'link'
  49. = media_attachment.file_file_name
  50. .strike-card__statuses-list__item__meta
  51. = link_to ActivityPub::TagManager.instance.url_for(status), target: '_blank', rel: 'noopener noreferrer' do
  52. %time.formatted{ datetime: status.created_at.iso8601, title: l(status.created_at) }= l(status.created_at)
  53. - unless status.application.nil?
  54. ·
  55. = status.application.name
  56. - else
  57. .one-liner= t('disputes.strikes.status', id: status_id)
  58. .strike-card__statuses-list__item__meta
  59. = t('disputes.strikes.status_removed')
  60. %hr.spacer/
  61. .actions
  62. = link_to t('admin.reports.cancel'), admin_report_path(@report), class: 'button button-tertiary'
  63. = button_tag t('admin.reports.confirm'), name: :confirm, class: 'button', type: :submit