show.html.haml 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. = render 'card', strike: @strike
  22. .report-header__details
  23. .report-header__details__item
  24. .report-header__details__item__header
  25. %strong= t('disputes.strikes.created_at')
  26. .report-header__details__item__content
  27. %time.formatted{ datetime: @strike.created_at.iso8601, title: l(@strike.created_at) }= l(@strike.created_at)
  28. .report-header__details__item
  29. .report-header__details__item__header
  30. %strong= t('disputes.strikes.recipient')
  31. .report-header__details__item__content
  32. = 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'
  33. .report-header__details__item
  34. .report-header__details__item__header
  35. %strong= t('disputes.strikes.action_taken')
  36. .report-header__details__item__content
  37. - if @strike.overruled?
  38. %del= t(@strike.action, scope: 'user_mailer.warning.title')
  39. - else
  40. = t(@strike.action, scope: 'user_mailer.warning.title')
  41. - if @strike.report && can?(:show, @strike.report)
  42. .report-header__details__item
  43. .report-header__details__item__header
  44. %strong= t('disputes.strikes.associated_report')
  45. .report-header__details__item__content
  46. = link_to t('admin.reports.report', id: @strike.report.id), admin_report_path(@strike.report), class: 'table-action-link'
  47. - if @appeal.persisted?
  48. .report-header__details__item
  49. .report-header__details__item__header
  50. %strong= t('disputes.strikes.appeal_submitted_at')
  51. .report-header__details__item__content
  52. %time.formatted{ datetime: @appeal.created_at.iso8601, title: l(@appeal.created_at) }= l(@appeal.created_at)
  53. %hr.spacer/
  54. - if @appeal.persisted?
  55. %h3= t('disputes.strikes.appeal')
  56. .report-notes
  57. .report-notes__item
  58. = image_tag @appeal.account.avatar.url, class: 'report-notes__item__avatar'
  59. .report-notes__item__header
  60. %span.username
  61. = link_to @appeal.account.username, can?(:show, @appeal.account) ? admin_account_path(@appeal.account_id) : short_account_url(@appeal.account)
  62. %time.relative-formatted{ datetime: @appeal.created_at.iso8601 }
  63. = l @appeal.created_at.to_date
  64. .report-notes__item__content
  65. = simple_format(h(@appeal.text))
  66. - elsif can?(:appeal, @strike)
  67. %h3= t('disputes.strikes.appeals.submit')
  68. = simple_form_for(@appeal, url: disputes_strike_appeal_path(@strike)) do |f|
  69. .fields-group
  70. = f.input :text, wrapper: :with_label, input_html: { maxlength: 500 }
  71. .actions
  72. = f.button :button, t('disputes.strikes.appeals.submit'), type: :submit