Move date input in a partial

This commit is contained in:
Mathieu Magnin 2017-06-08 18:07:00 +02:00
parent 689a7257f2
commit 95481e7b85
2 changed files with 12 additions and 3 deletions

View 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 }

View file

@ -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') }