From 7c8e48e177f299bd854df111856317b3e7dce646 Mon Sep 17 00:00:00 2001 From: Artur Beljajev Date: Wed, 9 Nov 2016 18:38:09 +0200 Subject: [PATCH 1/4] Restore session feature specs #240 --- spec/features/registrar/sessions_spec.rb | 151 +++++++++++++++++++++++ 1 file changed, 151 insertions(+) create mode 100644 spec/features/registrar/sessions_spec.rb diff --git a/spec/features/registrar/sessions_spec.rb b/spec/features/registrar/sessions_spec.rb new file mode 100644 index 0000000000..649fac952c --- /dev/null +++ b/spec/features/registrar/sessions_spec.rb @@ -0,0 +1,151 @@ +require 'rails_helper' + +RSpec.feature 'Sessions', db: true do + context 'with invalid ip' do + it 'should not see login page' do + Setting.registrar_ip_whitelist_enabled = true + WhiteIp.destroy_all + visit registrar_login_path + page.should have_text('Access denied') + end + + it 'should see login page when whitelist disabled' do + Setting.registrar_ip_whitelist_enabled = false + WhiteIp.destroy_all + visit registrar_login_path + page.should_not have_text('Access denied') + Setting.registrar_ip_whitelist_enabled = true + end + + it 'should see Login' do + @fixed_registrar = Fabricate(:registrar, name: 'fixed registrar', code: 'FIXED') + @fixed_registrar.white_ips = [Fabricate(:white_ip_registrar)] + visit registrar_login_path + page.should have_text('Login') + end + + it 'should not get in with invalid ip' do + Fabricate(:registrar, white_ips: [Fabricate(:white_ip), Fabricate(:white_ip_registrar)]) + @api_user_invalid_ip = Fabricate( + :api_user, identity_code: '37810013294', registrar: Fabricate(:registrar, white_ips: []) + ) + visit registrar_login_path + fill_in 'depp_user_tag', with: @api_user_invalid_ip.username + fill_in 'depp_user_password', with: @api_user_invalid_ip.password + click_button 'Login' + page.should have_text('IP is not whitelisted') + end + end + + context 'as unknown user' do + before :example do + Fabricate(:api_user) + end + + it 'should not get in' do + client = instance_double("Digidoc::Client") + allow(client).to receive(:authenticate).and_return( + OpenStruct.new( + user_id_code: '123' + ) + ) + + allow(Digidoc::Client).to receive(:new) { client } + + visit registrar_login_path + page.should have_css('a[href="/registrar/login/mid"]') + + page.find('a[href="/registrar/login/mid"]').click + + fill_in 'user_phone', with: '00007' + click_button 'Login' + page.should have_text('No such user') + end + end + + context 'as known api user' do + before :example do + Fabricate(:api_user) + end + + it 'should not get in when external service fails' do + client = instance_double("Digidoc::Client") + allow(client).to receive(:authenticate).and_return( + OpenStruct.new( + faultcode: 'Fault', + detail: OpenStruct.new( + message: 'Something is wrong' + ) + ) + ) + + allow(Digidoc::Client).to receive(:new) { client } + + visit registrar_login_path + page.should have_css('a[href="/registrar/login/mid"]') + + page.find('a[href="/registrar/login/mid"]').click + + fill_in 'user_phone', with: '00007' + click_button 'Login' + page.should have_text('Something is wrong') + end + + it 'should not get in when there is a sim error', js: true do + client = instance_double("Digidoc::Client", session_code: '123') + + allow(client).to receive('session_code=') + + allow(client).to receive(:authenticate).and_return( + OpenStruct.new( + user_id_code: '14212128025' + ) + ) + + allow(client).to receive('authentication_status').and_return( + OpenStruct.new(status: 'SIM_ERROR') + ) + + allow(Digidoc::Client).to receive(:new) { client } + + visit registrar_login_path + page.should have_css('a[href="/registrar/login/mid"]') + + page.find('a[href="/registrar/login/mid"]').click + + fill_in 'user_phone', with: '00007' + click_button 'Login' + + page.should have_text('Confirmation sms was sent to your phone. Verification code is') + page.should have_text('SIM application error') + end + + it 'should Login successfully', js: true do + client = instance_double("Digidoc::Client", session_code: '123') + + allow(client).to receive('session_code=') + + allow(client).to receive(:authenticate).and_return( + OpenStruct.new( + user_id_code: '14212128025' + ) + ) + + allow(client).to receive('authentication_status').and_return( + OpenStruct.new(status: 'USER_AUTHENTICATED') + ) + + allow(Digidoc::Client).to receive(:new) { client } + + visit registrar_login_path + page.should have_css('a[href="/registrar/login/mid"]') + + page.find('a[href="/registrar/login/mid"]').click + + fill_in 'user_phone', with: '00007' + click_button 'Login' + + page.should have_text('Confirmation sms was sent to your phone. Verification code is') + end + end +end From 576c09b00d4657e3e93e6a97e759c40562c92389 Mon Sep 17 00:00:00 2001 From: Artur Beljajev Date: Wed, 9 Nov 2016 19:10:38 +0200 Subject: [PATCH 2/4] Do not reinitialize logger in digidoc #240 --- config/initializers/digidoc.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/initializers/digidoc.rb b/config/initializers/digidoc.rb index 864f2b4ef7..2b103f7506 100644 --- a/config/initializers/digidoc.rb +++ b/config/initializers/digidoc.rb @@ -1 +1 @@ -Digidoc::Client.logger = Syslog::Logger +Digidoc::Client.logger = Rails.application.config.logger From 2643df8d2151e0fab408260b1272163d6b79a780 Mon Sep 17 00:00:00 2001 From: Artur Beljajev Date: Wed, 9 Nov 2016 19:12:51 +0200 Subject: [PATCH 3/4] Improve registrar sessions specs registry-240 --- .../registrar/sessions_controller.rb | 6 ------ app/views/registrar/sessions/login.haml | 6 +++--- app/views/registrar/sessions/login_mid.haml | 6 +++--- config/locales/en.yml | 1 - config/locales/registrar/sessions.en.yml | 7 +++++++ .../registrar/login/mobile_id_spec.rb | 21 +++++++++++++++++++ .../registrar/sessions_routing_spec.rb | 9 ++++++++ 7 files changed, 43 insertions(+), 13 deletions(-) create mode 100644 config/locales/registrar/sessions.en.yml create mode 100644 spec/features/registrar/login/mobile_id_spec.rb create mode 100644 spec/routing/registrar/sessions_routing_spec.rb diff --git a/app/controllers/registrar/sessions_controller.rb b/app/controllers/registrar/sessions_controller.rb index ff97c4f2c4..2d04c6fdd6 100644 --- a/app/controllers/registrar/sessions_controller.rb +++ b/app/controllers/registrar/sessions_controller.rb @@ -101,12 +101,6 @@ def mid endpoint = "#{ENV['sk_digi_doc_service_endpoint']}" client = Digidoc::Client.new(endpoint) - if Rails.env.test? && phone == "123" - @user = ApiUser.find_by(identity_code: "14212128025") - sign_in(@user, event: :authentication) - return redirect_to registrar_root_url - end - # country_codes = {'+372' => 'EST'} phone.gsub!('+372', '') response = client.authenticate( diff --git a/app/views/registrar/sessions/login.haml b/app/views/registrar/sessions/login.haml index 8aaf8a01be..75ec951af9 100644 --- a/app/views/registrar/sessions/login.haml +++ b/app/views/registrar/sessions/login.haml @@ -8,13 +8,13 @@ - error_class = f.object.errors.any? ? 'has-error' : '' %div{class: error_class} = f.text_field :tag, class: 'form-control', placeholder: t(:username), required: true - = f.password_field :password, class: 'form-control', + = f.password_field :password, class: 'form-control', autocomplete: 'off', placeholder: t(:password), required: true - %button.btn.btn-lg.btn-primary.btn-block{:type => 'submit'}= t(:log_in) + %button.btn.btn-lg.btn-primary.btn-block{:type => 'submit'}= t('.login_btn') %hr - = link_to '/registrar/login/mid' do + = link_to '/registrar/login/mid', id: 'login-with-mobile-id-btn' do = image_tag 'mid.gif' = link_to '/registrar/id', method: :post do = image_tag 'id_card.gif' diff --git a/app/views/registrar/sessions/login_mid.haml b/app/views/registrar/sessions/login_mid.haml index 9a09a47eca..eeb18402d1 100644 --- a/app/views/registrar/sessions/login_mid.haml +++ b/app/views/registrar/sessions/login_mid.haml @@ -2,11 +2,11 @@ .form-signin.col-md-4.center-block.text-center %h2.form-signin-heading.text-center= t(:log_in_with_mid) %hr - = form_for @user, url: registrar_mid_path, auto_html5_validation: false, + = form_for @user, url: registrar_mid_path, auto_html5_validation: false, html: {class: 'form-signin'} do |f| - = f.text_field :phone, class: 'form-control', + = f.text_field :phone, class: 'form-control', placeholder: t(:phone_no), autocomplete: 'off', required: true - %button.btn.btn-lg.btn-primary.btn-block.js-login{:type => 'submit'}= t(:log_in) + %button.btn.btn-lg.btn-primary.btn-block.js-login{:type => 'submit'}= t('.login_btn') - if ['development', 'alpha'].include?(Rails.env) %div.text-center diff --git a/config/locales/en.yml b/config/locales/en.yml index a5bf12885e..cc211c4b34 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -531,7 +531,6 @@ en: ident_update_error: 'Parameter value policy error. Update of ident data not allowed [ident]' invoices: 'Invoices' no_such_user: 'No such user' - log_in: 'Log in' phone_no: 'Phone number' log_in_with_mid: 'Log in with mobile-id' confirmation_sms_was_sent_to_your_phone_verification_code_is: 'Confirmation sms was sent to your phone. Verification code is %{code}.' diff --git a/config/locales/registrar/sessions.en.yml b/config/locales/registrar/sessions.en.yml new file mode 100644 index 0000000000..25031e1895 --- /dev/null +++ b/config/locales/registrar/sessions.en.yml @@ -0,0 +1,7 @@ +en: + registrar: + sessions: + login: + login_btn: Login + login_mid: + login_btn: Login diff --git a/spec/features/registrar/login/mobile_id_spec.rb b/spec/features/registrar/login/mobile_id_spec.rb new file mode 100644 index 0000000000..9c1b42ee59 --- /dev/null +++ b/spec/features/registrar/login/mobile_id_spec.rb @@ -0,0 +1,21 @@ +require 'rails_helper' + +RSpec.feature 'Mobile ID login', db: true do + given!(:api_user) { Fabricate(:api_user, identity_code: 1234) } + + background do + Setting.registrar_ip_whitelist_enabled = false + digidoc_client = instance_double(Digidoc::Client, authenticate: OpenStruct.new(user_id_code: 1234), session_code: 1234) + allow(Digidoc::Client).to receive(:new).and_return(digidoc_client) + end + + scenario 'login with phone number' do + visit registrar_login_path + click_on 'login-with-mobile-id-btn' + + fill_in 'user[phone]', with: '1234' + click_button 'Login' + + expect(page).to have_text('Confirmation sms was sent to your phone. Verification code is') + end +end diff --git a/spec/routing/registrar/sessions_routing_spec.rb b/spec/routing/registrar/sessions_routing_spec.rb new file mode 100644 index 0000000000..24e075e58c --- /dev/null +++ b/spec/routing/registrar/sessions_routing_spec.rb @@ -0,0 +1,9 @@ +require 'rails_helper' + +RSpec.describe Registrar::SessionsController do + describe 'routing' do + it 'routes to #login' do + expect(get: '/registrar/login').to route_to('registrar/sessions#login') + end + end +end From 064716bebf15f30b02621ef0416595103e748866 Mon Sep 17 00:00:00 2001 From: Artur Beljajev Date: Fri, 11 Nov 2016 12:42:16 +0200 Subject: [PATCH 4/4] Rename en.registrar translation key to en.registrar_name #240 --- app/views/admin/account_activities/index.haml | 4 ++-- app/views/admin/api_users/_form.haml | 12 ++++++------ app/views/admin/api_users/index.haml | 2 +- app/views/admin/api_users/show.haml | 2 +- app/views/admin/contact_versions/index.haml | 2 +- app/views/admin/contact_versions/show.haml | 4 ++-- app/views/admin/contacts/index.haml | 4 ++-- app/views/admin/contacts/partials/_domains.haml | 4 ++-- app/views/admin/contacts/partials/_general.haml | 2 +- app/views/admin/domain_versions/archive.haml | 4 ++-- app/views/admin/domain_versions/show.haml | 2 +- app/views/admin/domains/index.haml | 4 ++-- app/views/admin/domains/partials/_general.haml | 2 +- app/views/admin/domains/versions.haml | 2 +- app/views/admin/epp_logs/index.haml | 4 ++-- app/views/admin/epp_logs/show.haml | 2 +- app/views/admin/repp_logs/index.haml | 4 ++-- app/views/admin/repp_logs/show.haml | 2 +- app/views/admin/white_ips/show.haml | 2 +- app/views/registrant/contacts/partials/_domains.haml | 4 ++-- app/views/registrant/contacts/partials/_general.haml | 2 +- app/views/registrant/domains/download_list.haml | 2 +- app/views/registrant/domains/index.haml | 2 +- app/views/registrant/domains/partials/_general.haml | 2 +- app/views/registrar/contacts/download_list.haml | 2 +- app/views/registrar/contacts/index.haml | 4 ++-- app/views/registrar/contacts/partials/_domains.haml | 4 ++-- app/views/registrar/domains/partials/_general.haml | 2 +- config/locales/en.yml | 3 +-- 29 files changed, 45 insertions(+), 46 deletions(-) diff --git a/app/views/admin/account_activities/index.haml b/app/views/admin/account_activities/index.haml index 0a60e0809e..e8653a237a 100644 --- a/app/views/admin/account_activities/index.haml +++ b/app/views/admin/account_activities/index.haml @@ -9,7 +9,7 @@ .row .col-md-12 .form-group - = f.label t(:registrar) + = f.label t(:registrar_name) = f.select :account_registrar_id_in, Registrar.all.map { |x| [x, x.id] }, {}, class: 'form-control js-combobox', placeholder: t(:choose), multiple: true .row .col-md-6 @@ -56,7 +56,7 @@ %thead %tr %th{class: 'col-xs-2'} - = sort_link(@q, 'account_registrar_code', t(:registrar)) + = sort_link(@q, 'account_registrar_code', t(:registrar_name)) %th{class: 'col-xs-3'} = sort_link(@q, 'description') %th{class: 'col-xs-2'} diff --git a/app/views/admin/api_users/_form.haml b/app/views/admin/api_users/_form.haml index 00e6bb2485..633f511efc 100644 --- a/app/views/admin/api_users/_form.haml +++ b/app/views/admin/api_users/_form.haml @@ -6,7 +6,7 @@ - field_required = '' -= form_for([:admin, @api_user], multipart: true, += form_for([:admin, @api_user], multipart: true, html: {class: 'form-horizontal', autocomplete: 'off'}) do |f| = render 'shared/full_errors', object: @api_user @@ -32,11 +32,11 @@ .form-group .form-group.has-feedback.js-typeahead-container .col-md-4.control-label - = f.label :registrar_typeahead, t(:registrar), class: 'required' + = f.label :registrar_typeahead, t(:registrar_name), class: 'required' .col-md-7 - = f.text_field(:registrar_typeahead, - class: 'form-control js-registrar-typeahead typeahead required', - placeholder: t(:registrar), autocomplete: 'off') + = f.text_field(:registrar_typeahead, + class: 'form-control js-registrar-typeahead typeahead required', + placeholder: t(:registrar_name), autocomplete: 'off') %span.glyphicon.glyphicon-ok.form-control-feedback.js-typeahead-ok.hidden %span.glyphicon.glyphicon-remove.form-control-feedback.js-typeahead-remove = f.hidden_field(:registrar_id, class: 'js-registrar-id') @@ -45,7 +45,7 @@ .col-md-4.control-label = f.label :role, class: 'required' .col-md-7 - = select_tag 'api_user[roles][]', + = select_tag 'api_user[roles][]', options_for_select(ApiUser::ROLES.map {|x| [t(x), x] }, @api_user.roles.try(:first)), class: 'form-control selectize' .checkbox diff --git a/app/views/admin/api_users/index.haml b/app/views/admin/api_users/index.haml index b8b9a53a5a..954335100e 100644 --- a/app/views/admin/api_users/index.haml +++ b/app/views/admin/api_users/index.haml @@ -11,7 +11,7 @@ %th{class: 'col-xs-2'} = sort_link(@q, 'username') %th{class: 'col-xs-2'} - = sort_link(@q, 'registrar_name', t(:registrar)) + = sort_link(@q, 'registrar_name', t(:registrar_name)) %th{class: 'col-xs-2'} = sort_link(@q, 'active', t(:active)) %tbody diff --git a/app/views/admin/api_users/show.haml b/app/views/admin/api_users/show.haml index 8660847363..b410d784d3 100644 --- a/app/views/admin/api_users/show.haml +++ b/app/views/admin/api_users/show.haml @@ -23,7 +23,7 @@ %dt= t(:password) %dd= @api_user.password - %dt= t(:registrar) + %dt= t(:registrar_name) %dd= link_to(@api_user.registrar, admin_registrar_path(@api_user.registrar)) %dt= t(:role) diff --git a/app/views/admin/contact_versions/index.haml b/app/views/admin/contact_versions/index.haml index 93699d4e33..85975d5be5 100644 --- a/app/views/admin/contact_versions/index.haml +++ b/app/views/admin/contact_versions/index.haml @@ -50,7 +50,7 @@ %th{class: 'col-xs-2'} = t(:ident) %th{class: 'col-xs-2'} - = t(:registrar) + = t(:registrar_name) %th{class: 'col-xs-2'} = t(:action) %th{class: 'col-xs-2'} diff --git a/app/views/admin/contact_versions/show.haml b/app/views/admin/contact_versions/show.haml index fc5c483528..82a96daba1 100644 --- a/app/views/admin/contact_versions/show.haml +++ b/app/views/admin/contact_versions/show.haml @@ -49,7 +49,7 @@ %dd{class: changing_css_class(@version,"updated_at")} = l(contact.updated_at, format: :short) - %dt= t(:registrar) + %dt= t(:registrar_name) %dd{class: changing_css_class(@version,"registrar_id")} - if contact.registrar.present? = link_to(contact.registrar, admin_registrar_path(contact.registrar)) @@ -105,4 +105,4 @@ = l(vs.created_at, format: :short) = vs.event %span{:style => "padding-left:10px; position: absolute; bottom: 10px;"} - = paginate @versions, theme: :admin \ No newline at end of file + = paginate @versions, theme: :admin diff --git a/app/views/admin/contacts/index.haml b/app/views/admin/contacts/index.haml index 2448fc1d71..9c015c3728 100644 --- a/app/views/admin/contacts/index.haml +++ b/app/views/admin/contacts/index.haml @@ -36,7 +36,7 @@ .row .col-md-3 .form-group - = f.label t(:registrar) + = f.label t(:registrar_name) = f.select :registrar_id_eq, Registrar.all.map { |x| [x, x.id] }, { include_blank: true }, class: 'form-control selectize', placeholder: t(:choose) .col-md-3 .form-group @@ -88,7 +88,7 @@ %th{class: 'col-xs-2'} = sort_link(@q, 'email', t(:created_at)) %th{class: 'col-xs-2'} - = sort_link(@q, 'registrar_name', t(:registrar)) + = sort_link(@q, 'registrar_name', t(:registrar_name)) %tbody - @contacts.each do |contact| %tr diff --git a/app/views/admin/contacts/partials/_domains.haml b/app/views/admin/contacts/partials/_domains.haml index 97eee3d5a9..7736e62ac5 100644 --- a/app/views/admin/contacts/partials/_domains.haml +++ b/app/views/admin/contacts/partials/_domains.haml @@ -16,7 +16,7 @@ %thead %tr %th{class: 'col-xs-3'}=custom_sort_link t(:domain_name), :name - %th{class: 'col-xs-3'}=custom_sort_link t(:registrar), :registrar_name + %th{class: 'col-xs-3'}=custom_sort_link t(:registrar_name), :registrar_name %th{class: 'col-xs-3'}=custom_sort_link t(:valid_to), :valid_to %th{class: 'col-xs-3'}= t(:roles) %tbody @@ -27,4 +27,4 @@ %td= l(x.valid_to, format: :short) %td= x.roles.join(", ") -= paginate domains, param_name: :domain_page \ No newline at end of file += paginate domains, param_name: :domain_page diff --git a/app/views/admin/contacts/partials/_general.haml b/app/views/admin/contacts/partials/_general.haml index 64f17612e0..73565ad640 100644 --- a/app/views/admin/contacts/partials/_general.haml +++ b/app/views/admin/contacts/partials/_general.haml @@ -39,7 +39,7 @@ by = updator_link(@contact) - %dt= t(:registrar) + %dt= t(:registrar_name) %dd - if @contact.registrar.present? = link_to(@contact.registrar, admin_registrar_path(@contact.registrar)) diff --git a/app/views/admin/domain_versions/archive.haml b/app/views/admin/domain_versions/archive.haml index 4e06f5ccb6..b85e74b818 100644 --- a/app/views/admin/domain_versions/archive.haml +++ b/app/views/admin/domain_versions/archive.haml @@ -14,7 +14,7 @@ = f.search_field :registrant, value: params[:q][:registrant], class: 'form-control', placeholder: t(:registrant) .col-md-3 .form-group - = label_tag t(:registrar) + = label_tag t(:registrar_name) = f.search_field :registrar, value: params[:q][:registrar], class: 'form-control', placeholder: t(:registrant) .col-md-3 .form-group @@ -48,7 +48,7 @@ %th{class: 'col-xs-2'} = t(:registrant) %th{class: 'col-xs-2'} - = t(:registrar) + = t(:registrar_name) %th{class: 'col-xs-2'} = t(:action) %th{class: 'col-xs-2'} diff --git a/app/views/admin/domain_versions/show.haml b/app/views/admin/domain_versions/show.haml index add5920fb3..4382b13abe 100644 --- a/app/views/admin/domain_versions/show.haml +++ b/app/views/admin/domain_versions/show.haml @@ -98,7 +98,7 @@ %br - if domain.registrar - %dt= t(:registrar) + %dt= t(:registrar_name) %dd{class: changing_css_class(@version,"registrar_id")} = link_to admin_registrar_path(domain.registrar), target: "registrar_#{domain.registrar.id}" do = domain.registrar.name diff --git a/app/views/admin/domains/index.haml b/app/views/admin/domains/index.haml index d6c2a9be99..f901354a65 100644 --- a/app/views/admin/domains/index.haml +++ b/app/views/admin/domains/index.haml @@ -23,7 +23,7 @@ .row .col-md-6 .form-group - = f.label t(:registrar) + = f.label t(:registrar_name) = f.select :registrar_id_eq, Registrar.all.map { |x| [x, x.id] }, { include_blank: true }, class: 'form-control selectize', placeholder: t(:choose) .col-md-3 .form-group @@ -63,7 +63,7 @@ %th{class: 'col-xs-2'} = sort_link(@q, 'valid_to', t(:valid_to)) %th{class: 'col-xs-2'} - = sort_link(@q, 'registrar_name', t(:registrar)) + = sort_link(@q, 'registrar_name', t(:registrar_name)) %tbody - @domains.each do |x| %tr diff --git a/app/views/admin/domains/partials/_general.haml b/app/views/admin/domains/partials/_general.haml index d1a17c1cca..0e458abd85 100644 --- a/app/views/admin/domains/partials/_general.haml +++ b/app/views/admin/domains/partials/_general.haml @@ -9,7 +9,7 @@ %dt= t(:registered_at) %dd= l(@domain.registered_at) - %dt= t(:registrar) + %dt= t(:registrar_name) %dd= link_to(@domain.registrar, admin_registrar_path(@domain.registrar)) %dt= t(:authinfo_pw) diff --git a/app/views/admin/domains/versions.haml b/app/views/admin/domains/versions.haml index 6dbf706f69..9e2cf28038 100644 --- a/app/views/admin/domains/versions.haml +++ b/app/views/admin/domains/versions.haml @@ -16,7 +16,7 @@ %th{class: 'col-xs-2'}= t(:tech) %th{class: 'col-xs-2'}= t(:nameservers) %th{class: 'col-xs-2'}= t(:dnskeys) - %th{class: 'col-xs-2'}= t(:registrar) + %th{class: 'col-xs-2'}= t(:registrar_name) %tbody -#- if @pending_domain.present? diff --git a/app/views/admin/epp_logs/index.haml b/app/views/admin/epp_logs/index.haml index 3bb8536d38..922a61fcbc 100644 --- a/app/views/admin/epp_logs/index.haml +++ b/app/views/admin/epp_logs/index.haml @@ -27,7 +27,7 @@ .col-md-3 .form-group = f.label :registrar - = f.search_field :api_user_registrar_cont, class: 'form-control', placeholder: t(:registrar), autocomplete: 'off' + = f.search_field :api_user_registrar_cont, class: 'form-control', placeholder: t(:registrar_name), autocomplete: 'off' .col-md-3 .form-group = f.label t(:created_after) @@ -55,7 +55,7 @@ %th{class: 'col-xs-2'}= t(:request_object) %th{class: 'col-xs-2'}= t(:request_successful) %th{class: 'col-xs-2'}= t(:api_user) - %th{class: 'col-xs-2'}= t(:registrar) + %th{class: 'col-xs-2'}= t(:registrar_name) %th{class: 'col-xs-2'} = sort_link(@q, 'created_at') %tbody diff --git a/app/views/admin/epp_logs/show.haml b/app/views/admin/epp_logs/show.haml index 583124af7d..91e82272ac 100644 --- a/app/views/admin/epp_logs/show.haml +++ b/app/views/admin/epp_logs/show.haml @@ -21,7 +21,7 @@ %dt= t(:api_user) %dd= @epp_log.api_user_name - %dt= t(:registrar) + %dt= t(:registrar_name) %dd= @epp_log.api_user_registrar %dt= t(:ip) diff --git a/app/views/admin/repp_logs/index.haml b/app/views/admin/repp_logs/index.haml index 49c74405b4..c49eb889a9 100644 --- a/app/views/admin/repp_logs/index.haml +++ b/app/views/admin/repp_logs/index.haml @@ -25,7 +25,7 @@ .col-md-3 .form-group = f.label :registrar - = f.search_field :api_user_registrar_cont, class: 'form-control', placeholder: t(:registrar), autocomplete: 'off' + = f.search_field :api_user_registrar_cont, class: 'form-control', placeholder: t(:registrar_name), autocomplete: 'off' .col-md-3 .form-group = f.label t(:created_after) @@ -52,7 +52,7 @@ %th{class: 'col-xs-2'}= t(:request_method) %th{class: 'col-xs-2'}= t(:response_code) %th{class: 'col-xs-2'}= t(:api_user) - %th{class: 'col-xs-2'}= t(:registrar) + %th{class: 'col-xs-2'}= t(:registrar_name) %th{class: 'col-xs-2'} = sort_link(@q, 'created_at') %tbody diff --git a/app/views/admin/repp_logs/show.haml b/app/views/admin/repp_logs/show.haml index a2bc6c4ccb..bbaae977f5 100644 --- a/app/views/admin/repp_logs/show.haml +++ b/app/views/admin/repp_logs/show.haml @@ -21,7 +21,7 @@ %dt= t(:api_user) %dd= @repp_log.api_user_name - %dt= t(:registrar) + %dt= t(:registrar_name) %dd= @repp_log.api_user_registrar %dt= t(:ip) diff --git a/app/views/admin/white_ips/show.haml b/app/views/admin/white_ips/show.haml index 0cfec654cc..33688d9fe0 100644 --- a/app/views/admin/white_ips/show.haml +++ b/app/views/admin/white_ips/show.haml @@ -11,7 +11,7 @@ %h3.panel-title= t(:general) .panel-body %dl.dl-horizontal - %dt= t(:registrar) + %dt= t(:registrar_name) %dd= link_to(@registrar, [:admin, @registrar]) %dt= t(:ipv4) diff --git a/app/views/registrant/contacts/partials/_domains.haml b/app/views/registrant/contacts/partials/_domains.haml index eb893053da..8787f088ac 100644 --- a/app/views/registrant/contacts/partials/_domains.haml +++ b/app/views/registrant/contacts/partials/_domains.haml @@ -16,7 +16,7 @@ %thead %tr %th{class: 'col-xs-3'}=custom_sort_link t(:domain_name), :name - %th{class: 'col-xs-3'}=custom_sort_link t(:registrar), :registrar_name + %th{class: 'col-xs-3'}=custom_sort_link t(:registrar_name), :registrar_name %th{class: 'col-xs-3'}=custom_sort_link t(:valid_to), :valid_to %th{class: 'col-xs-3'}=custom_sort_link t(:roles), :roles %tbody @@ -27,4 +27,4 @@ %td= l(x.valid_to, format: :short) %td= x.roles.join(", ") -= paginate domains, param_name: :domain_page \ No newline at end of file += paginate domains, param_name: :domain_page diff --git a/app/views/registrant/contacts/partials/_general.haml b/app/views/registrant/contacts/partials/_general.haml index 114988bcc3..4b221714ad 100644 --- a/app/views/registrant/contacts/partials/_general.haml +++ b/app/views/registrant/contacts/partials/_general.haml @@ -42,7 +42,7 @@ by = @contact.name - %dt= t(:registrar) + %dt= t(:registrar_name) %dd - if @contact.registrar.present? = link_to(@contact.registrar, registrant_registrar_path(@contact.registrar)) diff --git a/app/views/registrant/domains/download_list.haml b/app/views/registrant/domains/download_list.haml index 40212812c4..481324e62a 100644 --- a/app/views/registrant/domains/download_list.haml +++ b/app/views/registrant/domains/download_list.haml @@ -16,7 +16,7 @@ %th{class: 'col-xs-2'} =t(:valid_to) %th{class: 'col-xs-2'} - =t(:registrar) + =t(:registrar_name) %tbody - @domains.result.each do |x| %tr diff --git a/app/views/registrant/domains/index.haml b/app/views/registrant/domains/index.haml index ca31d127d9..319ff7688b 100644 --- a/app/views/registrant/domains/index.haml +++ b/app/views/registrant/domains/index.haml @@ -61,7 +61,7 @@ %th{class: 'col-xs-2'} = sort_link(@q, 'valid_to', t(:valid_to)) %th{class: 'col-xs-2'} - = sort_link(@q, 'registrar_name', t(:registrar)) + = sort_link(@q, 'registrar_name', t(:registrar_name)) %tbody - @domains.each do |x| %tr diff --git a/app/views/registrant/domains/partials/_general.haml b/app/views/registrant/domains/partials/_general.haml index d80c1ce6ab..7fb355c1f2 100644 --- a/app/views/registrant/domains/partials/_general.haml +++ b/app/views/registrant/domains/partials/_general.haml @@ -9,7 +9,7 @@ %dt= t(:registered_at) %dd= l(@domain.registered_at) - %dt= t(:registrar) + %dt= t(:registrar_name) %dd= link_to(@domain.registrar, registrant_registrar_path(@domain.registrar)) %dt= t(:authinfo_pw) diff --git a/app/views/registrar/contacts/download_list.haml b/app/views/registrar/contacts/download_list.haml index b8944d254d..51423a3f22 100644 --- a/app/views/registrar/contacts/download_list.haml +++ b/app/views/registrar/contacts/download_list.haml @@ -19,7 +19,7 @@ %th{class: 'col-xs-2'} =t(:created_at) %th{class: 'col-xs-2'} - =t(:registrar) + =t(:registrar_name) %tbody - @contacts.each do |contact| %tr diff --git a/app/views/registrar/contacts/index.haml b/app/views/registrar/contacts/index.haml index 2226f7c6aa..3e0e598267 100644 --- a/app/views/registrar/contacts/index.haml +++ b/app/views/registrar/contacts/index.haml @@ -38,7 +38,7 @@ .row .col-md-3 .form-group - = f.label t(:registrar) + = f.label t(:registrar_name) = f.select :registrar_id_eq, Registrar.all.map { |x| [x, x.id] }, { include_blank: true }, class: 'form-control selectize', placeholder: t(:choose) .col-md-3 .form-group @@ -97,7 +97,7 @@ %th{class: 'col-xs-2'} = sort_link(@q, 'email', t(:created_at)) %th{class: 'col-xs-2'} - = sort_link(@q, 'registrar_name', t(:registrar)) + = sort_link(@q, 'registrar_name', t(:registrar_name)) %th{class: 'col-xs-2'}= t(:actions) %tbody - @contacts.each do |contact| diff --git a/app/views/registrar/contacts/partials/_domains.haml b/app/views/registrar/contacts/partials/_domains.haml index efdf78504d..f580195672 100644 --- a/app/views/registrar/contacts/partials/_domains.haml +++ b/app/views/registrar/contacts/partials/_domains.haml @@ -16,7 +16,7 @@ %thead %tr %th{class: 'col-xs-3'}=custom_sort_link t(:domain_name), :name - %th{class: 'col-xs-3'}=custom_sort_link t(:registrar), :registrar_name + %th{class: 'col-xs-3'}=custom_sort_link t(:registrar_name), :registrar_name %th{class: 'col-xs-3'}=custom_sort_link t(:valid_to), :valid_to %th{class: 'col-xs-3'}= t(:roles) %tbody @@ -27,4 +27,4 @@ %td= l(x.valid_to, format: :short) %td= x.roles.join(", ") -= paginate domains, param_name: :domain_page \ No newline at end of file += paginate domains, param_name: :domain_page diff --git a/app/views/registrar/domains/partials/_general.haml b/app/views/registrar/domains/partials/_general.haml index 5381d0865e..0f1a2a831b 100644 --- a/app/views/registrar/domains/partials/_general.haml +++ b/app/views/registrar/domains/partials/_general.haml @@ -7,7 +7,7 @@ %dd= @data.css('pw').text.present? ? @data.css('pw').text : t('hidden') - if @data.css('pw').text.blank? - %dt= t(:registrar) + %dt= t(:registrar_name) %dd= @data.css('clID').text - registrant = Contact.find_by_code(@data.css('registrant').text) diff --git a/config/locales/en.yml b/config/locales/en.yml index cc211c4b34..abb9fb2896 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -285,7 +285,7 @@ en: valid_to: 'Valid to' name: 'Name' transfer_can_be_approved_only_by_current_registrar: 'Transfer can be approved only by current domain registrar' - registrar: 'Registrar' + registrar_name: 'Registrar' owner: 'Registrant' domain_details: 'Domain details' registered_at: 'Registered at' @@ -440,7 +440,6 @@ en: setting: 'Setting' - registrar: 'Registrar' transfer_requested: 'Transfer requested.' message_was_not_found: 'Message was not found' host_obj_is_not_allowed: 'hostObj object is not allowed'