tech(refacto): extrait la logique de rendu du dsfr sur les composants
This commit is contained in:
parent
f54ab0bf96
commit
094f4f3ce6
48 changed files with 207 additions and 146 deletions
|
@ -1,8 +1,4 @@
|
|||
class Champs::CheckboxChamp < Champs::BooleanChamp
|
||||
def dsfr_champ_container
|
||||
:fieldset
|
||||
end
|
||||
|
||||
def for_export
|
||||
true? ? 'on' : 'off'
|
||||
end
|
||||
|
@ -15,6 +11,11 @@ class Champs::CheckboxChamp < Champs::BooleanChamp
|
|||
false
|
||||
end
|
||||
|
||||
# TODO remove when normalize_checkbox_values is over
|
||||
def true?
|
||||
value_with_legacy == TRUE_VALUE
|
||||
end
|
||||
|
||||
def html_label?
|
||||
false
|
||||
end
|
||||
|
@ -22,4 +23,11 @@ class Champs::CheckboxChamp < Champs::BooleanChamp
|
|||
def single_checkbox?
|
||||
true
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
# TODO remove when normalize_checkbox_values is over
|
||||
def value_with_legacy
|
||||
value == 'on' ? TRUE_VALUE : value
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue