diff --git a/app/models/champs/pays_champ.rb b/app/models/champs/pays_champ.rb index d088d2880..78de3277f 100644 --- a/app/models/champs/pays_champ.rb +++ b/app/models/champs/pays_champ.rb @@ -2,4 +2,8 @@ class Champs::PaysChamp < Champs::TextChamp def self.pays ApiGeo::API.pays.pluck(:nom) end + + def self.disabled_options + pays.select { |v| (v =~ /^--.*--$/).present? } + end end diff --git a/app/views/shared/dossiers/editable_champs/_pays.html.haml b/app/views/shared/dossiers/editable_champs/_pays.html.haml index af0ee8b74..13062d8e5 100644 --- a/app/views/shared/dossiers/editable_champs/_pays.html.haml +++ b/app/views/shared/dossiers/editable_champs/_pays.html.haml @@ -1,4 +1,5 @@ = form.select :value, Champs::PaysChamp.pays, + disabled: Champs::PaysChamp.disabled_options, include_blank: true, required: champ.mandatory?