fix(Champ.carte): add missing label to search input instead of placeholder

Co-authored-by: Corinne Durrmeyer <corinne@inseo.fr>
This commit is contained in:
mfo 2024-04-11 11:34:06 +02:00
parent d8a8fb53ce
commit 1989c3e75b
No known key found for this signature in database
GPG key ID: 7CE3E1F5B794A8EC
7 changed files with 35 additions and 21 deletions

View file

@ -113,7 +113,11 @@ module Dsfr
end
def default_hint
I18n.t("activerecord.attributes.#{object.class.name.underscore}.hints.#{@attribute}")
if I18n.exists?("activerecord.attributes.#{object.class.name.underscore}.hints.#{@attribute}")
I18n.t("activerecord.attributes.#{object.class.name.underscore}.hints.#{@attribute}")
elsif I18n.exists?("activerecord.attributes.#{object.class.name.underscore}.hints.#{@attribute}_html")
I18n.t("activerecord.attributes.#{object.class.name.underscore}.hints.#{@attribute}_html").html_safe
end
end
def password?
@ -131,7 +135,10 @@ module Dsfr
def hint?
return true if get_slot(:hint).present?
I18n.exists?("activerecord.attributes.#{object.class.name.underscore}.hints.#{@attribute}")
maybe_hint = I18n.exists?("activerecord.attributes.#{object.class.name.underscore}.hints.#{@attribute}")
maybe_hint_html = I18n.exists?("activerecord.attributes.#{object.class.name.underscore}.hints.#{@attribute}_html")
maybe_hint || maybe_hint_html
end
end
end