style: convert Agent signin form to dsfr

This commit is contained in:
Colin Darie 2023-08-30 18:11:19 +02:00
parent abd8cefd7d
commit 39fe872947
No known key found for this signature in database
GPG key ID: 8C76CADD40253590
3 changed files with 29 additions and 14 deletions

View file

@ -7,6 +7,7 @@ class Dsfr::InputComponent < ApplicationComponent
# use it to indicate detailed about the inputs, ex: https://www.systeme-de-design.gouv.fr/elements-d-interface/modeles-et-blocs-fonctionnels/demande-de-mot-de-passe
# it uses aria-describedby on input and link it to yielded content
renders_one :describedby
renders_one :label
def initialize(form:, attribute:, input_type: :text_field, opts: {}, required: true)
@form = form
@ -46,7 +47,7 @@ class Dsfr::InputComponent < ApplicationComponent
# i18n lookups
def label
object.class.human_attribute_name(@attribute)
get_slot(:label).presence || default_label
end
# kind of input helpers
@ -63,4 +64,8 @@ class Dsfr::InputComponent < ApplicationComponent
end
private
def default_label
object.class.human_attribute_name(@attribute)
end
end