Add 3 new type de champs : Pays, Régions et Départements
This commit is contained in:
parent
2edcd5a40d
commit
f1515616ff
12 changed files with 938 additions and 16 deletions
|
@ -0,0 +1 @@
|
|||
= render partial: 'users/description/champs/drop_down_template', locals: {values: Champ.departements, champ: champ}
|
|
@ -1,14 +1 @@
|
|||
%select{ name:"champs['#{champ.id}']",
|
||||
id: "champs_#{champ.id}" }
|
||||
- unless champ.drop_down_list.blank?
|
||||
- champ.drop_down_list.options.each do |option|
|
||||
- if (option=~ /^--.*--$/).nil?
|
||||
- if champ.value == option
|
||||
%option{selected:''}
|
||||
= option
|
||||
- else
|
||||
%option
|
||||
= option
|
||||
-else
|
||||
%option{disabled:''}
|
||||
= option
|
||||
= render partial: 'users/description/champs/drop_down_template', locals: {values: champ.drop_down_list.options, champ: champ}
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
%select{ name:"champs['#{champ.id}']",
|
||||
id: "champs_#{champ.id}" }
|
||||
|
||||
- unless values.blank?
|
||||
%option
|
||||
= ''
|
||||
|
||||
- values.each do |option|
|
||||
- if (option=~ /^--.*--$/).nil?
|
||||
- if champ.value == option
|
||||
%option{selected:''}
|
||||
= option
|
||||
- else
|
||||
%option
|
||||
= option
|
||||
-else
|
||||
%option{disabled:''}
|
||||
= option
|
1
app/views/users/description/champs/_pays.html.haml
Normal file
1
app/views/users/description/champs/_pays.html.haml
Normal file
|
@ -0,0 +1 @@
|
|||
= render partial: 'users/description/champs/drop_down_template', locals: {values: Champ.pays, champ: champ}
|
3
app/views/users/description/champs/_regions.html.haml
Normal file
3
app/views/users/description/champs/_regions.html.haml
Normal file
|
@ -0,0 +1,3 @@
|
|||
= render partial: 'users/description/champs/drop_down_template', locals: {values: Champ.regions, champ: champ}
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue