feat(announces): anyone can read announces

This commit is contained in:
Colin Darie 2023-10-04 14:57:32 +02:00
parent ff8ed6016e
commit e4c37758d4
No known key found for this signature in database
GPG key ID: 8C76CADD40253590
11 changed files with 189 additions and 0 deletions

View file

@ -0,0 +1,18 @@
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