diff --git a/app/assets/stylesheets/shared/general.sass b/app/assets/stylesheets/shared/general.sass index 586fa1538..e6eb54ccf 100644 --- a/app/assets/stylesheets/shared/general.sass +++ b/app/assets/stylesheets/shared/general.sass @@ -62,3 +62,6 @@ body > .container border: 1px solid #dddddd padding-left: 4px padding-right: 4px + +.disabled-value + padding-top: 8px diff --git a/app/views/registrar/contacts/form_partials/_general.haml b/app/views/registrar/contacts/form_partials/_general.haml index ec408cbdc..f2a7e9875 100644 --- a/app/views/registrar/contacts/form_partials/_general.haml +++ b/app/views/registrar/contacts/form_partials/_general.haml @@ -6,8 +6,10 @@ .col-md-3.control-label = f.label :ident_country_code, t(:country) + '*' .col-md-7 - - if f.object.ident_country_code.present? - = Country.new(f.object.ident_country_code).try(:to_s) + - if @contact.persisted? && f.object.ident_country_code.present? + .disabled-value + = Country.new(f.object.ident_country_code).try(:to_s) + = " [#{f.object.ident_country_code}]" - else = f.select(:ident_country_code, SortedCountry.all_options(f.object.ident_country_code), {}, class: 'js-ident-country-code', required: true) @@ -16,9 +18,10 @@ .col-md-3.control-label = f.label :ident_type, t(:type) + '*' .col-md-7 - - if f.object.ident_type.present? - = Depp::Contact.type_string(f.object.ident_type) - = " [#{f.object.ident_type}]" + - if @contact.persisted? && f.object.ident_type.present? + .disabled-value + = Depp::Contact.type_string(f.object.ident_type) + = " [#{f.object.ident_type}]" - else = f.select(:ident_type, Depp::Contact::SELECTION_TYPES, { selected: f.object.ident_type },