mirror of
https://github.com/internetee/registry.git
synced 2025-06-07 21:25:39 +02:00
Merge branch 'master' into registry-623
# Conflicts: # app/controllers/admin/registrars_controller.rb # app/models/registrar.rb # app/views/admin/registrars/_billing.html.erb # app/views/admin/registrars/show.html.erb # config/locales/admin/registrars.en.yml # config/locales/en.yml # db/migrate/20180309053424_add_registrars_unique_constraints.rb # db/structure.sql # test/fixtures/registrars.yml # test/integration/admin/registrars/delete_test.rb # test/integration/admin/registrars/new_test.rb # test/models/registrar_test.rb
This commit is contained in:
commit
837f326ef6
37 changed files with 232 additions and 245 deletions
2
.reek
2
.reek
|
@ -191,7 +191,6 @@ DuplicateMethodCall:
|
||||||
- Registrant::SessionsController#mid_status
|
- Registrant::SessionsController#mid_status
|
||||||
- Registrant::WhoisController#index
|
- Registrant::WhoisController#index
|
||||||
- Registrar::AccountActivitiesController#index
|
- Registrar::AccountActivitiesController#index
|
||||||
- Registrar::BaseController#check_ip
|
|
||||||
- Registrar::ContactsController#download_list
|
- Registrar::ContactsController#download_list
|
||||||
- Registrar::ContactsController#index
|
- Registrar::ContactsController#index
|
||||||
- Registrar::ContactsController#normalize_search_parameters
|
- Registrar::ContactsController#normalize_search_parameters
|
||||||
|
@ -667,7 +666,6 @@ TooManyStatements:
|
||||||
- Registrant::SessionsController#mid
|
- Registrant::SessionsController#mid
|
||||||
- Registrant::SessionsController#mid_status
|
- Registrant::SessionsController#mid_status
|
||||||
- Registrar::AccountActivitiesController#index
|
- Registrar::AccountActivitiesController#index
|
||||||
- Registrar::BaseController#check_ip
|
|
||||||
- Registrar::ContactsController#download_list
|
- Registrar::ContactsController#download_list
|
||||||
- Registrar::ContactsController#index
|
- Registrar::ContactsController#index
|
||||||
- Registrar::ContactsController#normalize_search_parameters
|
- Registrar::ContactsController#normalize_search_parameters
|
||||||
|
|
|
@ -1,3 +1,10 @@
|
||||||
|
19.03.2018
|
||||||
|
* EPP transfer and REPP bulk transfer reuses contact objects [#746](https://github.com/internetee/registry/issues/746)
|
||||||
|
* Gems: Rack (1.6.9) and Rack-protection (1.5.5) update [#768](https://github.com/internetee/registry/issues/768)
|
||||||
|
* Removal of unused database tables [#756](https://github.com/internetee/registry/issues/756)
|
||||||
|
* Removal of unused date format [#764](https://github.com/internetee/registry/pull/764)
|
||||||
|
* Removal of billing postal address [#747](https://github.com/internetee/registry/issues/747)
|
||||||
|
|
||||||
06.03.2018
|
06.03.2018
|
||||||
* BUG: Transfer poll message now returns affected domain name [#694](https://github.com/internetee/registry/issues/694)
|
* BUG: Transfer poll message now returns affected domain name [#694](https://github.com/internetee/registry/issues/694)
|
||||||
* BUG: Successful REPP bulk transfer returns info about transfered domains [#693](https://github.com/internetee/registry/issues/693)
|
* BUG: Successful REPP bulk transfer returns info about transfered domains [#693](https://github.com/internetee/registry/issues/693)
|
||||||
|
|
|
@ -160,6 +160,7 @@ GEM
|
||||||
unicode_utils (~> 1.4)
|
unicode_utils (~> 1.4)
|
||||||
crack (0.4.3)
|
crack (0.4.3)
|
||||||
safe_yaml (~> 1.0.0)
|
safe_yaml (~> 1.0.0)
|
||||||
|
crass (1.0.3)
|
||||||
daemons (1.2.4)
|
daemons (1.2.4)
|
||||||
daemons-rails (1.2.1)
|
daemons-rails (1.2.1)
|
||||||
daemons
|
daemons
|
||||||
|
@ -247,7 +248,8 @@ GEM
|
||||||
activesupport (>= 3.0.0)
|
activesupport (>= 3.0.0)
|
||||||
libxml-ruby (3.0.0)
|
libxml-ruby (3.0.0)
|
||||||
liquid (3.0.6)
|
liquid (3.0.6)
|
||||||
loofah (2.0.3)
|
loofah (2.2.2)
|
||||||
|
crass (~> 1.0.2)
|
||||||
nokogiri (>= 1.5.9)
|
nokogiri (>= 1.5.9)
|
||||||
mail (2.6.6)
|
mail (2.6.6)
|
||||||
mime-types (>= 1.16, < 4)
|
mime-types (>= 1.16, < 4)
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
#= require select2
|
#= require select2
|
||||||
#= require jquery.doubleScroll
|
#= require jquery.doubleScroll
|
||||||
#= require datepicker
|
#= require datepicker
|
||||||
|
#= require spell_check
|
||||||
#= require admin/application
|
#= require admin/application
|
||||||
#= require admin/app
|
#= require admin/app
|
||||||
#= require_tree ./admin
|
#= require_tree ./admin
|
||||||
|
|
|
@ -4,4 +4,5 @@
|
||||||
#= require jquery-ui/datepicker
|
#= require jquery-ui/datepicker
|
||||||
#= require select2
|
#= require select2
|
||||||
#= require datepicker
|
#= require datepicker
|
||||||
|
#= require spell_check
|
||||||
#= require shared/general
|
#= require shared/general
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
#= require jquery-ui/datepicker
|
#= require jquery-ui/datepicker
|
||||||
#= require select2
|
#= require select2
|
||||||
#= require datepicker
|
#= require datepicker
|
||||||
|
#= require spell_check
|
||||||
#= require shared/general
|
#= require shared/general
|
||||||
#= require registrar/autocomplete
|
#= require registrar/autocomplete
|
||||||
#= require registrar/application
|
#= require registrar/application
|
||||||
|
|
12
app/assets/javascripts/spell_check.js
Normal file
12
app/assets/javascripts/spell_check.js
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
(function() {
|
||||||
|
function disableSpellCheck() {
|
||||||
|
let selector = 'input[type=text], textarea';
|
||||||
|
let textFields = document.querySelectorAll(selector);
|
||||||
|
|
||||||
|
for (let field of textFields) {
|
||||||
|
field.spellcheck = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
disableSpellCheck();
|
||||||
|
})();
|
|
@ -43,8 +43,13 @@ module Admin
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
@registrar.destroy!
|
if @registrar.destroy
|
||||||
redirect_to admin_registrars_url, notice: t('.deleted')
|
flash[:notice] = t('.deleted')
|
||||||
|
redirect_to admin_registrars_url
|
||||||
|
else
|
||||||
|
flash[:alert] = @registrar.errors.full_messages.first
|
||||||
|
redirect_to admin_registrar_url(@registrar)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
@ -64,7 +69,6 @@ module Admin
|
||||||
:email,
|
:email,
|
||||||
:phone,
|
:phone,
|
||||||
:website,
|
:website,
|
||||||
:billing_email,
|
|
||||||
:code,
|
:code,
|
||||||
:test_registrar,
|
:test_registrar,
|
||||||
:vat_no,
|
:vat_no,
|
||||||
|
|
|
@ -3,7 +3,7 @@ class Registrar
|
||||||
protect_from_forgery except: :back
|
protect_from_forgery except: :back
|
||||||
|
|
||||||
skip_authorization_check # actually anyone can pay, no problems at all
|
skip_authorization_check # actually anyone can pay, no problems at all
|
||||||
skip_before_action :authenticate_user!, :check_ip, only: [:back]
|
skip_before_action :authenticate_user!, :check_ip_restriction, only: [:back]
|
||||||
before_action :check_bank
|
before_action :check_bank
|
||||||
|
|
||||||
# to handle existing model we should
|
# to handle existing model we should
|
||||||
|
|
|
@ -14,9 +14,10 @@ class Registrar < ActiveRecord::Base
|
||||||
delegate :balance, to: :cash_account, allow_nil: true
|
delegate :balance, to: :cash_account, allow_nil: true
|
||||||
|
|
||||||
validates :name, :reg_no, :country_code, :email, :code, presence: true
|
validates :name, :reg_no, :country_code, :email, :code, presence: true
|
||||||
validates :name, :reg_no, :reference_no, :code, uniqueness: true
|
validates :name, :reference_no, :code, uniqueness: true
|
||||||
validates :accounting_customer_code, presence: true
|
validates :accounting_customer_code, presence: true
|
||||||
validates :language, presence: true
|
validates :language, presence: true
|
||||||
|
validate :forbid_special_code
|
||||||
|
|
||||||
validates :vat_rate, presence: true, if: 'foreign_vat_payer? && vat_no.blank?'
|
validates :vat_rate, presence: true, if: 'foreign_vat_payer? && vat_no.blank?'
|
||||||
validates :vat_rate, absence: true, if: :home_vat_payer?
|
validates :vat_rate, absence: true, if: :home_vat_payer?
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
%dt= t(:currency)
|
%dt= t(:currency)
|
||||||
%dd= @bank_transaction.currency
|
%dd= @bank_transaction.currency
|
||||||
|
|
||||||
%dt= t(:reference_no)
|
%dt= BankTransaction.human_attribute_name :reference_no
|
||||||
%dd= @bank_transaction.reference_no
|
%dd= @bank_transaction.reference_no
|
||||||
|
|
||||||
%dt= t(:paid_at)
|
%dt= t(:paid_at)
|
||||||
|
|
24
app/views/admin/registrars/_contacts.html.erb
Normal file
24
app/views/admin/registrars/_contacts.html.erb
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
<div class="panel panel-default">
|
||||||
|
<div class="panel-heading">
|
||||||
|
<%= t '.header' %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="panel-body">
|
||||||
|
<dl class="dl-horizontal">
|
||||||
|
<dt><%= t(:country) %></dt>
|
||||||
|
<dd><%= @registrar.country %></dd>
|
||||||
|
|
||||||
|
<dt><%= t(:address) %></dt>
|
||||||
|
<dd><%= @registrar.address %></dd>
|
||||||
|
|
||||||
|
<dt><%= t(:contact_phone) %></dt>
|
||||||
|
<dd><%= @registrar.phone %></dd>
|
||||||
|
|
||||||
|
<dt><%= t(:contact_email) %></dt>
|
||||||
|
<dd><%= @registrar.email %></dd>
|
||||||
|
|
||||||
|
<dt><%= Registrar.human_attribute_name :billing_email %></dt>
|
||||||
|
<dd><%= @registrar.billing_email %></dd>
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
</div>
|
27
app/views/admin/registrars/_details.html.erb
Normal file
27
app/views/admin/registrars/_details.html.erb
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
<div class="panel panel-default">
|
||||||
|
<div class="panel-heading">
|
||||||
|
<%= t '.header' %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="panel-body">
|
||||||
|
<dl class="dl-horizontal">
|
||||||
|
<dt><%= Registrar.human_attribute_name :name %></dt>
|
||||||
|
<dd><%= registrar.name %></dd>
|
||||||
|
|
||||||
|
<dt><%= Registrar.human_attribute_name :reg_no %></dt>
|
||||||
|
<dd><%= registrar.reg_no %></dd>
|
||||||
|
|
||||||
|
<dt><%= Registrar.human_attribute_name :reference_no %></dt>
|
||||||
|
<dd><%= registrar.reference_no %></dd>
|
||||||
|
|
||||||
|
<dt><%= Registrar.human_attribute_name :code %></dt>
|
||||||
|
<dd><%= registrar.code %></dd>
|
||||||
|
|
||||||
|
<dt><%= Registrar.human_attribute_name :balance %></dt>
|
||||||
|
<dd><%= registrar.balance %></dd>
|
||||||
|
|
||||||
|
<dt><%= Registrar.human_attribute_name :website %></dt>
|
||||||
|
<dd><%= registrar.website %></dd>
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
</div>
|
28
app/views/admin/registrars/_users.html.erb
Normal file
28
app/views/admin/registrars/_users.html.erb
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
<div class="panel panel-default">
|
||||||
|
<div class="panel-heading">
|
||||||
|
<%= t '.header' %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<table class="table table-hover table-bordered table-condensed">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th class="col-xs-6"><%= ApiUser.human_attribute_name :username %></th>
|
||||||
|
<th class="col-xs-6"><%= ApiUser.human_attribute_name :active %></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
<% registrar.api_users.each do |user| %>
|
||||||
|
<tr>
|
||||||
|
<td><%= link_to(user, [:admin, user]) %></td>
|
||||||
|
<td><%= user.active %></td>
|
||||||
|
</tr>
|
||||||
|
<% end %>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<div class="panel-footer text-right">
|
||||||
|
<%= link_to t('.new_btn'), new_admin_registrar_api_user_path(registrar),
|
||||||
|
class: 'btn btn-default btn-xs' %>
|
||||||
|
</div>
|
||||||
|
</div>
|
38
app/views/admin/registrars/_white_ips.html.erb
Normal file
38
app/views/admin/registrars/_white_ips.html.erb
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
<div class="panel panel-default">
|
||||||
|
<div class="panel-heading">
|
||||||
|
<%= t '.header' %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<table class="table table-hover table-bordered table-condensed">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th class="col-xs-4"><%= WhiteIp.human_attribute_name :ipv4 %></th>
|
||||||
|
<th class="col-xs-6"><%= WhiteIp.human_attribute_name :ipv6 %></th>
|
||||||
|
<th class="col-xs-2"><%= WhiteIp.human_attribute_name :interfaces %></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
<% registrar.white_ips.each do |white_ip| %>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<% if white_ip.ipv4.present? %>
|
||||||
|
<%= link_to(white_ip.ipv4, [:admin, registrar, white_ip]) %>
|
||||||
|
<% end %>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<% if white_ip.ipv6.present? %>
|
||||||
|
<%= link_to(white_ip.ipv6, [:admin, registrar, white_ip]) %>
|
||||||
|
<% end %>
|
||||||
|
</td>
|
||||||
|
<td><%= white_ip.interfaces.join(', ').upcase %></td>
|
||||||
|
</tr>
|
||||||
|
<% end %>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<div class="panel-footer text-right">
|
||||||
|
<%= link_to t('.new_btn'), new_admin_registrar_white_ip_path(registrar),
|
||||||
|
class: 'btn btn-default btn-xs' %>
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -20,10 +20,10 @@
|
||||||
<%= sort_link(@q, 'name') %>
|
<%= sort_link(@q, 'name') %>
|
||||||
</th>
|
</th>
|
||||||
<th class="col-xs-4">
|
<th class="col-xs-4">
|
||||||
<%= sort_link(@q, 'reg_no', t(:reg_no)) %>
|
<%= sort_link(@q, 'reg_no', Registrar.human_attribute_name(:reg_no)) %>
|
||||||
</th>
|
</th>
|
||||||
<th class="col-xs-4">
|
<th class="col-xs-4">
|
||||||
<%= t(:credit_balance) %>
|
<%= Registrar.human_attribute_name :balance %>
|
||||||
</th>
|
</th>
|
||||||
<th class="col-xs-4">
|
<th class="col-xs-4">
|
||||||
<%= t(:test_registrar) %>
|
<%= t(:test_registrar) %>
|
||||||
|
|
|
@ -26,198 +26,25 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<% if @registrar.errors.any? %>
|
|
||||||
<% @registrar.errors.each do |attr, err| %>
|
|
||||||
<%= err %>
|
|
||||||
<br/>
|
|
||||||
<% end %>
|
|
||||||
<% end %>
|
|
||||||
<% if @registrar.errors.any? %>
|
|
||||||
<hr/>
|
|
||||||
<% end %>
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="panel panel-default">
|
<%= render 'details', registrar: @registrar %>
|
||||||
<div class="panel-heading">
|
|
||||||
<h3 class="panel-title">
|
|
||||||
<%= t(:general) %>
|
|
||||||
</h3>
|
|
||||||
</div>
|
|
||||||
<div class="panel-body">
|
|
||||||
<dl class="dl-horizontal">
|
|
||||||
<dt>
|
|
||||||
<%= t(:name) %>
|
|
||||||
</dt>
|
|
||||||
<dd>
|
|
||||||
<%= @registrar.name %>
|
|
||||||
</dd>
|
|
||||||
<dt>
|
|
||||||
<%= t(:reg_no) %>
|
|
||||||
</dt>
|
|
||||||
<dd>
|
|
||||||
<%= @registrar.reg_no %>
|
|
||||||
</dd>
|
|
||||||
<dt>
|
|
||||||
<%= t(:reference_no) %>
|
|
||||||
</dt>
|
|
||||||
<dd>
|
|
||||||
<%= @registrar.reference_no %>
|
|
||||||
</dd>
|
|
||||||
<dt>
|
|
||||||
<%= t(:id) %>
|
|
||||||
</dt>
|
|
||||||
<dd>
|
|
||||||
<%= @registrar.code %>
|
|
||||||
</dd>
|
|
||||||
<dt>
|
|
||||||
<%= t(:credit_balance) %>
|
|
||||||
</dt>
|
|
||||||
<dd>
|
|
||||||
<%= @registrar.balance %>
|
|
||||||
</dd>
|
|
||||||
<dt>
|
|
||||||
<%= Registrar.human_attribute_name :website %>
|
|
||||||
</dt>
|
|
||||||
<dd>
|
|
||||||
<%= @registrar.website %>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="panel panel-default">
|
<%= render 'contacts', registrar: @registrar %>
|
||||||
<div class="panel-heading">
|
|
||||||
<h3 class="panel-title">
|
|
||||||
<%= t(:contact) %>
|
|
||||||
</h3>
|
|
||||||
</div>
|
|
||||||
<div class="panel-body">
|
|
||||||
<dl class="dl-horizontal">
|
|
||||||
<dt>
|
|
||||||
<%= t(:country) %>
|
|
||||||
</dt>
|
|
||||||
<dd>
|
|
||||||
<%= @registrar.country %>
|
|
||||||
</dd>
|
|
||||||
<dt>
|
|
||||||
<%= t(:address) %>
|
|
||||||
</dt>
|
|
||||||
<dd>
|
|
||||||
<%= @registrar.address %>
|
|
||||||
</dd>
|
|
||||||
<dt>
|
|
||||||
<%= t(:contact_phone) %>
|
|
||||||
</dt>
|
|
||||||
<dd>
|
|
||||||
<%= @registrar.phone %>
|
|
||||||
</dd>
|
|
||||||
<dt>
|
|
||||||
<%= t(:contact_email) %>
|
|
||||||
</dt>
|
|
||||||
<dd>
|
|
||||||
<%= @registrar.email %>
|
|
||||||
</dd>
|
|
||||||
<dt>
|
|
||||||
<%= t(:billing_email) %>
|
|
||||||
</dt>
|
|
||||||
<dd>
|
|
||||||
<%= @registrar.billing_email %>
|
|
||||||
</dd>
|
|
||||||
</dl>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<%= render 'billing', registrar: @registrar %>
|
<%= render 'billing', registrar: @registrar %>
|
||||||
<%= render 'admin/registrars/show/preferences', registrar: registrar %>
|
<%= render 'preferences', registrar: registrar %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<div class="panel panel-default">
|
<%= render 'users', registrar: @registrar %>
|
||||||
<div class="panel-heading clearfix">
|
|
||||||
<div class="pull-left">
|
|
||||||
<%= t('.api_users') %>
|
|
||||||
</div>
|
|
||||||
<div class="pull-right">
|
|
||||||
<%= link_to(t('.new_api_use_btn'), new_admin_registrar_api_user_path(@registrar), class: 'btn btn-default btn-xs') %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="table-responsive">
|
|
||||||
<table class="table table-hover table-bordered table-condensed">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th class="col-xs-6">
|
|
||||||
<%= t(:username) %>
|
|
||||||
</th>
|
|
||||||
<th class="col-xs-6">
|
|
||||||
<%= t('.active') %>
|
|
||||||
</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<% @registrar.api_users.each do |x| %>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<%= link_to(x, [:admin, x]) %>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<%= x.active %>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<% end %>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<div class="panel panel-default">
|
<%= render 'white_ips', registrar: @registrar %>
|
||||||
<div class="panel-heading clearfix">
|
|
||||||
<div class="pull-left">
|
|
||||||
<%= t(:white_ips) %>
|
|
||||||
</div>
|
|
||||||
<div class="pull-right">
|
|
||||||
<%= link_to(t(:create_new_white_ip), new_admin_registrar_white_ip_path(@registrar), class: 'btn btn-default btn-xs') %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="table-responsive">
|
|
||||||
<table class="table table-hover table-bordered table-condensed">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th class="col-xs-4">
|
|
||||||
<%= t(:ipv4) %>
|
|
||||||
</th>
|
|
||||||
<th class="col-xs-6">
|
|
||||||
<%= t(:ipv6) %>
|
|
||||||
</th>
|
|
||||||
<th class="col-xs-2">
|
|
||||||
<%= t(:interfaces) %>
|
|
||||||
</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<% @registrar.white_ips.each do |x| %>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<% if x.ipv4.present? %>
|
|
||||||
<%= link_to(x.ipv4, [:admin, @registrar, x]) %>
|
|
||||||
<% end %>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<% if x.ipv6.present? %>
|
|
||||||
<%= link_to(x.ipv6, [:admin, @registrar, x]) %>
|
|
||||||
<% end %>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<%= x.interfaces.join(', ').upcase %>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<% end %>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
- content_for :actions do
|
- content_for :actions do
|
||||||
= link_to(t(:back_to_registrar), admin_registrar_path(@registrar), class: 'btn btn-default')
|
= link_to(t(:back_to_registrar), admin_registrar_path(@registrar), class: 'btn btn-default')
|
||||||
|
|
||||||
= render 'shared/title', name: t(:create_new_white_ip)
|
= render 'shared/title', name: t('.header')
|
||||||
= render 'form'
|
= render 'form'
|
||||||
|
|
|
@ -14,11 +14,11 @@
|
||||||
%dt= t(:registrar_name)
|
%dt= t(:registrar_name)
|
||||||
%dd= link_to(@registrar, [:admin, @registrar])
|
%dd= link_to(@registrar, [:admin, @registrar])
|
||||||
|
|
||||||
%dt= t(:ipv4)
|
%dt= WhiteIp.human_attribute_name :ipv4
|
||||||
%dd= @white_ip.ipv4
|
%dd= @white_ip.ipv4
|
||||||
|
|
||||||
%dt= t(:ipv6)
|
%dt= WhiteIp.human_attribute_name :ipv6
|
||||||
%dd= @white_ip.ipv6
|
%dd= @white_ip.ipv6
|
||||||
|
|
||||||
%dt= t(:interfaces)
|
%dt= WhiteIp.human_attribute_name :interfaces
|
||||||
%dd= @white_ip.interfaces.join(', ').upcase
|
%dd= @white_ip.interfaces.join(', ').upcase
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
%th{class: 'col-xs-6'}
|
%th{class: 'col-xs-6'}
|
||||||
= sort_link(@q, 'name')
|
= sort_link(@q, 'name')
|
||||||
%th{class: 'col-xs-6'}
|
%th{class: 'col-xs-6'}
|
||||||
= sort_link(@q, 'reg_no', t(:reg_no))
|
= sort_link(@q, 'reg_no', Registrar.human_attribute_name(:reg_no))
|
||||||
%tbody
|
%tbody
|
||||||
- @registrars.each do |x|
|
- @registrars.each do |x|
|
||||||
%tr
|
%tr
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
%dt= t(:name)
|
%dt= t(:name)
|
||||||
%dd= @registrar.name
|
%dd= @registrar.name
|
||||||
|
|
||||||
%dt= t(:reg_no)
|
%dt= Registrar.human_attribute_name :reg_no
|
||||||
%dd= @registrar.reg_no
|
%dd= @registrar.reg_no
|
||||||
|
|
||||||
%dt= Registrar.human_attribute_name :vat_no
|
%dt= Registrar.human_attribute_name :vat_no
|
||||||
|
|
|
@ -32,5 +32,5 @@
|
||||||
%dt= t(:description)
|
%dt= t(:description)
|
||||||
%dd=@invoice.description
|
%dd=@invoice.description
|
||||||
|
|
||||||
%dt= t(:reference_no)
|
%dt= Invoice.human_attribute_name :reference_no
|
||||||
%dd= @invoice.reference_no
|
%dd= @invoice.reference_no
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
%dt= t(:name)
|
%dt= t(:name)
|
||||||
%dd= @invoice.seller_name
|
%dd= @invoice.seller_name
|
||||||
|
|
||||||
%dt= t(:reg_no)
|
%dt= Registrar.human_attribute_name :reg_no
|
||||||
%dd= @invoice.seller_reg_no
|
%dd= @invoice.seller_reg_no
|
||||||
|
|
||||||
%dt= t(:iban)
|
%dt= t(:iban)
|
||||||
|
|
|
@ -182,7 +182,7 @@
|
||||||
%dt= t(:description)
|
%dt= t(:description)
|
||||||
%dd=@invoice.description
|
%dd=@invoice.description
|
||||||
|
|
||||||
%dt= t(:reference_no)
|
%dt= Invoice.human_attribute_name :reference_no
|
||||||
%dd= @invoice.reference_no
|
%dd= @invoice.reference_no
|
||||||
|
|
||||||
.col-md-6.right
|
.col-md-6.right
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
<div class="col-md-5">
|
<div class="col-md-5">
|
||||||
<%= text_field_tag :old_hostname, params[:old_hostname], autofocus: true,
|
<%= text_field_tag :old_hostname, params[:old_hostname], autofocus: true,
|
||||||
required: true,
|
required: true,
|
||||||
spellcheck: false,
|
|
||||||
class: 'form-control' %>
|
class: 'form-control' %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -19,7 +18,6 @@
|
||||||
|
|
||||||
<div class="col-md-5">
|
<div class="col-md-5">
|
||||||
<%= text_field_tag :new_hostname, params[:new_hostname], required: true,
|
<%= text_field_tag :new_hostname, params[:new_hostname], required: true,
|
||||||
spellcheck: false,
|
|
||||||
class: 'form-control' %>
|
class: 'form-control' %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -30,7 +28,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<%= text_area_tag :ipv4, params[:ipv4], spellcheck: false, class: 'form-control' %>
|
<%= text_area_tag :ipv4, params[:ipv4], class: 'form-control' %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -40,7 +38,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<%= text_area_tag :ipv6, params[:ipv6], spellcheck: false, class: 'form-control' %>
|
<%= text_area_tag :ipv6, params[:ipv6], class: 'form-control' %>
|
||||||
<span class="help-block"><%= t '.ip_hint' %></span>
|
<span class="help-block"><%= t '.ip_hint' %></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -12,12 +12,12 @@ en:
|
||||||
edit_btn: Edit
|
edit_btn: Edit
|
||||||
delete_btn: Delete
|
delete_btn: Delete
|
||||||
delete_btn_confirm: Are you sure you want delete registrar?
|
delete_btn_confirm: Are you sure you want delete registrar?
|
||||||
new_api_use_btn: New API user
|
|
||||||
active: Active
|
|
||||||
api_users: API users
|
|
||||||
|
|
||||||
preferences:
|
edit:
|
||||||
header: Preferences
|
header: Edit registrar
|
||||||
|
|
||||||
|
billing:
|
||||||
|
header: Billing
|
||||||
|
|
||||||
edit:
|
edit:
|
||||||
header: Edit registrar
|
header: Edit registrar
|
||||||
|
@ -44,3 +44,20 @@ en:
|
||||||
|
|
||||||
preferences:
|
preferences:
|
||||||
header: Preferences
|
header: Preferences
|
||||||
|
|
||||||
|
details:
|
||||||
|
header: Details
|
||||||
|
|
||||||
|
contacts:
|
||||||
|
header: Contacts
|
||||||
|
|
||||||
|
preferences:
|
||||||
|
header: Preferences
|
||||||
|
|
||||||
|
users:
|
||||||
|
header: API Users
|
||||||
|
new_btn: New API user
|
||||||
|
|
||||||
|
white_ips:
|
||||||
|
header: Whitelisted IPs
|
||||||
|
new_btn: New whitelisted IP
|
||||||
|
|
5
config/locales/admin/white_ips.en.yml
Normal file
5
config/locales/admin/white_ips.en.yml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
en:
|
||||||
|
admin:
|
||||||
|
white_ips:
|
||||||
|
new:
|
||||||
|
header: New whitelisted IP
|
|
@ -202,9 +202,6 @@ en:
|
||||||
state: 'State / Province'
|
state: 'State / Province'
|
||||||
deposit:
|
deposit:
|
||||||
amount: 'Amount'
|
amount: 'Amount'
|
||||||
white_ip:
|
|
||||||
ipv4: 'IPv4'
|
|
||||||
ipv6: 'IPv6'
|
|
||||||
|
|
||||||
errors:
|
errors:
|
||||||
messages:
|
messages:
|
||||||
|
@ -301,7 +298,6 @@ en:
|
||||||
reg_no: 'Reg. no'
|
reg_no: 'Reg. no'
|
||||||
status: 'Status'
|
status: 'Status'
|
||||||
contact: 'Contact'
|
contact: 'Contact'
|
||||||
credit_balance: 'Credit balance'
|
|
||||||
starting_balance: 'Starting balance'
|
starting_balance: 'Starting balance'
|
||||||
destroyed: 'Destroyed'
|
destroyed: 'Destroyed'
|
||||||
|
|
||||||
|
@ -386,7 +382,6 @@ en:
|
||||||
choose: 'Choose...'
|
choose: 'Choose...'
|
||||||
created_before: 'Created before'
|
created_before: 'Created before'
|
||||||
created_after: 'Created after'
|
created_after: 'Created after'
|
||||||
billing_email: 'Billing e-mail'
|
|
||||||
contact_phone: 'Contact phone'
|
contact_phone: 'Contact phone'
|
||||||
contact_email: 'Contact e-mail'
|
contact_email: 'Contact e-mail'
|
||||||
address_help: 'Street name, house no - apartment no, city, county, country, zip'
|
address_help: 'Street name, house no - apartment no, city, county, country, zip'
|
||||||
|
@ -575,7 +570,6 @@ en:
|
||||||
queried_at: 'Queried at'
|
queried_at: 'Queried at'
|
||||||
import_file_path: 'Import file path'
|
import_file_path: 'Import file path'
|
||||||
bank_code: 'Bank code'
|
bank_code: 'Bank code'
|
||||||
reference_no: 'Reference no'
|
|
||||||
currency: 'Currency'
|
currency: 'Currency'
|
||||||
buyer_name: 'Buyer name'
|
buyer_name: 'Buyer name'
|
||||||
buyer_iban: 'Buyer IBAN'
|
buyer_iban: 'Buyer IBAN'
|
||||||
|
@ -652,8 +646,6 @@ en:
|
||||||
not_valid_domain_verification_body: This could mean your verification has been expired or done already.<br><br>Please contact us if you think something is wrong.
|
not_valid_domain_verification_body: This could mean your verification has been expired or done already.<br><br>Please contact us if you think something is wrong.
|
||||||
upload_crt: 'Upload CRT'
|
upload_crt: 'Upload CRT'
|
||||||
crt_or_csr_must_be_present: 'CRT or CSR must be present'
|
crt_or_csr_must_be_present: 'CRT or CSR must be present'
|
||||||
white_ips: 'White IP-s'
|
|
||||||
create_new_white_ip: 'Create new white IP'
|
|
||||||
ipv4_or_ipv6_must_be_present: 'IPv4 or IPv6 must be present'
|
ipv4_or_ipv6_must_be_present: 'IPv4 or IPv6 must be present'
|
||||||
white_ip: 'White IP'
|
white_ip: 'White IP'
|
||||||
edit_white_ip: 'Edit white IP'
|
edit_white_ip: 'Edit white IP'
|
||||||
|
@ -741,7 +733,6 @@ en:
|
||||||
failure: "It was not saved"
|
failure: "It was not saved"
|
||||||
contact_is_not_valid: 'Contact %{value} is not valid, please fix the invalid contact'
|
contact_is_not_valid: 'Contact %{value} is not valid, please fix the invalid contact'
|
||||||
welcome_to_eis_registrar_portal: 'Welcome to EIS Registrar portal'
|
welcome_to_eis_registrar_portal: 'Welcome to EIS Registrar portal'
|
||||||
interfaces: 'Interfaces'
|
|
||||||
next: 'Next'
|
next: 'Next'
|
||||||
previous: 'Previous'
|
previous: 'Previous'
|
||||||
personal_domain_verification_url: 'Personal domain verification url'
|
personal_domain_verification_url: 'Personal domain verification url'
|
||||||
|
@ -771,3 +762,5 @@ en:
|
||||||
attributes:
|
attributes:
|
||||||
vat_no: VAT number
|
vat_no: VAT number
|
||||||
vat_rate: VAT rate
|
vat_rate: VAT rate
|
||||||
|
ipv4: IPv4
|
||||||
|
ipv6: IPv6
|
||||||
|
|
|
@ -97,7 +97,6 @@ Rails.application.routes.draw do
|
||||||
get 'pay/go/:bank' => 'payments#pay', as: 'payment_with'
|
get 'pay/go/:bank' => 'payments#pay', as: 'payment_with'
|
||||||
end
|
end
|
||||||
|
|
||||||
# REGISTRANT ROUTES
|
|
||||||
namespace :registrant do
|
namespace :registrant do
|
||||||
root 'domains#index'
|
root 'domains#index'
|
||||||
|
|
||||||
|
@ -111,17 +110,6 @@ Rails.application.routes.draw do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# resources :invoices do
|
|
||||||
# member do
|
|
||||||
# get 'download_pdf'
|
|
||||||
# match 'forward', via: [:post, :get]
|
|
||||||
# patch 'cancel'
|
|
||||||
# end
|
|
||||||
# end
|
|
||||||
|
|
||||||
# resources :deposits
|
|
||||||
# resources :account_activities
|
|
||||||
|
|
||||||
resources :domain_update_confirms
|
resources :domain_update_confirms
|
||||||
resources :domain_delete_confirms
|
resources :domain_delete_confirms
|
||||||
|
|
||||||
|
@ -150,8 +138,6 @@ Rails.application.routes.draw do
|
||||||
end
|
end
|
||||||
|
|
||||||
resources :registrars do
|
resources :registrars do
|
||||||
resources :api_users
|
|
||||||
resources :white_ips
|
|
||||||
collection do
|
collection do
|
||||||
get :search
|
get :search
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,7 +2,6 @@ class AddRegistrarsUniqueConstraints < ActiveRecord::Migration
|
||||||
def up
|
def up
|
||||||
execute <<-SQL
|
execute <<-SQL
|
||||||
ALTER TABLE registrars ADD CONSTRAINT unique_name UNIQUE (name);
|
ALTER TABLE registrars ADD CONSTRAINT unique_name UNIQUE (name);
|
||||||
ALTER TABLE registrars ADD CONSTRAINT unique_reg_no UNIQUE (reg_no);
|
|
||||||
ALTER TABLE registrars ADD CONSTRAINT unique_reference_no UNIQUE (reference_no);
|
ALTER TABLE registrars ADD CONSTRAINT unique_reference_no UNIQUE (reference_no);
|
||||||
ALTER TABLE registrars ADD CONSTRAINT unique_code UNIQUE (code);
|
ALTER TABLE registrars ADD CONSTRAINT unique_code UNIQUE (code);
|
||||||
SQL
|
SQL
|
||||||
|
@ -11,7 +10,6 @@ class AddRegistrarsUniqueConstraints < ActiveRecord::Migration
|
||||||
def down
|
def down
|
||||||
execute <<-SQL
|
execute <<-SQL
|
||||||
ALTER TABLE registrars DROP CONSTRAINT unique_name;
|
ALTER TABLE registrars DROP CONSTRAINT unique_name;
|
||||||
ALTER TABLE registrars DROP CONSTRAINT unique_reg_no;
|
|
||||||
ALTER TABLE registrars DROP CONSTRAINT unique_reference_no;
|
ALTER TABLE registrars DROP CONSTRAINT unique_reference_no;
|
||||||
ALTER TABLE registrars DROP CONSTRAINT unique_code;
|
ALTER TABLE registrars DROP CONSTRAINT unique_code;
|
||||||
SQL
|
SQL
|
||||||
|
|
|
@ -492,7 +492,6 @@
|
||||||
<polyline fill="none" stroke="black" points="-300,-378 -124,-378 "/>
|
<polyline fill="none" stroke="black" points="-300,-378 -124,-378 "/>
|
||||||
<polyline fill="none" stroke="black" points="-300,-354 -124,-354 "/>
|
<polyline fill="none" stroke="black" points="-300,-354 -124,-354 "/>
|
||||||
<text text-anchor="start" x="-292" y="-338.8" font-family="Times,serif" font-size="14.00">_layout</text>
|
<text text-anchor="start" x="-292" y="-338.8" font-family="Times,serif" font-size="14.00">_layout</text>
|
||||||
<text text-anchor="start" x="-292" y="-323.8" font-family="Times,serif" font-size="14.00">check_ip</text>
|
|
||||||
<text text-anchor="start" x="-292" y="-308.8" font-family="Times,serif" font-size="14.00">role_base_root_url</text>
|
<text text-anchor="start" x="-292" y="-308.8" font-family="Times,serif" font-size="14.00">role_base_root_url</text>
|
||||||
</g>
|
</g>
|
||||||
<!-- Registrar::PollsController -->
|
<!-- Registrar::PollsController -->
|
||||||
|
|
Before Width: | Height: | Size: 67 KiB After Width: | Height: | Size: 67 KiB |
9
test/fixtures/registrars.yml
vendored
9
test/fixtures/registrars.yml
vendored
|
@ -41,3 +41,12 @@ complete:
|
||||||
language: en
|
language: en
|
||||||
vat_no: US12345
|
vat_no: US12345
|
||||||
vat_rate: 0.05
|
vat_rate: 0.05
|
||||||
|
|
||||||
|
not_in_use:
|
||||||
|
name: any
|
||||||
|
reg_no: any
|
||||||
|
code: any
|
||||||
|
email: any@example.com
|
||||||
|
country_code: US
|
||||||
|
accounting_customer_code: any
|
||||||
|
language: en
|
||||||
|
|
|
@ -5,7 +5,7 @@ class AdminAreaDeleteRegistrarTest < ActionDispatch::IntegrationTest
|
||||||
login_as users(:admin)
|
login_as users(:admin)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_can_be_deleted_if_not_in_use
|
def test_can_be_deleted_when_not_in_use
|
||||||
visit admin_registrar_url(registrars(:not_in_use))
|
visit admin_registrar_url(registrars(:not_in_use))
|
||||||
|
|
||||||
assert_difference 'Registrar.count', -1 do
|
assert_difference 'Registrar.count', -1 do
|
||||||
|
@ -15,4 +15,16 @@ class AdminAreaDeleteRegistrarTest < ActionDispatch::IntegrationTest
|
||||||
assert_current_path admin_registrars_path
|
assert_current_path admin_registrars_path
|
||||||
assert_text 'Registrar has been successfully deleted'
|
assert_text 'Registrar has been successfully deleted'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_cannot_be_deleted_when_in_use
|
||||||
|
registrar = registrars(:bestnames)
|
||||||
|
visit admin_registrar_url(registrar)
|
||||||
|
|
||||||
|
assert_no_difference 'Registrar.count' do
|
||||||
|
click_link_or_button 'Delete'
|
||||||
|
end
|
||||||
|
|
||||||
|
assert_current_path admin_registrar_path(registrar)
|
||||||
|
assert_text 'Cannot delete record because dependent domains exist'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -9,10 +9,9 @@ class AdminAreaNewRegistrarTest < ActionDispatch::IntegrationTest
|
||||||
visit admin_registrars_url
|
visit admin_registrars_url
|
||||||
click_link_or_button 'New registrar'
|
click_link_or_button 'New registrar'
|
||||||
|
|
||||||
fill_in 'Name', with: 'Brand new name'
|
fill_in 'Name', with: 'Brand new names'
|
||||||
fill_in 'Reg no', with: '55555555'
|
fill_in 'Reg no', with: '55555555'
|
||||||
fill_in 'Contact e-mail', with: 'test@example.com'
|
fill_in 'Contact e-mail', with: 'test@example.com'
|
||||||
select 'United States', from: 'Country'
|
|
||||||
fill_in 'Accounting customer code', with: 'test'
|
fill_in 'Accounting customer code', with: 'test'
|
||||||
fill_in 'Code', with: 'test'
|
fill_in 'Code', with: 'test'
|
||||||
|
|
||||||
|
|
|
@ -24,13 +24,13 @@ class RegistrarTest < ActiveSupport::TestCase
|
||||||
assert @registrar.invalid?
|
assert @registrar.invalid?
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_rejects_absent_accounting_customer_code
|
def test_invalid_without_accounting_customer_code
|
||||||
@registrar.accounting_customer_code = nil
|
@registrar.accounting_customer_code = ''
|
||||||
assert @registrar.invalid?
|
assert @registrar.invalid?
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_invalid_without_country_code
|
def test_invalid_without_country_code
|
||||||
@registrar.country_code = nil
|
@registrar.country_code = ''
|
||||||
assert @registrar.invalid?
|
assert @registrar.invalid?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue