style: convert Agent signin form to dsfr
This commit is contained in:
parent
abd8cefd7d
commit
39fe872947
3 changed files with 29 additions and 14 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue