show.html.haml 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. - content_for :page_title do
  2. = t('disputes.strikes.title', action: t(@strike.action, scope: 'disputes.strikes.title_actions'), date: l(@strike.created_at.to_date))
  3. - content_for :heading_actions do
  4. - if @appeal.persisted?
  5. = link_to t('disputes.strikes.approve_appeal'), approve_admin_disputes_appeal_path(@appeal), method: :post, class: 'button' if can?(:approve, @appeal)
  6. = link_to t('disputes.strikes.reject_appeal'), reject_admin_disputes_appeal_path(@appeal), method: :post, class: 'button button--destructive' if can?(:reject, @appeal)
  7. - if @strike.overruled?
  8. %p.hint
  9. %span.positive-hint
  10. = fa_icon 'check'
  11. = ' '
  12. = t 'disputes.strikes.appeal_approved'
  13. - elsif @appeal.persisted? && @appeal.rejected?
  14. %p.hint
  15. %span.negative-hint
  16. = fa_icon 'times'
  17. = ' '
  18. = t 'disputes.strikes.appeal_rejected'
  19. .report-header
  20. .report-header__card
  21. .strike-card
  22. - unless @strike.none_action?
  23. %p= t "user_mailer.warning.explanation.#{@strike.action}", instance: Rails.configuration.x.local_domain
  24. - unless @strike.text.blank?
  25. = linkify(@strike.text)
  26. - if @strike.report && !@strike.report.other?
  27. %p
  28. %strong= t('user_mailer.warning.reason')
  29. = t("user_mailer.warning.categories.#{@strike.report.category}")
  30. - if @strike.report.violation? && @strike.report.rule_ids.present?
  31. %ul.strike-card__rules
  32. - @strike.report.rules.each do |rule|
  33. %li
  34. %span.strike-card__rules__text= rule.text
  35. - if @strike.status_ids.present? && !@strike.status_ids.empty?
  36. %p
  37. %strong= t('user_mailer.warning.statuses')
  38. .strike-card__statuses-list
  39. - status_map = @strike.statuses.includes(:application, :media_attachments).index_by(&:id)
  40. - @strike.status_ids.each do |status_id|
  41. .strike-card__statuses-list__item
  42. - if (status = status_map[status_id.to_i])
  43. .one-liner
  44. .emojify= one_line_preview(status)
  45. - status.ordered_media_attachments.each do |media_attachment|
  46. %abbr{ title: media_attachment.description }
  47. = fa_icon 'link'
  48. = media_attachment.file_file_name
  49. .strike-card__statuses-list__item__meta
  50. = link_to ActivityPub::TagManager.instance.url_for(status), target: '_blank' do
  51. %time.formatted{ datetime: status.created_at.iso8601, title: l(status.created_at) }= l(status.created_at)
  52. - unless status.application.nil?
  53. ·
  54. = status.application.name
  55. - else
  56. .one-liner= t('disputes.strikes.status', id: status_id)
  57. .strike-card__statuses-list__item__meta
  58. = t('disputes.strikes.status_removed')
  59. .report-header__details
  60. .report-header__details__item
  61. .report-header__details__item__header
  62. %strong= t('disputes.strikes.created_at')
  63. .report-header__details__item__content
  64. %time.formatted{ datetime: @strike.created_at.iso8601, title: l(@strike.created_at) }= l(@strike.created_at)
  65. .report-header__details__item
  66. .report-header__details__item__header
  67. %strong= t('disputes.strikes.recipient')
  68. .report-header__details__item__content
  69. = link_to @strike.target_account.username, can?(:show, @strike.target_account) ? admin_account_path(@strike.target_account_id) : ActivityPub::TagManager.instance.url_for(@strike.target_account), class: 'table-action-link'
  70. .report-header__details__item
  71. .report-header__details__item__header
  72. %strong= t('disputes.strikes.action_taken')
  73. .report-header__details__item__content
  74. - if @strike.overruled?
  75. %del= t(@strike.action, scope: 'user_mailer.warning.title')
  76. - else
  77. = t(@strike.action, scope: 'user_mailer.warning.title')
  78. - if @strike.report && can?(:show, @strike.report)
  79. .report-header__details__item
  80. .report-header__details__item__header
  81. %strong= t('disputes.strikes.associated_report')
  82. .report-header__details__item__content
  83. = link_to t('admin.reports.report', id: @strike.report.id), admin_report_path(@strike.report), class: 'table-action-link'
  84. - if @appeal.persisted?
  85. .report-header__details__item
  86. .report-header__details__item__header
  87. %strong= t('disputes.strikes.appeal_submitted_at')
  88. .report-header__details__item__content
  89. %time.formatted{ datetime: @appeal.created_at.iso8601, title: l(@appeal.created_at) }= l(@appeal.created_at)
  90. %hr.spacer/
  91. - if @appeal.persisted?
  92. %h3= t('disputes.strikes.appeal')
  93. .report-notes
  94. .report-notes__item
  95. = image_tag @appeal.account.avatar.url, class: 'report-notes__item__avatar'
  96. .report-notes__item__header
  97. %span.username
  98. = link_to @appeal.account.username, can?(:show, @appeal.account) ? admin_account_path(@appeal.account_id) : short_account_url(@appeal.account)
  99. %time{ datetime: @appeal.created_at.iso8601, title: l(@appeal.created_at) }
  100. - if @appeal.created_at.today?
  101. = t('admin.report_notes.today_at', time: l(@appeal.created_at, format: :time))
  102. - else
  103. = l @appeal.created_at.to_date
  104. .report-notes__item__content
  105. = simple_format(h(@appeal.text))
  106. - elsif can?(:appeal, @strike)
  107. %h3= t('disputes.strikes.appeals.submit')
  108. = simple_form_for(@appeal, url: disputes_strike_appeal_path(@strike)) do |f|
  109. .fields-group
  110. = f.input :text, wrapper: :with_label, input_html: { maxlength: 500 }
  111. .actions
  112. = f.button :button, t('disputes.strikes.appeals.submit'), type: :submit