Add 3 new type de champs : Pays, Régions et Départements

This commit is contained in:
Xavier J 2016-10-12 17:22:56 +02:00
parent 2edcd5a40d
commit f1515616ff
12 changed files with 938 additions and 16 deletions

View file

@ -0,0 +1 @@
= render partial: 'users/description/champs/drop_down_template', locals: {values: Champ.departements, champ: champ}

View file

@ -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}

View file

@ -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

View file

@ -0,0 +1 @@
= render partial: 'users/description/champs/drop_down_template', locals: {values: Champ.pays, champ: champ}

View file

@ -0,0 +1,3 @@
= render partial: 'users/description/champs/drop_down_template', locals: {values: Champ.regions, champ: champ}