disputes_helper.rb 497 B

12345678910111213141516171819
  1. # frozen_string_literal: true
  2. module Admin
  3. module DisputesHelper
  4. def strike_action_label(appeal)
  5. t(key_for_action(appeal),
  6. scope: 'admin.strikes.actions',
  7. name: content_tag(:span, appeal.strike.account.username, class: 'username'),
  8. target: content_tag(:span, appeal.account.username, class: 'target'))
  9. .html_safe
  10. end
  11. private
  12. def key_for_action(appeal)
  13. AccountWarning.actions.slice(appeal.strike.action).keys.first
  14. end
  15. end
  16. end