_card.html.haml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. .strike-card
  2. - unless strike.none_action?
  3. %p= t "user_mailer.warning.explanation.#{strike.action}", instance: Rails.configuration.x.local_domain
  4. - if strike.text.present?
  5. = linkify(strike.text)
  6. - if strike.report && !strike.report.other?
  7. %p
  8. %strong= t('user_mailer.warning.reason')
  9. = t("user_mailer.warning.categories.#{strike.report.category}")
  10. - if strike.report.violation? && strike.report.rule_ids.present?
  11. %ul.strike-card__rules
  12. - strike.report.rules.each do |rule|
  13. %li
  14. %span.strike-card__rules__text= rule.text
  15. - if strike.status_ids.present? && !strike.status_ids.empty?
  16. %p
  17. %strong= t('user_mailer.warning.statuses')
  18. .strike-card__statuses-list
  19. - status_map = strike.statuses.includes(:application, :media_attachments).index_by(&:id)
  20. - strike.status_ids.each do |status_id|
  21. .strike-card__statuses-list__item
  22. - if (status = status_map[status_id.to_i])
  23. .one-liner
  24. .emojify= one_line_preview(status)
  25. - status.ordered_media_attachments.each do |media_attachment|
  26. %abbr{ title: media_attachment.description }
  27. = fa_icon 'link'
  28. = media_attachment.file_file_name
  29. .strike-card__statuses-list__item__meta
  30. = link_to ActivityPub::TagManager.instance.url_for(status), target: '_blank', rel: 'noopener noreferrer' do
  31. %time.formatted{ datetime: status.created_at.iso8601, title: l(status.created_at) }= l(status.created_at)
  32. - unless status.application.nil?
  33. ·
  34. = status.application.name
  35. - else
  36. .one-liner= t('disputes.strikes.status', id: status_id)
  37. .strike-card__statuses-list__item__meta
  38. = t('disputes.strikes.status_removed')