Add type_de_champ yes/no
This commit is contained in:
parent
7281ee74b2
commit
23e582d597
4 changed files with 17 additions and 1 deletions
|
@ -44,6 +44,11 @@
|
||||||
@extend .col-lg-3;
|
@extend .col-lg-3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.type_champ-yes_no {
|
||||||
|
@extend .col-md-3;
|
||||||
|
@extend .col-lg-3;
|
||||||
|
}
|
||||||
|
|
||||||
.type_champ-phone {
|
.type_champ-phone {
|
||||||
@extend .col-md-2;
|
@extend .col-md-2;
|
||||||
@extend .col-lg-2;
|
@extend .col-lg-2;
|
||||||
|
|
|
@ -9,7 +9,8 @@ class TypeDeChamp < ActiveRecord::Base
|
||||||
civilite: 'civilite',
|
civilite: 'civilite',
|
||||||
email: 'email',
|
email: 'email',
|
||||||
phone: 'phone',
|
phone: 'phone',
|
||||||
address: 'address'
|
address: 'address',
|
||||||
|
yes_no: 'yes_no'
|
||||||
}
|
}
|
||||||
|
|
||||||
belongs_to :procedure
|
belongs_to :procedure
|
||||||
|
|
|
@ -23,6 +23,9 @@
|
||||||
- elsif champ.type_champ == 'datetime'
|
- elsif champ.type_champ == 'datetime'
|
||||||
=render partial: 'users/description/champs/datetime', locals: {champ: champ}
|
=render partial: 'users/description/champs/datetime', locals: {champ: champ}
|
||||||
|
|
||||||
|
- elsif champ.type_champ == 'yes_no'
|
||||||
|
=render partial: 'users/description/champs/yes_no', 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,
|
||||||
|
|
7
app/views/users/description/champs/_yes_no.html.haml
Normal file
7
app/views/users/description/champs/_yes_no.html.haml
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
%label.radio-inline
|
||||||
|
= radio_button_tag "champs['#{champ.id}']", "true", champ.value == 'true'
|
||||||
|
Oui
|
||||||
|
|
||||||
|
%label.radio-inline
|
||||||
|
= radio_button_tag "champs['#{champ.id}']", "false", champ.value == 'false'
|
||||||
|
Non
|
Loading…
Add table
Add a link
Reference in a new issue