2016-10-12 11:54:17 +02:00
|
|
|
-actual_header_section = nil
|
2016-06-06 16:32:59 +02:00
|
|
|
-@champs.each do |champ|
|
2016-10-12 11:54:17 +02:00
|
|
|
.row{class: (actual_header_section.nil? || champ.type_champ == 'header_section' ? '' : "header_section_"+actual_header_section.to_s)}
|
2016-06-06 16:32:59 +02:00
|
|
|
%div{class: "type_champ-#{champ.type_champ}"}
|
2016-07-20 11:38:19 +02:00
|
|
|
|
2016-10-12 11:54:17 +02:00
|
|
|
- if champ.type_champ == 'header_section'
|
2016-07-20 11:38:19 +02:00
|
|
|
=render partial: 'users/description/champs/header_section', locals: {champ: champ}
|
2016-10-12 11:54:17 +02:00
|
|
|
-actual_header_section = champ.id
|
2016-07-20 11:38:19 +02:00
|
|
|
|
2016-06-06 16:32:59 +02:00
|
|
|
-else
|
2016-10-27 13:43:10 +02:00
|
|
|
- unless champ.type_champ == 'checkbox' || champ.type_champ == 'engagement'
|
2016-10-12 11:54:17 +02:00
|
|
|
%h4
|
|
|
|
= champ.libelle
|
|
|
|
- if champ.mandatory?
|
|
|
|
= '*'
|
2016-06-06 16:32:59 +02:00
|
|
|
|
|
|
|
-if champ.type_champ == 'textarea'
|
2016-06-22 11:25:41 +02:00
|
|
|
=render partial: 'users/description/champs/textarea', locals: {champ: champ}
|
|
|
|
|
2016-10-12 11:54:17 +02:00
|
|
|
-elsif champ.type_champ == 'checkbox'
|
|
|
|
= render partial: 'users/description/champs/checkbox', 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
|
|
|
|
2016-07-12 15:25:26 +02:00
|
|
|
- elsif champ.type_champ == 'yes_no'
|
|
|
|
=render partial: 'users/description/champs/yes_no', locals: {champ: champ}
|
|
|
|
|
2016-08-09 16:21:39 +02:00
|
|
|
- elsif champ.type_champ == 'drop_down_list'
|
|
|
|
=render partial: 'users/description/champs/drop_down_list', locals: {champ: champ}
|
|
|
|
|
2016-10-12 17:22:56 +02:00
|
|
|
- elsif champ.type_champ == 'pays'
|
|
|
|
=render partial: 'users/description/champs/pays', locals: {champ: champ}
|
|
|
|
|
|
|
|
- elsif champ.type_champ == 'regions'
|
|
|
|
=render partial: 'users/description/champs/regions', locals: {champ: champ}
|
|
|
|
|
2016-10-27 13:43:10 +02:00
|
|
|
- elsif champ.type_champ == 'engagement'
|
|
|
|
=render partial: 'users/description/champs/engagement', locals: {champ: champ}
|
|
|
|
|
2016-10-12 17:22:56 +02:00
|
|
|
- elsif champ.type_champ == 'departements'
|
|
|
|
=render partial: 'users/description/champs/departements', 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
|