Fix hidden checkbox bug, address field : full width

This commit is contained in:
Mathieu Magnin 2017-02-14 14:55:08 +01:00
parent b08a4c5091
commit f60098311e
3 changed files with 43 additions and 53 deletions

View file

@ -1,6 +1,2 @@
%h4{style:'margin-left:15px;'}
= champ.libelle
- if champ.mandatory?
= '*'
%input{type: 'hidden', name:"champs['#{champ.id}']", id: "champs_#{champ.id}", value: ''} %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')} %input{type: 'checkbox', style:'margin-left: 15px;', name:"champs['#{champ.id}']", id: "champs_#{champ.id}", checked: ('checked' if champ.value == 'on')}

View file

@ -1,8 +1,3 @@
%h4{style:'margin-left:15px;'} %div
= champ.libelle
- if champ.mandatory?
= '*'
%input{type: 'hidden', name:"champs['#{champ.id}']", id: "champs_#{champ.id}", value: ''} %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')} %input{type: 'checkbox', style:'margin-left: 15px;', name:"champs['#{champ.id}']", id: "champs_#{champ.id}", checked: ('checked' if champ.value == 'on')}
%div{style:'margin-left: 5%; margin-right: 5%; text-align: justify; text-justify: inter-word;'}
= champ.description.gsub(/\r\n/, '<br>').html_safe

View file

@ -3,9 +3,8 @@
- if champ.type_champ == 'header_section' - if champ.type_champ == 'header_section'
- break - break
- unless champ.type_champ == 'checkbox' || champ.type_champ == 'engagement'
.row .row
%div{ class: if champ.type_champ == 'textarea' then 'col-md-12' else 'col-md-6' end } %div{ class: if champ.type_champ == 'textarea' || champ.type_champ == 'engagement' then 'col-md-12' else 'col-md-6' end }
.form-group .form-group
%label{ for: "champs_#{ champ.id }"} %label{ for: "champs_#{ champ.id }"}
= champ.libelle = champ.libelle
@ -51,6 +50,6 @@
'data-provide' => champ.data_provide, 'data-provide' => champ.data_provide,
'data-date-format' => champ.data_date_format} 'data-date-format' => champ.data_date_format}
- unless champ.description.empty? || champ.type_champ == 'engagement' - unless champ.description.empty?
.help-block{ id:"description_champs_#{ champ.id }" } %div{ id:"description_champs_#{ champ.id }", class: ('help-block' unless champ.type_champ == 'engagement') }
= champ.description_with_links = champ.description_with_links