2016-06-06 16:32:59 +02:00
|
|
|
-@champs.each do |champ|
|
|
|
|
.row
|
|
|
|
%div{class: "type_champ-#{champ.type_champ}"}
|
|
|
|
-if champ.type_champ == 'checkbox'
|
|
|
|
%h4{style:'margin-left:15px;'}
|
|
|
|
= champ.libelle
|
|
|
|
- if champ.mandatory?
|
|
|
|
= '*'
|
|
|
|
%input{type: 'hidden', name:"champs['#{champ.id}']", id: "champs_#{champ.id}", value: ''}
|
|
|
|
%input{type: 'checkbox', style:'margin-left: 15px;', name:"champs['#{champ.id}']", id: "champs_#{champ.id}", checked: ('checked' if champ.value == 'on')}
|
|
|
|
-else
|
|
|
|
%h4
|
|
|
|
= champ.libelle
|
|
|
|
- if champ.mandatory?
|
|
|
|
= '*'
|
|
|
|
|
|
|
|
-if champ.type_champ == 'textarea'
|
2016-06-22 11:25:41 +02:00
|
|
|
=render partial: 'users/description/champs/textarea', locals: {champ: champ}
|
|
|
|
|
2016-06-06 16:32:59 +02:00
|
|
|
-elsif champ.type_champ == 'civilite'
|
2016-06-22 11:25:41 +02:00
|
|
|
=render partial: 'users/description/champs/civilite', locals: {champ: champ}
|
2016-06-06 16:32:59 +02:00
|
|
|
|
2016-06-22 11:25:41 +02:00
|
|
|
- elsif champ.type_champ == 'datetime'
|
|
|
|
=render partial: 'users/description/champs/datetime', locals: {champ: champ}
|
2016-06-06 16:32:59 +02:00
|
|
|
|
|
|
|
-else
|
|
|
|
%input.form-control{name:"champs['#{champ.id}']",
|
|
|
|
placeholder: champ.libelle,
|
|
|
|
id: "champs_#{champ.id}",
|
|
|
|
value: champ.value,
|
|
|
|
type: champ.type_champ,
|
2016-06-09 12:08:18 +02:00
|
|
|
'data-provide' => champ.data_provide,
|
2016-06-22 11:25:41 +02:00
|
|
|
'data-date-format' => champ.data_date_format}
|
2016-06-13 12:03:05 +02:00
|
|
|
|
2016-06-09 14:18:28 +02:00
|
|
|
- unless champ.description.empty?
|
|
|
|
.row
|
|
|
|
.col-lg-8.col-md-8{class: 'description_div', id:"description_champs_#{champ.id}"}
|
|
|
|
= champ.description
|