@@ -17,15 +17,15 @@ def administration
1717 end
1818
1919 def patron
20- description = 'aller voir le super site : https://demarches-simplifiees.fr'
20+ description = 'Aller voir le super site : https://demarches-simplifiees.fr'
2121
2222 all_champs = TypeDeChamp . type_champs
23- . map { |name , _ | TypeDeChamp . new ( type_champ : name , private : false , libelle : name , description : description , mandatory : true ) }
23+ . map { |name , _ | TypeDeChamp . new ( type_champ : name , private : false , libelle : name . humanize , description : description , mandatory : true ) }
2424 . map . with_index { |type_de_champ , i | type_de_champ . champ . build ( id : i ) }
2525
2626 all_champs
2727 . filter { |champ | champ . type_champ == TypeDeChamp . type_champs . fetch ( :header_section ) }
28- . each { |champ | champ . type_de_champ . libelle = 'un super titre de section' }
28+ . each { |champ | champ . type_de_champ . libelle = 'Un super titre de section' }
2929
3030 all_champs
3131 . filter { |champ | [ TypeDeChamp . type_champs . fetch ( :drop_down_list ) , TypeDeChamp . type_champs . fetch ( :multiple_drop_down_list ) ] . include? ( champ . type_champ ) }
@@ -39,6 +39,16 @@ def patron
3939 champ . value = '["option B", "option C"]'
4040 end
4141
42+ all_champs
43+ . filter { |champ | champ . type_champ == TypeDeChamp . type_champs . fetch ( :repetition ) }
44+ . each do |champ_repetition |
45+ libelles = [ 'Prénom' , 'Nom' ] ;
46+ champ_repetition . champs << libelles . map . with_index do |libelle , i |
47+ text_tdc = TypeDeChamp . new ( type_champ : :text , private : false , libelle : libelle , description : description , mandatory : true )
48+ text_tdc . champ . build ( id : all_champs . length + i )
49+ end
50+ end
51+
4252 type_champ_values = {
4353 TypeDeChamp . type_champs . fetch ( :date ) => '2016-07-26' ,
4454 TypeDeChamp . type_champs . fetch ( :datetime ) => '26/07/2016 07:35' ,
0 commit comments