Move date input in a partial
This commit is contained in:
parent
689a7257f2
commit
95481e7b85
2 changed files with 12 additions and 3 deletions
7
app/views/users/description/champs/_date.html.haml
Normal file
7
app/views/users/description/champs/_date.html.haml
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
%input.form-control{ name: "champs['#{champ.id}']",
|
||||||
|
placeholder: champ.libelle,
|
||||||
|
id: "champs_#{champ.id}",
|
||||||
|
value: champ.value,
|
||||||
|
type: champ.type_champ,
|
||||||
|
"data-provide": champ.data_provide,
|
||||||
|
"data-date-format": champ.data_date_format }
|
|
@ -47,14 +47,16 @@
|
||||||
|
|
||||||
- when 'explication'
|
- when 'explication'
|
||||||
|
|
||||||
|
- when 'date'
|
||||||
|
= render partial: 'users/description/champs/date', locals: { champ: champ }
|
||||||
|
|
||||||
- else
|
- else
|
||||||
%input.form-control{ name: "champs['#{champ.id}']",
|
%input.form-control{ name: "champs['#{champ.id}']",
|
||||||
placeholder: champ.libelle,
|
placeholder: champ.libelle,
|
||||||
id: "champs_#{champ.id}",
|
id: "champs_#{champ.id}",
|
||||||
value: champ.value,
|
value: champ.value,
|
||||||
type: champ.type_champ,
|
type: champ.type_champ }
|
||||||
'data-provide' => champ.data_provide,
|
|
||||||
'data-date-format' => champ.data_date_format }
|
|
||||||
|
|
||||||
- unless champ.description.empty?
|
- unless champ.description.empty?
|
||||||
%div{ id: "description_champs_#{champ.id}", class: ('help-block' unless champ.type_champ == 'engagement') }
|
%div{ id: "description_champs_#{champ.id}", class: ('help-block' unless champ.type_champ == 'engagement') }
|
||||||
|
|
Loading…
Reference in a new issue