From 3822cef0b637c54c9622b77ea603123f96312625 Mon Sep 17 00:00:00 2001 From: Priit Tark Date: Wed, 10 Jun 2015 14:31:01 +0300 Subject: [PATCH] Registrar ident disabled #2618 --- app/models/depp/contact.rb | 2 +- .../contacts/form_partials/_general.haml | 49 +++++++++---------- 2 files changed, 25 insertions(+), 26 deletions(-) diff --git a/app/models/depp/contact.rb b/app/models/depp/contact.rb index 5233525d8..063fa0f1f 100644 --- a/app/models/depp/contact.rb +++ b/app/models/depp/contact.rb @@ -230,7 +230,7 @@ module Depp def extension_xml xml = { _anonymus: [] } - ident = ident_xml[:_anonymus].try(:first) + ident = ident_xml[:_anonymus].try(:first) if !persisted? legal = legal_document_xml[:_anonymus].try(:first) xml[:_anonymus] << ident if ident.present? xml[:_anonymus] << legal if legal.present? diff --git a/app/views/registrar/contacts/form_partials/_general.haml b/app/views/registrar/contacts/form_partials/_general.haml index 14037f05b..9e243103a 100644 --- a/app/views/registrar/contacts/form_partials/_general.haml +++ b/app/views/registrar/contacts/form_partials/_general.haml @@ -1,30 +1,29 @@ -- if !@contact.persisted? - .panel.panel-default - .panel-heading.clearfix - .pull-left= t(:ident) - .panel-body - .form-group - .col-md-3.control-label - = f.label :ident_country_code, t(:country) + '*' - .col-md-7 - = f.select(:ident_country_code, SortedCountry.all_options(f.object.ident_country_code), {}, - class: 'js-ident-country-code', required: true) +.panel.panel-default + .panel-heading.clearfix + .pull-left= t(:ident) + .panel-body + .form-group + .col-md-3.control-label + = f.label :ident_country_code, t(:country) + '*' + .col-md-7 + = f.select(:ident_country_code, SortedCountry.all_options(f.object.ident_country_code), {}, + class: 'js-ident-country-code', required: true, disabled: @contact.persisted?) - .form-group - .col-md-3.control-label - = f.label :ident_type, t(:type) + '*' - .col-md-7 - = f.select(:ident_type, Depp::Contact::SELECTION_TYPES, { selected: f.object.ident_type }, - class: 'js-ident-type', required: true) + .form-group + .col-md-3.control-label + = f.label :ident_type, t(:type) + '*' + .col-md-7 + = f.select(:ident_type, Depp::Contact::SELECTION_TYPES, { selected: f.object.ident_type }, + class: 'js-ident-type', required: true, disabled: @contact.persisted?) - .form-group - .col-md-3.control-label - = f.label :ident, t(:ident) + '*' - .col-md-7 - = f.text_field :ident, class: 'form-control', required: true - - tip_visibility = f.object.ident_type == 'birthday' ? '' : 'display: none' - .js-ident-tip{ style: tip_visibility } - = t(:birthday_format) + .form-group + .col-md-3.control-label + = f.label :ident, t(:ident) + '*' + .col-md-7 + = f.text_field :ident, class: 'form-control', required: true, disabled: @contact.persisted? + - tip_visibility = f.object.ident_type == 'birthday' ? '' : 'display: none' + .js-ident-tip{ style: tip_visibility } + = t(:birthday_format) .panel.panel-default .panel-heading.clearfix