demarches-normaliennes/app/helpers/release_notes_helper.rb
2023-11-08 18:22:14 +01:00

18 lines
592 B
Ruby

module ReleaseNotesHelper
def announce_category_badge(category)
color_class = case category.to_sym
when :administrateur
'fr-background-flat--blue-france fr-text-inverted--blue-france'
when :instructeur
'fr-background-contrast--yellow-tournesol'
when :expert
'fr-background-contrast--purple-glycine'
when :usager
'fr-background-contrast--green-emeraude'
when :api
'fr-background-contrast--blue-ecume'
end
content_tag(:span, ReleaseNote.human_attribute_name("categories.#{category}"), class: "fr-badge #{color_class}")
end
end