group related options in zone select box
This commit is contained in:
parent
99665d8119
commit
829d644c10
3 changed files with 13 additions and 1 deletions
9
app/helpers/zone_helper.rb
Normal file
9
app/helpers/zone_helper.rb
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
module ZoneHelper
|
||||||
|
def grouped_options_for_zone
|
||||||
|
collectivite = Zone.find_by(acronym: "COLLECTIVITE")
|
||||||
|
{
|
||||||
|
"--" => [[I18n.t('i_dont_know', scope: 'utils'), nil], [collectivite.label, collectivite.id]],
|
||||||
|
I18n.t('ministeres', scope: 'zones') => (Zone.order(:label) - [collectivite]).map { |m| [m.label, m.id] }
|
||||||
|
}
|
||||||
|
end
|
||||||
|
end
|
|
@ -16,7 +16,7 @@
|
||||||
= f.label :zone do
|
= f.label :zone do
|
||||||
= t('zone', scope: 'activerecord.attributes.procedure')
|
= t('zone', scope: 'activerecord.attributes.procedure')
|
||||||
%span.mandatory *
|
%span.mandatory *
|
||||||
= f.collection_select :zone_id, Zone.order(:label), :id, :label, prompt: true
|
= f.select :zone_id, grouped_options_for_zone
|
||||||
|
|
||||||
%h3.header-subsection Logo de la démarche
|
%h3.header-subsection Logo de la démarche
|
||||||
= image_upload_and_render f, @procedure.logo
|
= image_upload_and_render f, @procedure.logo
|
||||||
|
|
|
@ -24,6 +24,7 @@ fr:
|
||||||
utils:
|
utils:
|
||||||
'yes': Oui
|
'yes': Oui
|
||||||
'no': Non
|
'no': Non
|
||||||
|
i_dont_know: Je ne sais pas
|
||||||
deconnexion: "Déconnexion"
|
deconnexion: "Déconnexion"
|
||||||
pj: "Pièces jointes"
|
pj: "Pièces jointes"
|
||||||
asterisk_html: Les champs suivis d’un astérisque ( <span class = mandatory> * </span> ) sont obligatoires.
|
asterisk_html: Les champs suivis d’un astérisque ( <span class = mandatory> * </span> ) sont obligatoires.
|
||||||
|
@ -442,6 +443,8 @@ fr:
|
||||||
ready: "Validé"
|
ready: "Validé"
|
||||||
needs_configuration: "À configurer"
|
needs_configuration: "À configurer"
|
||||||
configure_api_particulier_token: "Configurer le jeton API particulier"
|
configure_api_particulier_token: "Configurer le jeton API particulier"
|
||||||
|
zones:
|
||||||
|
ministeres: Ministères
|
||||||
france_connect:
|
france_connect:
|
||||||
particulier:
|
particulier:
|
||||||
password_confirmation:
|
password_confirmation:
|
||||||
|
|
Loading…
Reference in a new issue