mirror of
https://github.com/internetee/registry.git
synced 2025-05-16 01:17:18 +02:00
commit
fe0dca8c71
161 changed files with 2079 additions and 1271 deletions
14
.reek
14
.reek
|
@ -103,13 +103,11 @@ UncommunicativeVariableName:
|
|||
- Epp::Contact#attrs_from
|
||||
- Epp::Contact#check_availability
|
||||
- Epp::Domain#check_availability
|
||||
- Epp::Domain#copy_and_transfer_contact
|
||||
- Epp::Domain#domain_contact_attrs_from
|
||||
- Epp::Domain#domain_status_list_from
|
||||
- Epp::Domain#domain_statuses_attrs
|
||||
- Epp::Domain#nameservers_from
|
||||
- Epp::Domain#parse_period_unit_from_frame
|
||||
- Epp::Domain#transfer_domain_contacts
|
||||
- Epp::Domain#validate_contacts
|
||||
- Invoice#cancel_overdue_invoices
|
||||
- Legacy::Db
|
||||
|
@ -209,7 +207,6 @@ DuplicateMethodCall:
|
|||
- Registrar::DomainsController#normalize_search_parameters
|
||||
- Registrar::DomainsController#renew
|
||||
- Registrar::DomainsController#search_contacts
|
||||
- Registrar::DomainsController#transfer
|
||||
- Registrar::DomainsController#update
|
||||
- Registrar::InvoicesController#index
|
||||
- Registrar::InvoicesController#normalize_search_parameters
|
||||
|
@ -246,7 +243,6 @@ DuplicateMethodCall:
|
|||
- Billing::Price#self.effective
|
||||
- Billing::Price#self.valid
|
||||
- BusinessRegistryCache#fetch_by_ident_and_cc
|
||||
- BusinessRegistryCache#purge
|
||||
- Certificate#parse_metadata
|
||||
- Certificate#reload_apache
|
||||
- Certificate#revoke!
|
||||
|
@ -285,7 +281,6 @@ DuplicateMethodCall:
|
|||
- Depp::Domain#default_params
|
||||
- Depp::Domain#renew
|
||||
- Depp::Keyrelay#keyrelay
|
||||
- Depp::User#repp_request
|
||||
- Depp::User#validate_existance_in_server
|
||||
- Directo#self.dump_result_to_db
|
||||
- Directo#self.load_price
|
||||
|
@ -319,7 +314,6 @@ DuplicateMethodCall:
|
|||
- Epp::Domain#parse_legal_document_from_frame
|
||||
- Epp::Domain#query_transfer
|
||||
- Epp::Domain#renew
|
||||
- Epp::Domain#transfer_domain_contacts
|
||||
- Epp::Domain#update
|
||||
- Epp::Domain#validate_contacts
|
||||
- Epp::Domain#validate_exp_dates
|
||||
|
@ -765,7 +759,6 @@ TooManyStatements:
|
|||
- Depp::Domain#create_nameservers_hash
|
||||
- Depp::Domain#default_params
|
||||
- Depp::Domain#transfer
|
||||
- Depp::User#repp_request
|
||||
- Depp::User#validate_existance_in_server
|
||||
- Directo#self.send_monthly_invoices
|
||||
- Directo#self.send_receipts
|
||||
|
@ -785,7 +778,6 @@ TooManyStatements:
|
|||
- DomainCron#self.start_expire_period
|
||||
- DomainCron#self.start_redemption_grace_period
|
||||
- DomainMailModel#domain_info
|
||||
- DomainTransfer#approve_as_client
|
||||
- Epp::Contact#add_legal_file_to_new
|
||||
- Epp::Contact#attrs_from
|
||||
- Epp::Contact#check_availability
|
||||
|
@ -798,7 +790,6 @@ TooManyStatements:
|
|||
- Epp::Domain#approve_transfer
|
||||
- Epp::Domain#attrs_from
|
||||
- Epp::Domain#check_availability
|
||||
- Epp::Domain#copy_and_transfer_contact
|
||||
- Epp::Domain#destroy_attrs
|
||||
- Epp::Domain#dnskeys_attrs
|
||||
- Epp::Domain#domain_contact_attrs_from
|
||||
|
@ -814,7 +805,6 @@ TooManyStatements:
|
|||
- Epp::Domain#reject_transfer
|
||||
- Epp::Domain#renew
|
||||
- Epp::Domain#transfer
|
||||
- Epp::Domain#transfer_domain_contacts
|
||||
- Epp::Domain#update
|
||||
- Epp::Domain#validate_contacts
|
||||
- Invoice#cancel
|
||||
|
@ -884,7 +874,6 @@ UtilityFunction:
|
|||
- EppErrors#construct_msg_args_and_value
|
||||
- Versions#user_from_id_role_username
|
||||
- Depp::Keyrelay#expiry
|
||||
- Epp::Domain#copy_and_transfer_contact
|
||||
- Epp::Domain#nameservers_from
|
||||
- Epp::Domain::DnsSecKeys#mark
|
||||
- Epp::Domain::DnsSecKeys#xm_copy
|
||||
|
@ -947,7 +936,6 @@ FeatureEnvy:
|
|||
- Depp::Domain#renew
|
||||
- Depp::Domain#transfer
|
||||
- Depp::Keyrelay#keyrelay
|
||||
- Depp::User#repp_request
|
||||
- DomainMailModel#format
|
||||
- Epp::Contact#attach_legal_document
|
||||
- Epp::Contact#attrs_from
|
||||
|
@ -959,7 +947,6 @@ FeatureEnvy:
|
|||
- Epp::Domain#destroy_attrs
|
||||
- Epp::Domain#domain_contact_attrs_from
|
||||
- Epp::Domain#domain_status_list_from
|
||||
- Epp::Domain#transfer_domain_contacts
|
||||
- LegalDocument#calc_checksum
|
||||
- Nameserver#find_by_hash_params
|
||||
- RegistrantUser#find_or_create_by_idc_data
|
||||
|
@ -1094,7 +1081,6 @@ Attribute:
|
|||
- BankStatement#th6_file
|
||||
- Versions#version_loader
|
||||
- Contact#deliver_emails
|
||||
- Contact#domain_transfer
|
||||
- Contact#domains_present
|
||||
- Contact#legal_document_id
|
||||
- Counter#value
|
||||
|
|
|
@ -4,9 +4,6 @@ env:
|
|||
- DB=postgresql
|
||||
bundler_args: --without development staging production
|
||||
before_script:
|
||||
- "psql -c 'create database registry_test;' -U postgres"
|
||||
- "psql -c 'create database registry_whois_test;' -U postgres"
|
||||
- "psql -c 'create database registry_api_log_test;' -U postgres"
|
||||
- "cp config/application-example.yml config/application.yml"
|
||||
- "cp config/database-travis.yml config/database.yml"
|
||||
- "bundle exec rake db:setup:all"
|
||||
|
|
7
Gemfile
7
Gemfile
|
@ -41,7 +41,6 @@ gem 'sass-rails', '5.0.6' # sass style
|
|||
|
||||
gem 'coffee-rails', '4.1.0' # coffeescript support
|
||||
gem 'jquery-rails', '4.0.4' # jquery
|
||||
gem 'turbolinks', '2.5.3' # faster page load
|
||||
gem 'selectize-rails', '0.12.1' # include selectize.js for select
|
||||
gem 'jquery-validation-rails', '1.13.1' # validate on client side
|
||||
|
||||
|
@ -49,7 +48,6 @@ gem 'jquery-validation-rails', '1.13.1' # validate on client side
|
|||
gem 'kaminari', '0.16.3' # pagination
|
||||
gem 'coderay', '1.1.0' # xml console visualize
|
||||
gem 'html5_validators', '1.2.2' # model requements now automatically on html form
|
||||
gem 'nprogress-rails', '0.1.6.7' # visual loader
|
||||
gem 'select2-rails', '3.5.9.3' # for autocomplete
|
||||
gem 'liquid', '3.0.6' # for email templates
|
||||
|
||||
|
@ -59,7 +57,7 @@ gem 'devise', '3.5.4' # authenitcation
|
|||
|
||||
# rest api
|
||||
gem 'grape', '0.12.0'
|
||||
gem 'hashie-forbidden_attributes', '0.1.1' # For grape, https://github.com/ruby-grape/grape#rails
|
||||
gem 'hashie-forbidden_attributes', '0.1.1' # For grape, https://github.com/ruby-grape/grape/tree/v0.12.0#rails
|
||||
gem 'jbuilder', '2.2.16' # json api
|
||||
|
||||
# registry specfic
|
||||
|
@ -76,9 +74,6 @@ gem 'whenever', '0.9.4', require: false
|
|||
# country listing
|
||||
gem 'countries', :require => 'countries/global'
|
||||
|
||||
# cloning activerecord objects
|
||||
gem 'deep_cloneable', '2.1.1'
|
||||
|
||||
# id + mid login
|
||||
# gem 'digidoc_client', '0.3.0'
|
||||
gem 'digidoc_client',
|
||||
|
|
|
@ -165,8 +165,6 @@ GEM
|
|||
daemons
|
||||
multi_json (~> 1.0)
|
||||
database_cleaner (1.6.1)
|
||||
deep_cloneable (2.1.1)
|
||||
activerecord (>= 3.1.0, < 5.0.0)
|
||||
descendants_tracker (0.0.4)
|
||||
thread_safe (~> 0.3, >= 0.3.1)
|
||||
devise (3.5.4)
|
||||
|
@ -281,7 +279,6 @@ GEM
|
|||
nokogiri (1.8.1)
|
||||
mini_portile2 (~> 2.3.0)
|
||||
nori (2.6.0)
|
||||
nprogress-rails (0.1.6.7)
|
||||
open4 (1.3.4)
|
||||
orm_adapter (0.5.0)
|
||||
parallel (1.12.0)
|
||||
|
@ -441,8 +438,6 @@ GEM
|
|||
thor (0.19.4)
|
||||
thread_safe (0.3.6)
|
||||
tilt (1.4.1)
|
||||
turbolinks (2.5.3)
|
||||
coffee-rails
|
||||
tzinfo (1.2.3)
|
||||
thread_safe (~> 0.1)
|
||||
unf (0.1.4)
|
||||
|
@ -497,7 +492,6 @@ DEPENDENCIES
|
|||
daemons-rails (= 1.2.1)
|
||||
data_migrate!
|
||||
database_cleaner
|
||||
deep_cloneable (= 2.1.1)
|
||||
devise (= 3.5.4)
|
||||
digidoc_client!
|
||||
epp (= 1.5.0)!
|
||||
|
@ -520,7 +514,6 @@ DEPENDENCIES
|
|||
mina (= 0.3.1)
|
||||
money-rails
|
||||
nokogiri
|
||||
nprogress-rails (= 0.1.6.7)
|
||||
paper_trail!
|
||||
pdfkit (= 0.6.2)
|
||||
pg (= 0.19.0)
|
||||
|
@ -545,7 +538,6 @@ DEPENDENCIES
|
|||
simpleidn (= 0.0.7)
|
||||
spring
|
||||
spring-commands-rspec
|
||||
turbolinks (= 2.5.3)
|
||||
uuidtools (= 2.1.5)
|
||||
validates_email_format_of (= 1.6.3)
|
||||
webmock
|
||||
|
|
|
@ -57,5 +57,6 @@ module Repp
|
|||
mount Repp::DomainV1
|
||||
mount Repp::ContactV1
|
||||
mount Repp::AccountV1
|
||||
mount Repp::DomainTransfersV1
|
||||
end
|
||||
end
|
||||
|
|
47
app/api/repp/domain_transfers_v1.rb
Normal file
47
app/api/repp/domain_transfers_v1.rb
Normal file
|
@ -0,0 +1,47 @@
|
|||
module Repp
|
||||
class DomainTransfersV1 < Grape::API
|
||||
version 'v1', using: :path
|
||||
|
||||
resource :domain_transfers do
|
||||
post '/' do
|
||||
params do
|
||||
requires :data, type: Hash do
|
||||
requires :domainTransfers, type: Array do
|
||||
requires :domainName, type: String, allow_blank: false
|
||||
requires :transferCode, type: String, allow_blank: false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
new_registrar = current_user.registrar
|
||||
domain_transfers = params['data']['domainTransfers']
|
||||
errors = []
|
||||
|
||||
domain_transfers.each do |domain_transfer|
|
||||
domain_name = domain_transfer['domainName']
|
||||
transfer_code = domain_transfer['transferCode']
|
||||
domain = Domain.find_by(name: domain_name)
|
||||
|
||||
if domain
|
||||
if domain.transfer_code == transfer_code
|
||||
domain.transfer(new_registrar)
|
||||
else
|
||||
errors << { title: "#{domain_name} transfer code is wrong" }
|
||||
end
|
||||
else
|
||||
errors << { title: "#{domain_name} does not exist" }
|
||||
end
|
||||
end
|
||||
|
||||
if errors.none?
|
||||
status 204
|
||||
body false
|
||||
@response = {}
|
||||
else
|
||||
status 400
|
||||
@response = { errors: errors }
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -32,7 +32,7 @@ module Repp
|
|||
domain = ident =~ /\A[0-9]+\z/ ? Domain.find_by(id: ident) : Domain.find_by_idn(ident)
|
||||
|
||||
error! I18n.t('errors.messages.epp_domain_not_found'), 404 unless domain
|
||||
error! I18n.t('errors.messages.epp_authorization_error'), 401 unless domain.auth_info.eql? request.headers['Auth-Code']
|
||||
error! I18n.t('errors.messages.epp_authorization_error'), 401 unless domain.transfer_code.eql? request.headers['Auth-Code']
|
||||
|
||||
contact_repp_json = proc{|contact|
|
||||
contact.as_json.slice("code", "name", "ident", "ident_type", "ident_country_code", "phone", "email", "street", "city", "zip","country_code", "statuses")
|
||||
|
|
|
@ -12,10 +12,5 @@
|
|||
dateFields.datepicker();
|
||||
}
|
||||
|
||||
// For turbolinks
|
||||
document.addEventListener('page:change', function() {
|
||||
attachDatePicker();
|
||||
});
|
||||
|
||||
attachDatePicker();
|
||||
})();
|
||||
|
|
|
@ -1,13 +1,7 @@
|
|||
#= require jquery
|
||||
#= require jquery_ujs
|
||||
#= require jquery.validate
|
||||
#= require jquery.validate.additional-methods
|
||||
#= require turbolinks
|
||||
#= require bootstrap-sprockets
|
||||
#= require jquery.nested_attributes
|
||||
#= require shared/jquery.validate.bootstrap
|
||||
#= require jquery-ui/datepicker
|
||||
#= require select2
|
||||
#= require datepicker
|
||||
#= require shared/general
|
||||
#= require registrar/application
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#= require jquery
|
||||
#= require jquery_ujs
|
||||
#= require turbolinks
|
||||
#= require bootstrap-sprockets
|
||||
#= require typeahead.bundle.min
|
||||
#= require jquery.nested_attributes
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
$(document).on 'page:change', ->
|
||||
$ ->
|
||||
$('.js-contact-form').on 'restoreDefault', (e) ->
|
||||
form = $(e.target)
|
||||
form.find('.js-ident-tip').hide()
|
||||
|
|
|
@ -1,9 +1,3 @@
|
|||
#= require nprogress
|
||||
#= require nprogress-turbolinks
|
||||
|
||||
NProgress.configure
|
||||
showSpinner: false
|
||||
|
||||
@flash_notice = (msg) ->
|
||||
$('#flash').find('div').removeClass('bg-danger')
|
||||
$('#flash').find('div').addClass('bg-success')
|
||||
|
@ -16,7 +10,7 @@ NProgress.configure
|
|||
$('#flash').find('div').html(msg)
|
||||
$('#flash').show()
|
||||
|
||||
$(document).on 'page:change', ->
|
||||
$ ->
|
||||
today = new Date()
|
||||
tomorrow = new Date(today)
|
||||
tomorrow.setDate(today.getDate() + 1)
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
//= require 'shared/general-manifest'
|
||||
//= require 'admin/admin-bootstrap'
|
||||
//= require 'jquery-ui/datepicker'
|
||||
//= require 'select2'
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
//= require 'shared/general-manifest'
|
||||
//= require 'registrant/registrant-bootstrap'
|
||||
//= require 'jquery-ui/datepicker'
|
||||
//= require 'select2'
|
||||
//= require 'select2-bootstrap'
|
||||
@import shared/fonts
|
||||
@import shared/general
|
||||
@import nprogress
|
||||
@import nprogress-bootstrap
|
||||
@import forms
|
||||
@import typeaheadjs
|
||||
@import selectize
|
||||
@import selectize.bootstrap3
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
//= require 'shared/general-manifest'
|
||||
//= require 'registrar/registrar-bootstrap'
|
||||
//= require 'jquery-ui/datepicker'
|
||||
//= require 'select2'
|
||||
//= require 'select2-bootstrap'
|
||||
@import shared/fonts
|
||||
@import shared/general
|
||||
@import nprogress
|
||||
@import nprogress-bootstrap
|
||||
@import forms
|
||||
@import typeaheadjs
|
||||
@import selectize
|
||||
@import selectize.bootstrap3
|
||||
|
|
|
@ -65,3 +65,6 @@
|
|||
.required:after
|
||||
content: "*"
|
||||
margin: 0 0 0 1px
|
||||
|
||||
.tab-content
|
||||
padding-top: 15px
|
||||
|
|
|
@ -65,13 +65,6 @@ class ApplicationController < ActionController::Base
|
|||
user_log_str(current_user)
|
||||
end
|
||||
|
||||
def depp_current_user
|
||||
@depp_current_user ||= Depp::User.new(
|
||||
tag: current_user.username,
|
||||
password: current_user.password
|
||||
)
|
||||
end
|
||||
|
||||
def user_log_str(user)
|
||||
user.nil? ? 'public' : user.id_role_username
|
||||
end
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
class Registrant::DomainsController < RegistrantController
|
||||
|
||||
def index
|
||||
authorize! :view, :registrant_domains
|
||||
params[:q] ||= {}
|
||||
normalize_search_parameters do
|
||||
@q = domains.search(params[:q])
|
||||
@domains = @q.result.page(params[:page])
|
||||
end
|
||||
@domains = @domains.per(params[:results_per_page]) if params[:results_per_page].to_i > 0
|
||||
authorize! :view, :registrant_domains
|
||||
params[:q] ||= {}
|
||||
normalize_search_parameters do
|
||||
@q = domains.search(params[:q])
|
||||
@domains = @q.result.page(params[:page])
|
||||
end
|
||||
@domains = @domains.per(params[:results_per_page]) if params[:results_per_page].to_i > 0
|
||||
end
|
||||
|
||||
def show
|
||||
|
@ -15,19 +14,15 @@ class Registrant::DomainsController < RegistrantController
|
|||
authorize! :read, @domain
|
||||
end
|
||||
|
||||
def set_domain
|
||||
@domain = domains.find(params[:id])
|
||||
end
|
||||
|
||||
def domain_verification_url
|
||||
authorize! :view, :registrant_domains
|
||||
dom = domains.find(params[:id])
|
||||
if (dom.statuses.include?(DomainStatus::PENDING_UPDATE) || dom.statuses.include?(DomainStatus::PENDING_DELETE_CONFIRMATION)) &&
|
||||
dom.pending_json.present?
|
||||
dom.pending_json.present?
|
||||
|
||||
@domain = dom
|
||||
confirm_path = get_confirm_path(dom.statuses)
|
||||
@verification_url = "#{confirm_path}/#{@domain.id}?token=#{@domain.registrant_verification_token}"
|
||||
@domain = dom
|
||||
confirm_path = get_confirm_path(dom.statuses)
|
||||
@verification_url = "#{confirm_path}/#{@domain.id}?token=#{@domain.registrant_verification_token}"
|
||||
|
||||
else
|
||||
flash[:warning] = I18n.t('available_verification_url_not_found')
|
||||
|
@ -52,6 +47,12 @@ class Registrant::DomainsController < RegistrantController
|
|||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def set_domain
|
||||
@domain = domains.find(params[:id])
|
||||
end
|
||||
|
||||
def domains
|
||||
ident_cc, ident = @current_user.registrant_ident.split '-'
|
||||
begin
|
||||
|
@ -82,5 +83,4 @@ class Registrant::DomainsController < RegistrantController
|
|||
"#{ENV['registrant_url']}/registrant/domain_delete_confirms"
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
|
|
@ -31,12 +31,6 @@ class Registrant::SessionsController < Devise::SessionsController
|
|||
client = Digidoc::Client.new(endpoint)
|
||||
client.logger = Rails.application.config.logger unless Rails.env.test?
|
||||
|
||||
if Rails.env.test? && phone == "123"
|
||||
@user = ApiUser.find_by(identity_code: "14212128025")
|
||||
sign_in(@user, event: :authentication)
|
||||
return redirect_to registrant_root_url
|
||||
end
|
||||
|
||||
# country_codes = {'+372' => 'EST'}
|
||||
response = client.authenticate(
|
||||
phone: "+372#{phone}",
|
||||
|
|
69
app/controllers/registrar/domain_transfers_controller.rb
Normal file
69
app/controllers/registrar/domain_transfers_controller.rb
Normal file
|
@ -0,0 +1,69 @@
|
|||
class Registrar
|
||||
class DomainTransfersController < DeppController
|
||||
before_action do
|
||||
authorize! :transfer, Depp::Domain
|
||||
end
|
||||
|
||||
def new
|
||||
end
|
||||
|
||||
def create
|
||||
if params[:batch_file].present?
|
||||
csv = CSV.read(params[:batch_file].path, headers: true)
|
||||
domain_transfers = []
|
||||
|
||||
csv.each do |row|
|
||||
domain_name = row['Domain']
|
||||
transfer_code = row['Transfer code']
|
||||
domain_transfers << { 'domainName' => domain_name, 'transferCode' => transfer_code }
|
||||
end
|
||||
|
||||
uri = URI.parse("#{ENV['repp_url']}domain_transfers")
|
||||
request = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')
|
||||
request.body = { data: { domainTransfers: domain_transfers } }.to_json
|
||||
request.basic_auth(current_user.username, current_user.password)
|
||||
|
||||
|
||||
if Rails.env.test?
|
||||
response = Net::HTTP.start(uri.hostname, uri.port,
|
||||
use_ssl: (uri.scheme == 'https'),
|
||||
verify_mode: OpenSSL::SSL::VERIFY_NONE) do |http|
|
||||
http.request(request)
|
||||
end
|
||||
elsif Rails.env.development?
|
||||
client_cert = File.read(ENV['cert_path'])
|
||||
client_key = File.read(ENV['key_path'])
|
||||
response = Net::HTTP.start(uri.hostname, uri.port,
|
||||
use_ssl: (uri.scheme == 'https'),
|
||||
verify_mode: OpenSSL::SSL::VERIFY_NONE,
|
||||
cert: OpenSSL::X509::Certificate.new(client_cert),
|
||||
key: OpenSSL::PKey::RSA.new(client_key)) do |http|
|
||||
http.request(request)
|
||||
end
|
||||
else
|
||||
client_cert = File.read(ENV['cert_path'])
|
||||
client_key = File.read(ENV['key_path'])
|
||||
response = Net::HTTP.start(uri.hostname, uri.port,
|
||||
use_ssl: (uri.scheme == 'https'),
|
||||
cert: OpenSSL::X509::Certificate.new(client_cert),
|
||||
key: OpenSSL::PKey::RSA.new(client_key)) do |http|
|
||||
http.request(request)
|
||||
end
|
||||
end
|
||||
|
||||
if response.code == '204'
|
||||
flash[:notice] = t '.transferred'
|
||||
redirect_to registrar_domains_url
|
||||
else
|
||||
@api_errors = JSON.parse(response.body, symbolize_names: true)[:errors]
|
||||
render :new
|
||||
end
|
||||
else
|
||||
params[:request] = true # EPP domain:transfer "op" attribute
|
||||
domain = Depp::Domain.new(current_user: depp_current_user)
|
||||
@data = domain.transfer(params)
|
||||
render :new unless response_ok?
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -52,7 +52,8 @@ class Registrar
|
|||
end
|
||||
|
||||
csv = Registrar::DomainListCSVPresenter.new(domains: domain_presenters, view: view_context).to_s
|
||||
send_data(csv)
|
||||
filename = "Domains_#{l(Time.zone.now, format: :filename)}.csv"
|
||||
send_data(csv, filename: filename)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -146,16 +147,6 @@ class Registrar
|
|||
end
|
||||
end
|
||||
|
||||
def transfer
|
||||
authorize! :transfer, Depp::Domain
|
||||
if request.post? && params[:domain_name]
|
||||
@data = @domain.transfer(params)
|
||||
render 'transfer_index' and return unless response_ok?
|
||||
else
|
||||
render 'transfer_index'
|
||||
end
|
||||
end
|
||||
|
||||
def search_contacts
|
||||
authorize! :create, Depp::Domain
|
||||
|
||||
|
|
|
@ -54,14 +54,14 @@ class Ability
|
|||
# can(:create, :epp_request)
|
||||
|
||||
# Epp::Domain
|
||||
can(:info, Epp::Domain) { |d, pw| d.registrar_id == @user.registrar_id || pw.blank? ? true : d.auth_info == pw }
|
||||
can(:info, Epp::Domain) { |d, pw| d.registrar_id == @user.registrar_id || pw.blank? ? true : d.transfer_code == pw }
|
||||
can(:check, Epp::Domain)
|
||||
can(:create, Epp::Domain)
|
||||
can(:renew, Epp::Domain) { |d| d.registrar_id == @user.registrar_id }
|
||||
can(:update, Epp::Domain) { |d, pw| d.registrar_id == @user.registrar_id || d.auth_info == pw }
|
||||
can(:transfer, Epp::Domain) { |d, pw| d.auth_info == pw }
|
||||
can(:view_password, Epp::Domain) { |d, pw| d.registrar_id == @user.registrar_id || d.auth_info == pw }
|
||||
can(:delete, Epp::Domain) { |d, pw| d.registrar_id == @user.registrar_id || d.auth_info == pw }
|
||||
can(:update, Epp::Domain) { |d, pw| d.registrar_id == @user.registrar_id || d.transfer_code == pw }
|
||||
can(:transfer, Epp::Domain) { |d, pw| d.transfer_code == pw }
|
||||
can(:view_password, Epp::Domain) { |d, pw| d.registrar_id == @user.registrar_id || d.transfer_code == pw }
|
||||
can(:delete, Epp::Domain) { |d, pw| d.registrar_id == @user.registrar_id || d.transfer_code == pw }
|
||||
|
||||
# Epp::Contact
|
||||
can(:info, Epp::Contact) { |c, pw| c.registrar_id == @user.registrar_id || pw.blank? ? true : c.auth_info == pw }
|
||||
|
|
|
@ -19,24 +19,17 @@ authentication using electronic ID. Association through a business organisation
|
|||
=end
|
||||
|
||||
class BusinessRegistryCache < ActiveRecord::Base
|
||||
|
||||
# 1. load domains by business
|
||||
# 2. load domains by person
|
||||
def associated_contacts
|
||||
contact_ids = Contact.where(ident_type: 'org', ident: associated_businesses, ident_country_code: 'EE').pluck(:id)
|
||||
contact_ids += Contact.where(ident_type: 'priv', ident: ident, ident_country_code: ident_country_code).pluck(:id)
|
||||
contact_ids
|
||||
end
|
||||
|
||||
def associated_domain_ids
|
||||
contact_ids = Contact.where(ident_type: 'org', ident: associated_businesses, ident_country_code: ident_country_code).pluck(:id)
|
||||
contact_ids += Contact.where(ident_type: 'priv', ident: ident, ident_country_code: ident_country_code).pluck(:id)
|
||||
domain_ids = []
|
||||
|
||||
contact_ids = associated_contacts
|
||||
|
||||
unless contact_ids.blank?
|
||||
domain_ids = DomainContact.distinct.where(contact_id: contact_ids).pluck(:domain_id)
|
||||
end
|
||||
|
||||
domain_ids += Domain.where(registrant_id: contact_ids).pluck(:id)
|
||||
|
||||
domain_ids
|
||||
end
|
||||
|
||||
|
@ -69,15 +62,5 @@ class BusinessRegistryCache < ActiveRecord::Base
|
|||
def business_registry
|
||||
Soap::Arireg.new
|
||||
end
|
||||
|
||||
def purge
|
||||
STDOUT << "#{Time.zone.now.utc} - Starting Purge of old BusinessRegistry data from cache\n" unless Rails.env.test?
|
||||
purged = 0
|
||||
BusinessRegistryCache.where('retrieved_on < ?',
|
||||
Time.zone.now < Setting.days_to_keep_business_registry_cache.days).each do |br|
|
||||
br.destroy and purged += 1
|
||||
end
|
||||
STDOUT << "#{Time.zone.now.utc} - Finished purging #{purged} old BusinessRegistry cache items\n" unless Rails.env.test?
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
28
app/models/concerns/contact/transferable.rb
Normal file
28
app/models/concerns/contact/transferable.rb
Normal file
|
@ -0,0 +1,28 @@
|
|||
module Concerns::Contact::Transferable
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
included do
|
||||
validates :auth_info, presence: true
|
||||
after_initialize :generate_auth_info, if: 'new_record? && auth_info.blank?'
|
||||
end
|
||||
|
||||
def transfer(new_registrar)
|
||||
new_contact = self.dup
|
||||
new_contact.registrar = new_registrar
|
||||
new_contact.original = self
|
||||
new_contact.code = nil
|
||||
new_contact.regenerate_code
|
||||
new_contact.regenerate_auth_info
|
||||
new_contact.remove_address unless self.class.address_processing?
|
||||
new_contact.save!
|
||||
new_contact
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def generate_auth_info
|
||||
self.auth_info = SecureRandom.hex(11)
|
||||
end
|
||||
|
||||
alias_method :regenerate_auth_info, :generate_auth_info
|
||||
end
|
68
app/models/concerns/domain/transferable.rb
Normal file
68
app/models/concerns/domain/transferable.rb
Normal file
|
@ -0,0 +1,68 @@
|
|||
module Concerns::Domain::Transferable
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
included do
|
||||
after_initialize :generate_transfer_code, if: 'new_record? && transfer_code.blank?'
|
||||
end
|
||||
|
||||
def transfer(new_registrar)
|
||||
old_registrar = registrar
|
||||
|
||||
self.registrar = new_registrar
|
||||
regenerate_transfer_code
|
||||
|
||||
contact_codes = contacts.pluck(:code).sort.uniq
|
||||
registrant_code = registrant.code
|
||||
|
||||
transaction do
|
||||
old_registrar.messages.create!(
|
||||
body: I18n.t('domain_transfer_was_approved', contacts: contact_codes, registrant: registrant_code),
|
||||
attached_obj_id: id,
|
||||
attached_obj_type: self.class.name
|
||||
)
|
||||
|
||||
domain_transfers.create!(
|
||||
transfer_requested_at: Time.zone.now,
|
||||
old_registrar: old_registrar,
|
||||
new_registrar: new_registrar
|
||||
)
|
||||
|
||||
transfer_contacts(new_registrar)
|
||||
save!
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def generate_transfer_code
|
||||
self.transfer_code = SecureRandom.hex
|
||||
end
|
||||
|
||||
alias_method :regenerate_transfer_code, :generate_transfer_code
|
||||
|
||||
def transfer_contacts(new_registrar)
|
||||
transfer_registrant(new_registrar)
|
||||
transfer_domain_contacts(new_registrar)
|
||||
end
|
||||
|
||||
def transfer_registrant(new_registrar)
|
||||
return if registrant.registrar == new_registrar
|
||||
self.registrant = registrant.transfer(new_registrar)
|
||||
end
|
||||
|
||||
def transfer_domain_contacts(new_registrar)
|
||||
copied_ids = []
|
||||
contacts.each do |contact|
|
||||
next if copied_ids.include?(contact.id) || contact.registrar == new_registrar
|
||||
|
||||
if registrant_id_was == contact.id # registrant was copied previously, do not copy it again
|
||||
oc = OpenStruct.new(id: registrant_id)
|
||||
else
|
||||
oc = contact.transfer(new_registrar)
|
||||
end
|
||||
|
||||
domain_contacts.where(contact_id: contact.id).update_all({ contact_id: oc.id }) # n+1 workaround
|
||||
copied_ids << contact.id
|
||||
end
|
||||
end
|
||||
end
|
|
@ -67,7 +67,7 @@ module Versions
|
|||
map do |ver|
|
||||
o = new(ver.object)
|
||||
o.version_loader = ver
|
||||
ver.object_changes.to_h.each { |k, v| o[k]=v[-1] }
|
||||
ver.object_changes.to_h.each { |k, v| o.public_send("#{k}=", v[-1]) }
|
||||
o
|
||||
end
|
||||
not_in_history = where(id: (ids.to_a - from_history.map(&:id)))
|
||||
|
|
|
@ -2,7 +2,9 @@ class Contact < ActiveRecord::Base
|
|||
include Versions # version/contact_version.rb
|
||||
include EppErrors
|
||||
include UserEvents
|
||||
include Concerns::Contact::Transferable
|
||||
|
||||
belongs_to :original, class_name: self.name
|
||||
belongs_to :registrar, required: true
|
||||
has_many :domain_contacts
|
||||
has_many :domains, through: :domain_contacts
|
||||
|
@ -16,6 +18,7 @@ class Contact < ActiveRecord::Base
|
|||
|
||||
attr_accessor :legal_document_id
|
||||
alias_attribute :kind, :ident_type
|
||||
alias_attribute :copy_from_id, :original_id # Old attribute name; for PaperTrail
|
||||
|
||||
accepts_nested_attributes_for :legal_documents
|
||||
|
||||
|
@ -43,7 +46,6 @@ class Contact < ActiveRecord::Base
|
|||
|
||||
before_validation :to_upcase_country_code
|
||||
before_validation :strip_email
|
||||
before_create :generate_auth_info
|
||||
before_update :manage_emails
|
||||
|
||||
composed_of :identifier,
|
||||
|
@ -79,7 +81,6 @@ class Contact < ActiveRecord::Base
|
|||
PASSPORT = 'passport'
|
||||
|
||||
attr_accessor :deliver_emails
|
||||
attr_accessor :domain_transfer # hack but solves problem faster
|
||||
|
||||
#
|
||||
# STATUSES
|
||||
|
@ -313,16 +314,6 @@ class Contact < ActiveRecord::Base
|
|||
!org?
|
||||
end
|
||||
|
||||
def generate_auth_info
|
||||
return if @generate_auth_info_disabled
|
||||
return if auth_info.present?
|
||||
self.auth_info = SecureRandom.hex(11)
|
||||
end
|
||||
|
||||
# def auth_info=(pw)
|
||||
# self[:auth_info] = pw if new_record?
|
||||
# end
|
||||
|
||||
def code=(code)
|
||||
self[:code] = code if new_record? # cannot change code later
|
||||
end
|
||||
|
@ -346,6 +337,8 @@ class Contact < ActiveRecord::Base
|
|||
end
|
||||
# rubocop:enable Metrics/CyclomaticComplexity
|
||||
|
||||
alias_method :regenerate_code, :generate_code
|
||||
|
||||
def country
|
||||
Country.new(country_code)
|
||||
end
|
||||
|
|
|
@ -118,7 +118,7 @@ module Depp
|
|||
|
||||
current_user.request(epp_xml.transfer({
|
||||
name: { value: params[:domain_name] },
|
||||
authInfo: { pw: { value: params[:password] } }
|
||||
authInfo: { pw: { value: params[:transfer_code] } }
|
||||
}, op, Domain.construct_custom_params_hash(params)))
|
||||
end
|
||||
|
||||
|
|
|
@ -36,39 +36,6 @@ module Depp
|
|||
Nokogiri::XML(e.response_xml.to_s).remove_namespaces!
|
||||
end
|
||||
|
||||
# rubocop:disable Metrics/AbcSize
|
||||
def repp_request(path, params = {})
|
||||
client_cert = File.read(ENV['cert_path'])
|
||||
client_key = File.read(ENV['key_path'])
|
||||
|
||||
repp_url = Rails.env.test? ? 'http://localhost:8989/repp/v1/' : ENV['repp_url']
|
||||
uri = URI.parse("#{repp_url}#{path}")
|
||||
uri.query = URI.encode_www_form(params)
|
||||
|
||||
req = Net::HTTP::Get.new(uri)
|
||||
req.basic_auth tag, password
|
||||
|
||||
res = Net::HTTP.start(uri.hostname, uri.port,
|
||||
use_ssl: (uri.scheme == 'https'),
|
||||
verify_mode: OpenSSL::SSL::VERIFY_NONE,
|
||||
cert: OpenSSL::X509::Certificate.new(client_cert),
|
||||
key: OpenSSL::PKey::RSA.new(client_key)) do |http|
|
||||
http.request(req)
|
||||
end
|
||||
|
||||
ret = OpenStruct.new(code: res.code)
|
||||
ret.parsed_body = JSON.parse(res.body) if res.body.present?
|
||||
|
||||
if ret.parsed_body && ret.parsed_body['error']
|
||||
ret.message = ret.parsed_body['error']
|
||||
else
|
||||
ret.message = res.message
|
||||
end
|
||||
|
||||
ret
|
||||
end
|
||||
# rubocop:enable Metrics/AbcSize
|
||||
|
||||
private
|
||||
|
||||
# rubocop:disable Metrics/AbcSize
|
||||
|
|
|
@ -6,6 +6,7 @@ class Domain < ActiveRecord::Base
|
|||
include Concerns::Domain::Activatable
|
||||
include Concerns::Domain::ForceDelete
|
||||
include Concerns::Domain::Deletable
|
||||
include Concerns::Domain::Transferable
|
||||
|
||||
has_paper_trail class_name: "DomainVersion", meta: { children: :children_log }
|
||||
|
||||
|
@ -15,6 +16,7 @@ class Domain < ActiveRecord::Base
|
|||
|
||||
alias_attribute :on_hold_time, :outzone_at
|
||||
alias_attribute :outzone_time, :outzone_at
|
||||
alias_attribute :auth_info, :transfer_code # Old attribute name; for PaperTrail
|
||||
|
||||
# TODO: whois requests ip whitelist for full info for own domains and partial info for other domains
|
||||
# TODO: most inputs should be trimmed before validatation, probably some global logic?
|
||||
|
@ -79,9 +81,7 @@ class Domain < ActiveRecord::Base
|
|||
self.status_notes = {} if status_notes.nil?
|
||||
end
|
||||
|
||||
before_create :generate_auth_info
|
||||
before_create -> { self.reserved = in_reserved_list?; nil }
|
||||
|
||||
before_save :manage_automatic_statuses
|
||||
before_save :touch_always_version
|
||||
def touch_always_version
|
||||
|
@ -105,6 +105,7 @@ class Domain < ActiveRecord::Base
|
|||
validates :name_dirty, domain_name: true, uniqueness: true
|
||||
validates :puny_label, length: { maximum: 63 }
|
||||
validates :period, presence: true, numericality: { only_integer: true }
|
||||
validates :transfer_code, presence: true
|
||||
|
||||
validate :validate_reservation
|
||||
def validate_reservation
|
||||
|
@ -497,19 +498,6 @@ class Domain < ActiveRecord::Base
|
|||
Registrant.find_by(id: pending_json['new_registrant_id'])
|
||||
end
|
||||
|
||||
def generate_auth_info
|
||||
return if auth_info.present?
|
||||
generate_auth_info!
|
||||
end
|
||||
|
||||
# rubocop:disable Lint/Loop
|
||||
def generate_auth_info!
|
||||
begin
|
||||
self.auth_info = SecureRandom.hex
|
||||
end while self.class.exists?(auth_info: auth_info)
|
||||
end
|
||||
# rubocop:enable Lint/Loop
|
||||
|
||||
def set_graceful_expired
|
||||
self.outzone_at = expire_time + self.class.expire_warning_period
|
||||
self.delete_at = outzone_at + self.class.redemption_grace_period
|
||||
|
@ -672,6 +660,12 @@ class Domain < ActiveRecord::Base
|
|||
pending_json['new_registrant_id']
|
||||
end
|
||||
|
||||
def as_json(_options)
|
||||
hash = super
|
||||
hash['auth_info'] = hash.delete('transfer_code') # API v1 requirement
|
||||
hash
|
||||
end
|
||||
|
||||
def self.to_csv
|
||||
CSV.generate do |csv|
|
||||
csv << column_names
|
||||
|
|
|
@ -1,16 +1,13 @@
|
|||
class DomainTransfer < ActiveRecord::Base
|
||||
include Versions # version/domain_transfer_version.rb
|
||||
belongs_to :domain
|
||||
|
||||
belongs_to :transfer_from, class_name: 'Registrar'
|
||||
belongs_to :transfer_to, class_name: 'Registrar'
|
||||
belongs_to :old_registrar, class_name: 'Registrar'
|
||||
belongs_to :new_registrar, class_name: 'Registrar'
|
||||
|
||||
PENDING = 'pending'
|
||||
CLIENT_APPROVED = 'clientApproved'
|
||||
CLIENT_CANCELLED = 'clientCancelled'
|
||||
CLIENT_REJECTED = 'clientRejected'
|
||||
SERVER_APPROVED = 'serverApproved'
|
||||
SERVER_CANCELLED = 'serverCancelled'
|
||||
|
||||
before_create :set_wait_until
|
||||
def set_wait_until
|
||||
|
@ -39,20 +36,8 @@ class DomainTransfer < ActiveRecord::Base
|
|||
status == PENDING
|
||||
end
|
||||
|
||||
def approve_as_client
|
||||
transaction do
|
||||
self.status = DomainTransfer::CLIENT_APPROVED
|
||||
self.transferred_at = Time.zone.now
|
||||
save
|
||||
|
||||
domain.generate_auth_info
|
||||
domain.registrar = transfer_to
|
||||
domain.save(validate: false)
|
||||
end
|
||||
end
|
||||
|
||||
def notify_losing_registrar(contacts, registrant)
|
||||
transfer_from.messages.create!(
|
||||
old_registrar.messages.create!(
|
||||
body: I18n.t('domain_transfer_was_approved', contacts: contacts, registrant: registrant),
|
||||
attached_obj_id: id,
|
||||
attached_obj_type: self.class.to_s
|
||||
|
|
|
@ -100,7 +100,7 @@ class Epp::Domain < Domain
|
|||
[:puny_label, :too_long, { obj: 'name', val: name_puny }]
|
||||
],
|
||||
'2201' => [ # Authorisation error
|
||||
[:auth_info, :wrong_pw]
|
||||
[:transfer_code, :wrong_pw]
|
||||
],
|
||||
'2202' => [
|
||||
[:base, :invalid_auth_information_reserved]
|
||||
|
@ -182,7 +182,7 @@ class Epp::Domain < Domain
|
|||
# at[:domain_statuses_attributes] = domain_statuses_attrs(frame, action)
|
||||
|
||||
pw = frame.css('authInfo > pw').text
|
||||
at[:auth_info] = pw if pw.present?
|
||||
at[:transfer_code] = pw if pw.present?
|
||||
|
||||
if new_record?
|
||||
dnskey_frame = frame.css('extension create')
|
||||
|
@ -641,47 +641,6 @@ class Epp::Domain < Domain
|
|||
end
|
||||
end
|
||||
|
||||
# TODO: Eager load problems here. Investigate how it's possible not to query contact again
|
||||
# Check if versioning works with update_column
|
||||
def transfer_contacts(registrar_id)
|
||||
transfer_registrant(registrar_id)
|
||||
transfer_domain_contacts(registrar_id)
|
||||
end
|
||||
|
||||
def copy_and_transfer_contact(contact_id, registrar_id)
|
||||
c = Contact.find(contact_id) # n+1 workaround
|
||||
oc = c.deep_clone
|
||||
oc.code = nil
|
||||
oc.registrar_id = registrar_id
|
||||
oc.copy_from_id = c.id
|
||||
oc.generate_code
|
||||
oc.domain_transfer = true
|
||||
oc.remove_address unless Contact.address_processing?
|
||||
oc.save!(validate: false)
|
||||
oc
|
||||
end
|
||||
|
||||
def transfer_registrant(registrar_id)
|
||||
return if registrant.registrar_id == registrar_id
|
||||
self.registrant_id = copy_and_transfer_contact(registrant_id, registrar_id).id
|
||||
end
|
||||
|
||||
def transfer_domain_contacts(registrar_id)
|
||||
copied_ids = []
|
||||
contacts.each do |c|
|
||||
next if copied_ids.include?(c.id) || c.registrar_id == registrar_id
|
||||
|
||||
if registrant_id_was == c.id # registrant was copied previously, do not copy it again
|
||||
oc = OpenStruct.new(id: registrant_id)
|
||||
else
|
||||
oc = copy_and_transfer_contact(c.id, registrar_id)
|
||||
end
|
||||
|
||||
domain_contacts.where(contact_id: c.id).update_all({ contact_id: oc.id }) # n+1 workaround
|
||||
copied_ids << c.id
|
||||
end
|
||||
end
|
||||
|
||||
# rubocop: enable Metrics/PerceivedComplexity
|
||||
# rubocop: enable Metrics/CyclomaticComplexity
|
||||
# rubocop: disable Metrics/MethodLength
|
||||
|
@ -707,8 +666,8 @@ class Epp::Domain < Domain
|
|||
transaction do
|
||||
dt = domain_transfers.create!(
|
||||
transfer_requested_at: Time.zone.now,
|
||||
transfer_to: current_user.registrar,
|
||||
transfer_from: registrar
|
||||
old_registrar: registrar,
|
||||
new_registrar: current_user.registrar
|
||||
)
|
||||
|
||||
if dt.pending?
|
||||
|
@ -720,9 +679,9 @@ class Epp::Domain < Domain
|
|||
end
|
||||
|
||||
if dt.approved?
|
||||
transfer_contacts(current_user.registrar_id)
|
||||
transfer_contacts(current_user.registrar)
|
||||
dt.notify_losing_registrar(old_contact_codes, old_registrant_code)
|
||||
generate_auth_info!
|
||||
regenerate_transfer_code
|
||||
self.registrar = current_user.registrar
|
||||
end
|
||||
|
||||
|
@ -737,7 +696,7 @@ class Epp::Domain < Domain
|
|||
|
||||
def approve_transfer(frame, current_user)
|
||||
pt = pending_transfer
|
||||
if current_user.registrar != pt.transfer_from
|
||||
if current_user.registrar != pt.old_registrar
|
||||
throw :epp_error, {
|
||||
msg: I18n.t('transfer_can_be_approved_only_by_current_registrar'),
|
||||
code: '2304'
|
||||
|
@ -750,9 +709,9 @@ class Epp::Domain < Domain
|
|||
transferred_at: Time.zone.now
|
||||
)
|
||||
|
||||
transfer_contacts(pt.transfer_to_id)
|
||||
generate_auth_info
|
||||
self.registrar = pt.transfer_to
|
||||
transfer_contacts(pt.new_registrar)
|
||||
regenerate_transfer_code
|
||||
self.registrar = pt.new_registrar
|
||||
|
||||
attach_legal_document(self.class.parse_legal_document_from_frame(frame))
|
||||
save!(validate: false)
|
||||
|
@ -763,7 +722,7 @@ class Epp::Domain < Domain
|
|||
|
||||
def reject_transfer(frame, current_user)
|
||||
pt = pending_transfer
|
||||
if current_user.registrar != pt.transfer_from
|
||||
if current_user.registrar != pt.old_registrar
|
||||
throw :epp_error, {
|
||||
msg: I18n.t('transfer_can_be_rejected_only_by_current_registrar'),
|
||||
code: '2304'
|
||||
|
@ -872,7 +831,7 @@ class Epp::Domain < Domain
|
|||
|
||||
# For domain transfer
|
||||
def authenticate(pw)
|
||||
errors.add(:auth_info, :wrong_pw) if pw != auth_info
|
||||
errors.add(:transfer_code, :wrong_pw) if pw != transfer_code
|
||||
errors.empty?
|
||||
end
|
||||
|
||||
|
|
|
@ -140,8 +140,8 @@ class Registrar < ActiveRecord::Base
|
|||
def domain_transfers
|
||||
at = DomainTransfer.arel_table
|
||||
DomainTransfer.where(
|
||||
at[:transfer_to_id].eq(id).or(
|
||||
at[:transfer_from_id].eq(id)
|
||||
at[:new_registrar_id].eq(id).or(
|
||||
at[:old_registrar_id].eq(id)
|
||||
)
|
||||
)
|
||||
end
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
class DomainTransferVersion < PaperTrail::Version
|
||||
include VersionSession
|
||||
self.table_name = :log_domain_transfers
|
||||
self.sequence_name = :log_domain_transfers_id_seq
|
||||
end
|
|
@ -1,5 +1,5 @@
|
|||
class DomainPresenter
|
||||
delegate :name, :registrant_name, :registrant_id, :registrant_code, to: :domain
|
||||
delegate :name, :transfer_code, :registrant_name, :registrant_id, :registrant_code, to: :domain
|
||||
|
||||
def initialize(domain:, view:)
|
||||
@domain = domain
|
||||
|
|
|
@ -19,6 +19,7 @@ class Registrar::DomainListCSVPresenter
|
|||
def header
|
||||
columns = %w(
|
||||
domain_name
|
||||
transfer_code
|
||||
registrant_name
|
||||
registrant_code
|
||||
expire_time
|
||||
|
@ -32,9 +33,10 @@ class Registrar::DomainListCSVPresenter
|
|||
def domain_to_row(domain:)
|
||||
row = []
|
||||
row[0] = domain.name
|
||||
row[1] = domain.registrant_name
|
||||
row[2] = domain.registrant_code
|
||||
row[3] = domain.expire_date
|
||||
row[1] = domain.transfer_code
|
||||
row[2] = domain.registrant_name
|
||||
row[3] = domain.registrant_code
|
||||
row[4] = domain.expire_date
|
||||
row
|
||||
|
||||
CSV::Row.new([], row)
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
- @versions.each do |version|
|
||||
- if version
|
||||
- contact = Contact.new(version.object.to_h)
|
||||
- version.object_changes.to_h.each{|k,v| contact[k]=v.last}
|
||||
- version.object_changes.to_h.each { |k,v| contact.public_send("#{k}=", v.last) }
|
||||
|
||||
%tr
|
||||
%td= link_to(contact.name, admin_contact_version_path(version.id))
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
- contact = Contact.new(@version.object.to_h)
|
||||
- @version.object_changes.to_h.each{|k,v| contact[k]=v.last}
|
||||
- @version.object_changes.to_h.each { |k,v| contact.public_send("#{k}=", v.last ) }
|
||||
= render 'shared/title', name: contact.name
|
||||
|
||||
.row
|
||||
|
|
|
@ -3,9 +3,7 @@
|
|||
= render 'shared/errors', object: contact
|
||||
.row
|
||||
.col-md-8
|
||||
.tab-content{style:'margin-top: 20px;'}
|
||||
#general-tab.tab-pane.active
|
||||
= render 'admin/shared/form/statuses', f: f,
|
||||
= render 'admin/shared/form/statuses', f: f,
|
||||
model: 'contact',
|
||||
admin_statuses_map: Contact.admin_statuses_map,
|
||||
disabled_statuses: Contact::STATUSES - Contact.admin_statuses,
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
- @versions.each do |version|
|
||||
- if version
|
||||
- domain = Domain.new(version.object.to_h)
|
||||
- version.object_changes.to_h.each{|k,v| domain[k]=v.last}
|
||||
- version.object_changes.to_h.each{|k,v| domain.public_send("#{k}=", v.last) }
|
||||
|
||||
%tr
|
||||
%td= link_to(domain.name, admin_domain_version_path(version.id))
|
||||
|
@ -66,7 +66,7 @@
|
|||
- else
|
||||
- contact = Contact.all_versions_for([domain.registrant_id], version.created_at).first
|
||||
- if contact.nil? && ver = ContactVersion.where(item_id: domain.registrant_id).last
|
||||
- contact = Contact.new(ver.object.to_h.merge(ver.object_changes.to_h.each_with_object({}){|(k,v), o| o[k]=v.last } ))
|
||||
- contact = Contact.new(ver.object.to_h.merge(ver.object_changes.to_h.each_with_object({}){|(k,v), o| o.public_send("#{k}=", v.last) } ))
|
||||
= contact.try(:name)
|
||||
= " ".html_safe
|
||||
= "(#{t(:deleted)})"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
- domain = Domain.new(@version.object.to_h)
|
||||
- @version.object_changes.to_h.each{|k,v| domain[k]=v.last}
|
||||
- @version.object_changes.to_h.each{|k,v| domain.public_send("#{k}=", v.last) }
|
||||
|
||||
- if @version
|
||||
- children = HashWithIndifferentAccess.new(@version.children)
|
||||
|
|
6
app/views/admin/domains/_domain.html.erb
Normal file
6
app/views/admin/domains/_domain.html.erb
Normal file
|
@ -0,0 +1,6 @@
|
|||
<tr>
|
||||
<td><%= link_to domain, admin_domain_path(domain) %></td>
|
||||
<td><%= link_to domain.registrant, admin_registrant_path(domain.registrant) %></td>
|
||||
<td><%= l domain.expire_time %></td>
|
||||
<td><%= link_to domain.registrar, admin_registrar_path(domain.registrar) %></td>
|
||||
</tr>
|
|
@ -4,9 +4,7 @@
|
|||
%hr
|
||||
.row
|
||||
.col-md-8
|
||||
.tab-content{style:'margin-top: 20px;'}
|
||||
#general-tab.tab-pane.active
|
||||
= render 'admin/shared/form/statuses', f: f,
|
||||
= render 'admin/shared/form/statuses', f: f,
|
||||
model: 'domain',
|
||||
admin_statuses_map: DomainStatus.admin_statuses_map,
|
||||
disabled_statuses: DomainStatus::STATUSES - DomainStatus.admin_statuses,
|
||||
|
|
70
app/views/admin/domains/_search_form.html.erb
Normal file
70
app/views/admin/domains/_search_form.html.erb
Normal file
|
@ -0,0 +1,70 @@
|
|||
<%= search_form_for [:admin, @q], html: { class: 'search-form', autocomplete: 'off' } do |f| %>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<%= f.label :name, for: nil %>
|
||||
<%= f.search_field :name_matches, value: params[:q][:name_matches], class: 'form-control', placeholder: t(:name) %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<%= f.label :registrant_ident, for: nil %>
|
||||
<%= f.search_field :registrant_ident_eq, class: 'form-control', placeholder: t(:registrant_ident) %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<%= f.label :contact_ident, for: nil %>
|
||||
<%= f.search_field :contacts_ident_eq, class: 'form-control', placeholder: t(:contact_ident) %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<%= f.label :nameserver_hostname, for: nil %>
|
||||
<%= f.search_field :nameservers_hostname_eq, class: 'form-control', placeholder: t(:nameserver_hostname) %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<%= f.label :registrar_name, for: nil %>
|
||||
<%= f.select :registrar_id_eq, Registrar.all.map { |x| [x, x.id] }, { include_blank: true }, class: 'form-control selectize' %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<%= f.label :valid_to_from, for: nil %>
|
||||
<%= f.search_field :valid_to_gteq, value: params[:q][:valid_to_gteq], class: 'form-control js-datepicker', placeholder: t(:valid_to_from) %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<%= f.label :valid_to_until, for: nil %>
|
||||
<%= f.search_field :valid_to_lteq, value: params[:q][:valid_to_lteq], class: 'form-control js-datepicker', placeholder: t(:valid_to_until) %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<%= label_tag :status, nil, for: nil %>
|
||||
<%= select_tag :statuses_contains, options_for_select(DomainStatus::STATUSES, params[:statuses_contains]), { multiple: true, class: 'form-control js-combobox' } %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<%= label_tag :results_per_page, nil, for: nil %>
|
||||
<%= text_field_tag :results_per_page, params[:results_per_page], class: 'form-control', placeholder: t(:results_per_page) %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3 actions">
|
||||
<button class="btn btn-primary">
|
||||
|
||||
<span class="glyphicon glyphicon-search"></span>
|
||||
|
||||
</button>
|
||||
<%= link_to t('.reset_btn'), admin_domains_path, class: 'btn btn-default' %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
|
@ -1,81 +0,0 @@
|
|||
= render 'shared/title', name: t(:domains)
|
||||
|
||||
.row
|
||||
.col-md-12
|
||||
= search_form_for [:admin, @q], html: { style: 'margin-bottom: 0;', class: 'js-form', autocomplete: 'off' } do |f|
|
||||
.row
|
||||
.col-md-3
|
||||
.form-group
|
||||
= f.label :name
|
||||
= f.search_field :name_matches, value: params[:q][:name_matches], class: 'form-control', placeholder: t(:name)
|
||||
.col-md-3
|
||||
.form-group
|
||||
= f.label t(:registrant_ident)
|
||||
= f.search_field :registrant_ident_eq, class: 'form-control', placeholder: t(:registrant_ident)
|
||||
.col-md-3
|
||||
.form-group
|
||||
= f.label t(:contact_ident)
|
||||
= f.search_field :contacts_ident_eq, class: 'form-control', placeholder: t(:contact_ident)
|
||||
.col-md-3
|
||||
.form-group
|
||||
= f.label t(:nameserver_hostname)
|
||||
= f.search_field :nameservers_hostname_eq, class: 'form-control', placeholder: t(:nameserver_hostname)
|
||||
.row
|
||||
.col-md-6
|
||||
.form-group
|
||||
= 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
|
||||
= f.label t(:valid_to_from)
|
||||
= f.search_field :valid_to_gteq, value: params[:q][:valid_to_gteq], class: 'form-control js-datepicker', placeholder: t(:valid_to_from)
|
||||
.col-md-3
|
||||
.form-group
|
||||
= f.label t(:valid_to_until)
|
||||
= f.search_field :valid_to_lteq, value: params[:q][:valid_to_lteq], class: 'form-control js-datepicker', placeholder: t(:valid_to_until)
|
||||
.row
|
||||
.col-md-6
|
||||
.form-group
|
||||
= label_tag t(:status)
|
||||
= select_tag :statuses_contains, options_for_select(DomainStatus::STATUSES, params[:statuses_contains]), { multiple: true, placeholder: t(:choose), class: 'form-control js-combobox' }
|
||||
.col-md-3
|
||||
.form-group
|
||||
= label_tag t(:results_per_page)
|
||||
= text_field_tag :results_per_page, params[:results_per_page], class: 'form-control', placeholder: t(:results_per_page)
|
||||
.col-md-3{style: 'padding-top: 25px;'}
|
||||
%button.btn.btn-primary
|
||||
|
||||
%span.glyphicon.glyphicon-search
|
||||
|
||||
= link_to(t('.reset_btn'), admin_domains_path, class: 'btn btn-default')
|
||||
%hr
|
||||
.row
|
||||
.col-md-12
|
||||
.table-responsive
|
||||
%table.table.table-hover.table-bordered.table-condensed
|
||||
%thead
|
||||
%tr
|
||||
%th{class: 'col-xs-2'}
|
||||
= sort_link(@q, 'name')
|
||||
%th{class: 'col-xs-2'}
|
||||
= sort_link(@q, 'registrant_name', t('.registrant'))
|
||||
%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_name))
|
||||
%tbody
|
||||
- @domains.each do |x|
|
||||
%tr
|
||||
%td= link_to(x, admin_domain_path(x))
|
||||
%td
|
||||
- if x.registrant
|
||||
= link_to(x.registrant, [:admin, x.registrant])
|
||||
|
||||
%td= l(x.valid_to, format: :short)
|
||||
%td= link_to(x.registrar, admin_registrar_path(x.registrar)) if x.registrar
|
||||
.row
|
||||
.col-md-6
|
||||
= paginate @domains
|
||||
.col-md-6.text-right
|
||||
.pagination
|
||||
= t(:result_count, count: @domains.total_count)
|
42
app/views/admin/domains/index.html.erb
Normal file
42
app/views/admin/domains/index.html.erb
Normal file
|
@ -0,0 +1,42 @@
|
|||
<div class="page-header">
|
||||
<h1><%= t '.header' %></h1>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<%= render 'search_form' %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover table-bordered table-condensed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-xs-2"><%= sort_link(@q, 'name') %></th>
|
||||
<th class="col-xs-2"><%= sort_link(@q, 'registrant_name', Registrant.model_name.human) %></th>
|
||||
<th class="col-xs-2"><%= sort_link(@q, 'valid_to', t(:valid_to)) %></th>
|
||||
<th class="col-xs-2"><%= sort_link(@q, 'registrar_name', Registrar.model_name.human) %></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<%= render @domains %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<%= paginate @domains %>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 text-right">
|
||||
<div class="pagination">
|
||||
<%= t(:result_count, count: @domains.total_count) %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -1,32 +0,0 @@
|
|||
.panel.panel-default
|
||||
.panel-heading
|
||||
%h3.panel-title= t(:general)
|
||||
.panel-body
|
||||
%dl.dl-horizontal
|
||||
%dt= t(:name)
|
||||
%dd= @domain.name
|
||||
|
||||
%dt= t(:registered_at)
|
||||
%dd= l(@domain.registered_at)
|
||||
|
||||
%dt= t(:registrar_name)
|
||||
%dd= link_to(@domain.registrar, admin_registrar_path(@domain.registrar))
|
||||
|
||||
%dt= t(:authinfo_pw)
|
||||
%dd
|
||||
= text_field_tag :password, @domain.auth_info, readonly: true, class: 'partially-hidden'
|
||||
|
||||
%dt= t(:valid_from)
|
||||
%dd= l(@domain.valid_from)
|
||||
|
||||
%dt= t(:valid_to)
|
||||
%dd= l(@domain.valid_to)
|
||||
|
||||
%dt= t('.outzone_time')
|
||||
%dd= l(@domain.outzone_at)
|
||||
|
||||
%dt= t('.delete_time')
|
||||
%dd= l(@domain.delete_at)
|
||||
|
||||
%dt= t('.force_delete_time')
|
||||
%dd= l(@domain.force_delete_at)
|
41
app/views/admin/domains/partials/_general.html.erb
Normal file
41
app/views/admin/domains/partials/_general.html.erb
Normal file
|
@ -0,0 +1,41 @@
|
|||
<div class="panel panel-default">
|
||||
<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><%= @domain.name %></dd>
|
||||
|
||||
<dt><%= t(:registered_at) %></dt>
|
||||
<dd><%= l(@domain.registered_at) %></dd>
|
||||
|
||||
<dt><%= t(:registrar_name) %></dt>
|
||||
<dd><%= link_to(@domain.registrar, admin_registrar_path(@domain.registrar)) %></dd>
|
||||
|
||||
<dt><%= Domain.human_attribute_name :transfer_code %></dt>
|
||||
<dd>
|
||||
<%= tag :input, type: 'text', value: @domain.transfer_code, readonly: true,
|
||||
class: 'form-control input-sm' %>
|
||||
</dd>
|
||||
|
||||
<dt><%= t(:valid_from) %></dt>
|
||||
<dd><%= l(@domain.valid_from) %></dd>
|
||||
|
||||
<dt><%= t(:valid_to) %></dt>
|
||||
<dd><%= l(@domain.valid_to) %></dd>
|
||||
|
||||
<dt><%= t('.outzone_time') %></dt>
|
||||
<dd><%= l(@domain.outzone_at) %></dd>
|
||||
|
||||
<dt><%= t('.delete_time') %></dt>
|
||||
<dd><%= l(@domain.delete_at) %></dd>
|
||||
|
||||
<dt><%= t('.force_delete_time') %></dt>
|
||||
<dd><%= l(@domain.force_delete_at) %></dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
|
@ -33,7 +33,7 @@
|
|||
|
||||
%td
|
||||
%p.nowrap
|
||||
= l(domain.updated_at, format: :shorts)
|
||||
= l domain.updated_at
|
||||
-#- if statuses_link
|
||||
%br= link_to t(:edit_statuses), edit_admin_domain_path(params[:domain_id])
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ xml.epp_head do
|
|||
|
||||
if can? :view_password, @domain, @password
|
||||
xml.tag!('domain:authInfo') do
|
||||
xml.tag!('domain:pw', @domain.auth_info)
|
||||
xml.tag!('domain:pw', @domain.transfer_code)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
builder.tag!('domain:trnData', 'xmlns:domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd') do
|
||||
builder.tag!('domain:name', dt.domain_name)
|
||||
builder.tag!('domain:trStatus', dt.status)
|
||||
builder.tag!('domain:reID', dt.transfer_to.code)
|
||||
builder.tag!('domain:reID', dt.new_registrar.code)
|
||||
builder.tag!('domain:reDate', dt.transfer_requested_at.try(:iso8601))
|
||||
builder.tag!('domain:acID', dt.transfer_from.code)
|
||||
builder.tag!('domain:acID', dt.old_registrar.code)
|
||||
builder.tag!('domain:acDate', dt.transferred_at.try(:iso8601) || dt.wait_until.try(:iso8601))
|
||||
builder.tag!('domain:exDate', dt.domain_valid_to.try(:iso8601))
|
||||
end
|
||||
|
|
|
@ -2,17 +2,13 @@
|
|||
%html{lang: I18n.locale.to_s}
|
||||
%head
|
||||
%meta{charset: "utf-8"}/
|
||||
%meta{content: "IE=edge", "http-equiv" => "X-UA-Compatible"}/
|
||||
%meta{content: "width=device-width, initial-scale=1", name: "viewport"}/
|
||||
%meta{content: "Full stack top-level domain (TLD) management.", name: "description"}/
|
||||
%meta{content: "Gitlab LTD", name: "author"}/
|
||||
- if content_for? :head_title
|
||||
= yield :head_title
|
||||
- else
|
||||
%title= t(:registrant_head_title)
|
||||
= csrf_meta_tags
|
||||
= stylesheet_link_tag 'registrant-manifest', media: 'all', 'data-turbolinks-track' => true
|
||||
= javascript_include_tag 'registrant-manifest', 'data-turbolinks-track' => true
|
||||
= stylesheet_link_tag 'registrant-manifest', media: 'all'
|
||||
= favicon_link_tag 'favicon.ico'
|
||||
%body
|
||||
/ Fixed navbar
|
||||
|
@ -49,9 +45,10 @@
|
|||
|
||||
%footer.footer
|
||||
.container
|
||||
%row
|
||||
.row
|
||||
.col-md-6
|
||||
= image_tag 'eis-logo-et.png'
|
||||
.col-md-6.text-right
|
||||
Version
|
||||
= CURRENT_COMMIT_HASH
|
||||
= javascript_include_tag 'registrant-manifest', async: true
|
||||
|
|
|
@ -1,44 +0,0 @@
|
|||
!!! 5
|
||||
%html{lang: I18n.locale.to_s}
|
||||
%head
|
||||
%meta{charset: "utf-8"}/
|
||||
%meta{content: "IE=edge", "http-equiv" => "X-UA-Compatible"}/
|
||||
%meta{content: "width=device-width, initial-scale=1", name: "viewport"}/
|
||||
- if content_for? :head_title
|
||||
= yield :head_title
|
||||
- else
|
||||
%title= t(:registrar_head_title)
|
||||
= csrf_meta_tags
|
||||
= stylesheet_link_tag 'registrar-manifest', media: 'all', 'data-turbolinks-track' => true
|
||||
= javascript_include_tag 'registrar-manifest', 'data-turbolinks-track' => true
|
||||
= favicon_link_tag 'favicon.ico'
|
||||
%body
|
||||
%nav.navbar.navbar-default.navbar-fixed-top
|
||||
.container
|
||||
.navbar-header
|
||||
%button.navbar-toggle.collapsed{"aria-controls" => "navbar", "aria-expanded" => "false", "data-target" => "#navbar", "data-toggle" => "collapse", :type => "button"}
|
||||
%span.sr-only Toggle navigation
|
||||
%span.icon-bar
|
||||
%span.icon-bar
|
||||
%span.icon-bar
|
||||
= link_to registrar_root_path, class: 'navbar-brand' do
|
||||
= t(:registrar_head_title)
|
||||
- if unstable_env.present?
|
||||
.text-center
|
||||
%small{style: 'color: #0074B3;'}= unstable_env
|
||||
= render 'navbar'
|
||||
|
||||
.container
|
||||
= render 'shared/flash'
|
||||
- if depp_controller?
|
||||
= render 'registrar/shared/epp_results'
|
||||
= yield
|
||||
|
||||
%footer.footer
|
||||
.container
|
||||
.row
|
||||
.col-md-6
|
||||
= image_tag 'eis-logo-et.png'
|
||||
.col-md-6.text-right
|
||||
Version
|
||||
= CURRENT_COMMIT_HASH
|
63
app/views/layouts/registrar/base.html.erb
Normal file
63
app/views/layouts/registrar/base.html.erb
Normal file
|
@ -0,0 +1,63 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="<%= I18n.locale.to_s %>">
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<meta content="width=device-width, initial-scale=1" name="viewport"/>
|
||||
<% if content_for? :head_title %>
|
||||
<%= yield :head_title %>
|
||||
<% else %>
|
||||
<title>
|
||||
<%= t(:registrar_head_title) %>
|
||||
</title>
|
||||
<% end %>
|
||||
<%= csrf_meta_tags %>
|
||||
<%= stylesheet_link_tag 'registrar-manifest', media: 'all' %>
|
||||
<%= favicon_link_tag 'favicon.ico' %>
|
||||
</head>
|
||||
<body>
|
||||
<nav class="navbar navbar-default navbar-fixed-top">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button aria-controls="navbar" aria-expanded="false" class="navbar-toggle collapsed" data-target="#navbar" data-toggle="collapse" type="button">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<%= link_to registrar_root_path, class: 'navbar-brand' do %>
|
||||
<%= t(:registrar_head_title) %>
|
||||
<% if unstable_env.present? %>
|
||||
<div class="text-center">
|
||||
<small style="color: #0074B3;">
|
||||
<%= unstable_env %>
|
||||
</small>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<%= render 'navbar' %>
|
||||
</div>
|
||||
</nav>
|
||||
<div class="container">
|
||||
<%= render 'shared/flash' %>
|
||||
<% if depp_controller? %>
|
||||
<%= render 'registrar/shared/epp_results' %>
|
||||
<% end %>
|
||||
<%= yield %>
|
||||
</div>
|
||||
<footer class="footer">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<%= image_tag 'eis-logo-et.png' %>
|
||||
</div>
|
||||
<div class="col-md-6 text-right">
|
||||
Version
|
||||
<%= CURRENT_COMMIT_HASH %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
<%= javascript_include_tag 'registrar-manifest', async: true %>
|
||||
</body>
|
||||
</html>
|
6
app/views/registrant/domains/_domain.html.erb
Normal file
6
app/views/registrant/domains/_domain.html.erb
Normal file
|
@ -0,0 +1,6 @@
|
|||
<tr>
|
||||
<td><%= link_to domain, registrant_domain_path(domain) %></td>
|
||||
<td><%= link_to domain.registrant.name, registrant_contact_path(domain.registrant) %></td>
|
||||
<td><%= l domain.expire_time %></td>
|
||||
<td><%= link_to domain.registrar, registrant_registrar_path(domain.registrar) %></td>
|
||||
</tr>
|
|
@ -1,84 +0,0 @@
|
|||
= render 'shared/title', name: t(:domains)
|
||||
|
||||
.row
|
||||
.col-md-12
|
||||
= search_form_for [:registrant, @q], html: { style: 'margin-bottom: 0;', class: 'js-form', autocomplete: 'off' } do |f|
|
||||
.row
|
||||
.col-md-3
|
||||
.form-group
|
||||
= f.label :name
|
||||
= f.search_field :name_matches, value: params[:q][:name_matches], class: 'form-control', placeholder: t(:name)
|
||||
.col-md-3
|
||||
.form-group
|
||||
= f.label t(:registrant_ident)
|
||||
= f.search_field :registrant_ident_eq, class: 'form-control', placeholder: t(:registrant_ident)
|
||||
.row
|
||||
.col-md-3
|
||||
.form-group
|
||||
= f.label t(:valid_to_from)
|
||||
= f.search_field :valid_to_gteq, value: params[:q][:valid_to_gteq], class: 'form-control js-datepicker', placeholder: t(:valid_to_from)
|
||||
.col-md-3
|
||||
.form-group
|
||||
= f.label t(:valid_to_until)
|
||||
= f.search_field :valid_to_lteq, value: params[:q][:valid_to_lteq], class: 'form-control js-datepicker', placeholder: t(:valid_to_until)
|
||||
.col-md-3
|
||||
.form-group
|
||||
= label_tag t(:results_per_page)
|
||||
= text_field_tag :results_per_page, params[:results_per_page], class: 'form-control', placeholder: t(:results_per_page)
|
||||
.col-md-3{style: 'padding-top: 25px;'}
|
||||
%button.btn.btn-primary
|
||||
|
||||
%span.glyphicon.glyphicon-search
|
||||
|
||||
%button.btn.btn-default.js-reset-form
|
||||
= t(:clear_fields)
|
||||
.row
|
||||
.col-md-3
|
||||
.btn-group{:role => "group"}
|
||||
%button.btn.btn-default.dropdown-toggle{"aria-expanded" => "false", "aria-haspopup" => "true", "data-toggle" => "dropdown", :type => "button"}
|
||||
Download
|
||||
%span.caret
|
||||
%ul.dropdown-menu
|
||||
%li= link_to 'PDF', download_list_registrant_domains_path(q: params[:q], format: "pdf")
|
||||
%li= link_to 'CSV', download_list_registrant_domains_path(q: params[:q], format: "csv")
|
||||
.col-md-3
|
||||
.col-md-3
|
||||
.col-md-3
|
||||
|
||||
|
||||
|
||||
%hr
|
||||
.row
|
||||
.col-md-12
|
||||
.table-responsive
|
||||
%table.table.table-hover.table-bordered.table-condensed
|
||||
%thead
|
||||
%tr
|
||||
%th{class: 'col-xs-2'}
|
||||
= sort_link(@q, 'name')
|
||||
%th{class: 'col-xs-2'}
|
||||
= sort_link(@q, 'registrant_name', t('.registrant'))
|
||||
%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_name))
|
||||
%tbody
|
||||
- @domains.each do |x|
|
||||
%tr
|
||||
%td= link_to(x, registrant_domain_path(x))
|
||||
%td= link_to(x.registrant.name, registrant_contact_path(x.registrant)) if x.registrant
|
||||
%td= l(x.valid_to, format: :short)
|
||||
%td= link_to(x.registrar, registrant_registrar_path(x.registrar)) if x.registrar
|
||||
|
||||
.row
|
||||
.col-md-6
|
||||
= paginate @domains
|
||||
.col-md-6.text-right
|
||||
.pagination
|
||||
= t(:result_count, count: @domains.total_count)
|
||||
|
||||
:coffee
|
||||
$(".js-reset-form").on "click", (e) ->
|
||||
e.preventDefault();
|
||||
window.location = "#{registrant_domains_path}"
|
||||
|
111
app/views/registrant/domains/index.html.erb
Normal file
111
app/views/registrant/domains/index.html.erb
Normal file
|
@ -0,0 +1,111 @@
|
|||
<div class="page-header">
|
||||
<h1><%= t '.header' %></h1>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<%= search_form_for [:registrant, @q], html: { class: 'search-form', autocomplete: 'off' } do |f| %>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<%= f.label :name, for: nil %>
|
||||
<%= f.search_field :name_matches, value: params[:q][:name_matches], class: 'form-control', placeholder: t(:name) %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<%= f.label t(:registrant_ident), for: nil %>
|
||||
<%= f.search_field :registrant_ident_eq, class: 'form-control', placeholder: t(:registrant_ident) %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<%= f.label t(:valid_to_from), for: nil %>
|
||||
<%= f.search_field :valid_to_gteq, value: params[:q][:valid_to_gteq], class: 'form-control js-datepicker', placeholder: t(:valid_to_from) %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<%= f.label t(:valid_to_until), for: nil %>
|
||||
<%= f.search_field :valid_to_lteq, value: params[:q][:valid_to_lteq], class: 'form-control js-datepicker', placeholder: t(:valid_to_until) %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<%= label_tag t(:results_per_page) %>
|
||||
<%= text_field_tag :results_per_page, params[:results_per_page], class: 'form-control', placeholder: t(:results_per_page) %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3 actions">
|
||||
<button class="btn btn-primary">
|
||||
|
||||
<span class="glyphicon glyphicon-search"></span>
|
||||
|
||||
</button>
|
||||
<%= link_to(t('.reset_btn'), registrant_domains_path, class: 'btn btn-default') %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="btn-group" role="group">
|
||||
<button aria-expanded="false" aria-haspopup="true" class="btn btn-default dropdown-toggle" data-toggle="dropdown" type="button">
|
||||
Download
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
<li>
|
||||
<%= link_to 'PDF', download_list_registrant_domains_path(q: params[:q], format: "pdf") %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to 'CSV', download_list_registrant_domains_path(q: params[:q], format: "csv") %>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3"></div>
|
||||
<div class="col-md-3"></div>
|
||||
<div class="col-md-3"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<hr/>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover table-bordered table-condensed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-xs-2">
|
||||
<%= sort_link(@q, 'name') %>
|
||||
</th>
|
||||
<th class="col-xs-2">
|
||||
<%= sort_link(@q, 'registrant_name', t('.registrant')) %>
|
||||
</th>
|
||||
<th class="col-xs-2">
|
||||
<%= sort_link(@q, 'valid_to', t(:valid_to)) %>
|
||||
</th>
|
||||
<th class="col-xs-2">
|
||||
<%= sort_link(@q, 'registrar_name', t(:registrar_name)) %>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<%= render @domains %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<%= paginate @domains %>
|
||||
</div>
|
||||
<div class="col-md-6 text-right">
|
||||
<div class="pagination">
|
||||
<%= t(:result_count, count: @domains.total_count) %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -1,32 +0,0 @@
|
|||
.panel.panel-default
|
||||
.panel-heading
|
||||
%h3.panel-title= t(:general)
|
||||
.panel-body
|
||||
%dl.dl-horizontal
|
||||
%dt= t(:name)
|
||||
%dd= @domain.name
|
||||
|
||||
%dt= t(:registered_at)
|
||||
%dd= l(@domain.registered_at)
|
||||
|
||||
%dt= t(:registrar_name)
|
||||
%dd= link_to(@domain.registrar, registrant_registrar_path(@domain.registrar))
|
||||
|
||||
%dt= t(:authinfo_pw)
|
||||
%dd
|
||||
= text_field_tag :password, @domain.auth_info, readonly: true, class: 'partially-hidden'
|
||||
|
||||
%dt= t(:valid_from)
|
||||
%dd= l(@domain.valid_from)
|
||||
|
||||
%dt= t(:valid_to)
|
||||
%dd= l(@domain.valid_to)
|
||||
|
||||
%dt= t(:outzone_at)
|
||||
%dd= l(@domain.outzone_at)
|
||||
|
||||
%dt= t(:delete_at)
|
||||
%dd= l(@domain.delete_at)
|
||||
|
||||
%dt= t(:force_delete_at)
|
||||
%dd= l(@domain.force_delete_at)
|
41
app/views/registrant/domains/partials/_general.html.erb
Normal file
41
app/views/registrant/domains/partials/_general.html.erb
Normal file
|
@ -0,0 +1,41 @@
|
|||
<div class="panel panel-default">
|
||||
<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><%= @domain.name %></dd>
|
||||
|
||||
<dt><%= t(:registered_at) %></dt>
|
||||
<dd><%= l(@domain.registered_at) %></dd>
|
||||
|
||||
<dt><%= t(:registrar_name) %></dt>
|
||||
<dd><%= link_to(@domain.registrar, registrant_registrar_path(@domain.registrar)) %></dd>
|
||||
|
||||
<dt><%= Domain.human_attribute_name :transfer_code %></dt>
|
||||
<dd>
|
||||
<%= tag :input, type: 'text', value: @domain.transfer_code, readonly: true,
|
||||
class: 'form-control input-sm' %>
|
||||
</dd>
|
||||
|
||||
<dt><%= t(:valid_from) %></dt>
|
||||
<dd><%= l(@domain.valid_from) %></dd>
|
||||
|
||||
<dt><%= t(:valid_to) %></dt>
|
||||
<dd><%= l(@domain.valid_to) %></dd>
|
||||
|
||||
<dt><%= t(:outzone_at) %></dt>
|
||||
<dd><%= l(@domain.outzone_at) %></dd>
|
||||
|
||||
<dt><%= t(:delete_at) %></dt>
|
||||
<dd><%= l(@domain.delete_at) %></dd>
|
||||
|
||||
<dt><%= t(:force_delete_at) %></dt>
|
||||
<dd><%= l(@domain.force_delete_at) %></dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
|
@ -1,17 +0,0 @@
|
|||
= render 'shared/title', name: @domain.name
|
||||
|
||||
.row
|
||||
.col-md-6= render 'registrant/domains/partials/general'
|
||||
.col-md-6= render 'registrant/domains/partials/owner'
|
||||
.row
|
||||
.col-md-12= render 'registrant/domains/partials/tech_contacts'
|
||||
.row
|
||||
.col-md-12= render 'registrant/domains/partials/admin_contacts'
|
||||
.row
|
||||
.col-md-12= render 'registrant/domains/partials/statuses'
|
||||
.row
|
||||
.col-md-12= render 'registrant/domains/partials/nameservers'
|
||||
.row
|
||||
.col-md-12= render 'registrant/domains/partials/dnskeys'
|
||||
.row
|
||||
.col-md-12= render 'registrant/domains/partials/keyrelays'
|
46
app/views/registrant/domains/show.html.erb
Normal file
46
app/views/registrant/domains/show.html.erb
Normal file
|
@ -0,0 +1,46 @@
|
|||
<%= render 'shared/title', name: @domain.name %>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<%= render 'registrant/domains/partials/general' %>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<%= render 'registrant/domains/partials/owner' %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<%= render 'registrant/domains/partials/tech_contacts' %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<%= render 'registrant/domains/partials/admin_contacts' %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<%= render 'registrant/domains/partials/statuses' %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<%= render 'registrant/domains/partials/nameservers' %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<%= render 'registrant/domains/partials/dnskeys' %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<%= render 'registrant/domains/partials/keyrelays' %>
|
||||
</div>
|
||||
</div>
|
|
@ -12,7 +12,8 @@
|
|||
%div.text-center
|
||||
00007, 60000007, 00000766
|
||||
|
||||
:coffee
|
||||
:coffee
|
||||
load_listener = ->
|
||||
$('.js-login').attr('disabled', false)
|
||||
|
||||
status_interval = null
|
||||
|
@ -37,4 +38,4 @@
|
|||
flash_alert(data.responseJSON.message)
|
||||
$('.js-login').attr('disabled', false)
|
||||
)
|
||||
|
||||
window.addEventListener 'load', load_listener
|
||||
|
|
|
@ -30,8 +30,7 @@
|
|||
|
||||
%span.glyphicon.glyphicon-search
|
||||
|
||||
%button.btn.btn-default.js-reset-form
|
||||
= t(:clear_fields)
|
||||
= link_to(t('.reset_btn'), registrar_account_activities_path, class: 'btn btn-default')
|
||||
%hr
|
||||
|
||||
.row
|
||||
|
@ -60,8 +59,3 @@
|
|||
.row
|
||||
.col-md-12
|
||||
= paginate @account_activities
|
||||
|
||||
:coffee
|
||||
$(".js-reset-form").on "click", (e) ->
|
||||
e.preventDefault();
|
||||
window.location = "#{registrar_account_activities_path}"
|
||||
|
|
|
@ -66,8 +66,7 @@
|
|||
|
||||
%span.glyphicon.glyphicon-search
|
||||
|
||||
%button.btn.btn-default.js-reset-form
|
||||
= t(:clear_fields)
|
||||
= link_to(t('.reset_btn'), registrar_contacts_path, class: 'btn btn-default')
|
||||
.row
|
||||
.col-md-3
|
||||
.btn-group{:role => "group"}
|
||||
|
@ -119,8 +118,3 @@
|
|||
.col-md-6.text-right
|
||||
.pagination
|
||||
= t(:result_count, count: @contacts.total_count)
|
||||
|
||||
:coffee
|
||||
$(".js-reset-form").on "click", (e) ->
|
||||
e.preventDefault();
|
||||
window.location = "#{registrar_contacts_path}"
|
||||
|
|
27
app/views/registrar/domain_transfers/create.html.erb
Normal file
27
app/views/registrar/domain_transfers/create.html.erb
Normal file
|
@ -0,0 +1,27 @@
|
|||
<div class="page-header">
|
||||
<h1><%= t '.header' %></h1>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">
|
||||
<%= t(:result) %>
|
||||
</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<dl class="dl-horizontal">
|
||||
<dt><%= t(:domain_name) %></dt>
|
||||
<dd><%= @data.css('name').text %></dd>
|
||||
|
||||
<% @data.css('trnData').children.each do |x| %>
|
||||
<% next if x.blank? %>
|
||||
<dt><%= t(x.name) %></dt>
|
||||
<dd><%= x.text %></dd>
|
||||
<% end %>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,9 @@
|
|||
<% if @api_errors %>
|
||||
<div class="alert alert-danger">
|
||||
<ul>
|
||||
<% @api_errors.each do |error| %>
|
||||
<li><%= error[:title] %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
19
app/views/registrar/domain_transfers/form/_batch.html.erb
Normal file
19
app/views/registrar/domain_transfers/form/_batch.html.erb
Normal file
|
@ -0,0 +1,19 @@
|
|||
<%= form_tag registrar_domain_transfers_path, multipart: true, class: 'form-horizontal' do %>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3 control-label">
|
||||
<%= label_tag :batch_file %>
|
||||
</div>
|
||||
<div class="col-md-7">
|
||||
<%= file_field_tag :batch_file, required: true %>
|
||||
<span class="help-block"><%= t '.batch_file_help' %></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-md-10 text-right">
|
||||
<button class="btn btn-warning">
|
||||
<%= t '.transfer_btn' %>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
37
app/views/registrar/domain_transfers/form/_single.html.erb
Normal file
37
app/views/registrar/domain_transfers/form/_single.html.erb
Normal file
|
@ -0,0 +1,37 @@
|
|||
<%= form_tag registrar_domain_transfers_path, multipart: true, class: 'form-horizontal' do %>
|
||||
<div class="form-group">
|
||||
<div class="col-md-3 control-label">
|
||||
<%= label_tag :domain_name, nil, class: 'required' %>
|
||||
</div>
|
||||
<div class="col-md-7">
|
||||
<%= text_field_tag :domain_name, params[:domain_name], autofocus: true, required: true,
|
||||
class: 'form-control' %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-md-3 control-label">
|
||||
<%= label_tag :transfer_code, nil, class: 'required' %>
|
||||
</div>
|
||||
<div class="col-md-7">
|
||||
<%= text_field_tag :transfer_code, params[:transfer_code], class: 'form-control', required: true %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-md-3 control-label">
|
||||
<%= label_tag 'legal_document', t(:legal_document) %>
|
||||
</div>
|
||||
<div class="col-md-7">
|
||||
<%= file_field_tag 'legal_document' %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-md-10 text-right">
|
||||
<button class="btn btn-warning">
|
||||
<%= t '.transfer_btn' %>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
29
app/views/registrar/domain_transfers/new.html.erb
Normal file
29
app/views/registrar/domain_transfers/new.html.erb
Normal file
|
@ -0,0 +1,29 @@
|
|||
<div class="page-header">
|
||||
<h1><%= t '.header' %></h1>
|
||||
</div>
|
||||
|
||||
<%= render 'registrar/domain_transfers/form/api_errors' %>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active">
|
||||
<a href="#single" data-toggle="tab"><%= t '.single' %></a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="#batch" data-toggle="tab"><%= t '.batch' %></a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active" id="single">
|
||||
<%= render 'registrar/domain_transfers/form/single' %>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane" id="batch">
|
||||
<%= render 'registrar/domain_transfers/form/batch' %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
13
app/views/registrar/domains/_domain.html.erb
Normal file
13
app/views/registrar/domains/_domain.html.erb
Normal file
|
@ -0,0 +1,13 @@
|
|||
<tr>
|
||||
<td><%= link_to truncate(domain.name), info_registrar_domains_path(domain_name: domain.name) %></td>
|
||||
<td><%= link_to domain.registrant, registrar_contact_path(id: domain.registrant.code) %></td>
|
||||
<td><%= l domain.expire_time %></td>
|
||||
<td>
|
||||
<%= link_to t('.edit_btn'), edit_registrar_domains_path(domain_name: domain.name),
|
||||
class: 'btn btn-primary btn-xs' %>
|
||||
<%= link_to t('.renew_btn'), renew_registrar_domains_path(domain_name: domain.name),
|
||||
class: 'btn btn-default btn-xs' %>
|
||||
<%= link_to t('.delete_btn'), delete_registrar_domains_path(domain_name: domain.name),
|
||||
class: 'btn btn-default btn-xs' %>
|
||||
</td>
|
||||
</tr>
|
88
app/views/registrar/domains/_search_form.html.erb
Normal file
88
app/views/registrar/domains/_search_form.html.erb
Normal file
|
@ -0,0 +1,88 @@
|
|||
<%= search_form_for [:registrar, @q], html: { class: 'search-form', autocomplete: 'off' } do |f| %>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<%= f.label :name, for: nil %>
|
||||
<%= f.search_field :name_matches, value: params[:q][:name_matches], class: 'form-control',
|
||||
placeholder: t(:name) %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<%= f.label :registrant_ident, for: nil %>
|
||||
<%= f.search_field :registrant_ident_eq, class: 'form-control', placeholder: t(:registrant_ident) %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<%= f.label :contact_ident, for: nil %>
|
||||
<%= f.search_field :contacts_ident_eq, class: 'form-control', placeholder: t(:contact_ident) %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<%= f.label :nameserver_hostname, for: nil %>
|
||||
<%= f.search_field :nameservers_hostname_eq, class: 'form-control',
|
||||
placeholder: t(:nameserver_hostname) %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<%= label_tag :status, nil, for: nil %>
|
||||
<%= select_tag :statuses_contains,
|
||||
options_for_select(DomainStatus::STATUSES, params[:statuses_contains]),
|
||||
{ multiple: true, class: 'form-control js-combobox' } %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<%= f.label :valid_to_from, for: nil %>
|
||||
<%= f.search_field :valid_to_gteq, value: params[:q][:valid_to_gteq],
|
||||
class: 'form-control js-datepicker',
|
||||
placeholder: t(:valid_to_from) %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<%= f.label :valid_to_until, for: nil %>
|
||||
<%= f.search_field :valid_to_lteq, value: params[:q][:valid_to_lteq],
|
||||
class: 'form-control js-datepicker',
|
||||
placeholder: t(:valid_to_until) %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
<%= label_tag :results_per_page, nil, for: nil %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<%= text_field_tag :results_per_page, params[:results_per_page], class: 'form-control',
|
||||
placeholder: t(:results_per_page) %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-offset-6 col-md-4 text-right">
|
||||
<button class="btn btn-primary search">
|
||||
|
||||
<span class="glyphicon glyphicon-search"></span>
|
||||
|
||||
</button>
|
||||
<%= button_tag t('.download_btn'), class: 'btn btn-primary export-domains-csv-btn',
|
||||
formaction: registrar_domains_path(format: 'csv') %>
|
||||
<%= link_to t('.reset_btn'), registrar_domains_path, class: 'btn btn-default' %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
|
@ -22,21 +22,23 @@
|
|||
= text_field_tag "domain[contacts_attributes][#{k}][code_helper]", contacts.find_by(code: v['code']).try(:search_name), class: 'form-control', data: {autocomplete: search_contacts_registrar_domains_path}, required: true
|
||||
|
||||
:coffee
|
||||
clone = $('.js-contact:first').clone()
|
||||
$("#js-domain-contacts").nestedAttributes
|
||||
bindAddTo: $(".add-domain-contact")
|
||||
afterAdd: (item) ->
|
||||
# preselect type
|
||||
item.find('select.js-contact-type').each (k, v) ->
|
||||
$(v).val($(v).find('option:last-child').val())
|
||||
# add combobex
|
||||
item.find('select.js-contact-code').each (k, v) ->
|
||||
$(v).select2
|
||||
width: "100%"
|
||||
selectOnBlur: true
|
||||
dropdownAutoWidth: if self==top then true else false
|
||||
# remove link for temp
|
||||
item.find('a.add-domain-contact').each (k, v) ->
|
||||
$(v).hide()
|
||||
new Autocomplete()
|
||||
$clone: clone
|
||||
load_listener = ->
|
||||
clone = $('.js-contact:first').clone()
|
||||
$("#js-domain-contacts").nestedAttributes
|
||||
bindAddTo: $(".add-domain-contact")
|
||||
afterAdd: (item) ->
|
||||
# preselect type
|
||||
item.find('select.js-contact-type').each (k, v) ->
|
||||
$(v).val($(v).find('option:last-child').val())
|
||||
# add combobex
|
||||
item.find('select.js-contact-code').each (k, v) ->
|
||||
$(v).select2
|
||||
width: "100%"
|
||||
selectOnBlur: true
|
||||
dropdownAutoWidth: if self==top then true else false
|
||||
# remove link for temp
|
||||
item.find('a.add-domain-contact').each (k, v) ->
|
||||
$(v).hide()
|
||||
new Autocomplete()
|
||||
$clone: clone
|
||||
window.addEventListener 'load', load_listener
|
||||
|
|
|
@ -68,10 +68,10 @@
|
|||
class: 'form-control'
|
||||
|
||||
:coffee
|
||||
$("#dnskeys").nestedAttributes
|
||||
bindAddTo: $(".add-dnskey")
|
||||
afterAdd: (item) ->
|
||||
item.find('select').each (k, v) ->
|
||||
$(v).val($(v).find('option:first-child').val())
|
||||
|
||||
|
||||
load_listener = ->
|
||||
$("#dnskeys").nestedAttributes
|
||||
bindAddTo: $(".add-dnskey")
|
||||
afterAdd: (item) ->
|
||||
item.find('select').each (k, v) ->
|
||||
$(v).val($(v).find('option:first-child').val())
|
||||
window.addEventListener 'load', load_listener
|
||||
|
|
|
@ -27,5 +27,7 @@
|
|||
= text_field_tag "domain[nameservers_attributes][#{k}][ipv6]", v['ipv6'],
|
||||
class: 'form-control'#, ipv6: true
|
||||
:coffee
|
||||
$("#nameservers").nestedAttributes
|
||||
bindAddTo: $(".add-nameserver")
|
||||
load_listener = ->
|
||||
$("#nameservers").nestedAttributes
|
||||
bindAddTo: $(".add-nameserver")
|
||||
window.addEventListener 'load', load_listener
|
||||
|
|
|
@ -1,99 +0,0 @@
|
|||
- content_for :actions do
|
||||
= link_to(t(:new), new_registrar_domain_path, class: 'btn btn-primary')
|
||||
= link_to(t(:transfer), transfer_registrar_domains_path, class: 'btn btn-default')
|
||||
-# turned off requested by client
|
||||
-# = link_to(t(:keyrelay), registrar_keyrelay_path, class: 'btn btn-default')
|
||||
-# = link_to(t(:nameservers), registrar_nameservers_path, class: 'btn btn-default')
|
||||
= render 'shared/title', name: t(:domains)
|
||||
|
||||
.row
|
||||
.col-md-12
|
||||
= search_form_for [:registrar, @q], html: { style: 'margin-bottom: 0;', class: 'js-form', autocomplete: 'off' } do |f|
|
||||
.row
|
||||
.col-md-3
|
||||
.form-group
|
||||
= f.label :name
|
||||
= f.search_field :name_matches, value: params[:q][:name_matches], class: 'form-control', placeholder: t(:name)
|
||||
.col-md-3
|
||||
.form-group
|
||||
= f.label t(:registrant_ident)
|
||||
= f.search_field :registrant_ident_eq, class: 'form-control', placeholder: t(:registrant_ident)
|
||||
.col-md-3
|
||||
.form-group
|
||||
= f.label t(:contact_ident)
|
||||
= f.search_field :contacts_ident_eq, class: 'form-control', placeholder: t(:contact_ident)
|
||||
.col-md-3
|
||||
.form-group
|
||||
= f.label t(:nameserver_hostname)
|
||||
= f.search_field :nameservers_hostname_eq, class: 'form-control', placeholder: t(:nameserver_hostname)
|
||||
.row
|
||||
.col-md-6
|
||||
.form-group
|
||||
= label_tag t(:status)
|
||||
= select_tag :statuses_contains, options_for_select(DomainStatus::STATUSES, params[:statuses_contains]), { multiple: true, placeholder: t(:choose), class: 'form-control js-combobox' }
|
||||
.col-md-3
|
||||
.form-group
|
||||
= f.label t(:valid_to_from)
|
||||
= f.search_field :valid_to_gteq, value: params[:q][:valid_to_gteq], class: 'form-control js-datepicker', placeholder: t(:valid_to_from)
|
||||
.col-md-3
|
||||
.form-group
|
||||
= f.label t(:valid_to_until)
|
||||
= f.search_field :valid_to_lteq, value: params[:q][:valid_to_lteq], class: 'form-control js-datepicker', placeholder: t(:valid_to_until)
|
||||
.row
|
||||
.col-md-6
|
||||
.col-md-3
|
||||
.form-group
|
||||
= label_tag t(:results_per_page)
|
||||
= text_field_tag :results_per_page, params[:results_per_page], class: 'form-control', placeholder: t(:results_per_page)
|
||||
.col-md-3{style: 'padding-top: 25px;'}
|
||||
%button.btn.btn-primary.search
|
||||
|
||||
%span.glyphicon.glyphicon-search
|
||||
|
||||
%button.btn.btn-default.js-reset-form
|
||||
= t(:clear_fields)
|
||||
.row
|
||||
.col-md-2
|
||||
= button_tag t('.download_btn'), class: 'btn btn-primary export-domains-csv-btn',
|
||||
formaction: registrar_domains_path(format: 'csv')
|
||||
%hr
|
||||
|
||||
.row
|
||||
.col-md-12
|
||||
.table-responsive
|
||||
%table.table.table-hover.table-bordered.table-condensed
|
||||
%thead
|
||||
%tr
|
||||
%th{class: 'col-xs-2'}
|
||||
= sort_link(@q, 'name')
|
||||
%th{class: 'col-xs-2'}
|
||||
= sort_link(@q, 'registrant_name', t('.registrant'))
|
||||
%th{class: 'col-xs-2'}
|
||||
= sort_link(@q, 'valid_to', t(:valid_to))
|
||||
%th{class: 'col-xs-2'}= t('actions')
|
||||
%tbody
|
||||
- @domains.each do |x|
|
||||
%tr
|
||||
%td= link_to(truncate(x.name), info_registrar_domains_path(domain_name: x.name))
|
||||
%td
|
||||
- if x.registrant
|
||||
= link_to(x.registrant, registrar_contact_path(id: x.registrant.code))
|
||||
%td= l(x.valid_to, format: :date_long)
|
||||
%td
|
||||
= link_to(t(:edit), edit_registrar_domains_path(domain_name: x.name),
|
||||
class: 'btn btn-primary btn-xs')
|
||||
= link_to(t(:renew), renew_registrar_domains_path(domain_name: x.name),
|
||||
class: 'btn btn-default btn-xs')
|
||||
= link_to(t(:delete), delete_registrar_domains_path(domain_name: x.name),
|
||||
class: 'btn btn-default btn-xs')
|
||||
.row
|
||||
.col-md-6
|
||||
= paginate @domains
|
||||
.col-md-6.text-right
|
||||
.pagination
|
||||
= t(:result_count, count: @domains.total_count)
|
||||
|
||||
:coffee
|
||||
$(".js-reset-form").on "click", (e) ->
|
||||
e.preventDefault();
|
||||
window.location = "#{registrar_domains_path}"
|
57
app/views/registrar/domains/index.html.erb
Normal file
57
app/views/registrar/domains/index.html.erb
Normal file
|
@ -0,0 +1,57 @@
|
|||
<div class="page-header">
|
||||
<div class="row">
|
||||
<div class="col-sm-9">
|
||||
<h1><%= t '.header' %></h1>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-3 text-right">
|
||||
<%= link_to t('.new_btn'), new_registrar_domain_path, class: 'btn btn-primary' %>
|
||||
<%= link_to t('.transfer_btn'), new_registrar_domain_transfer_path, class: 'btn btn-default' %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<%= render 'search_form' %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover table-bordered table-condensed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-xs-2">
|
||||
<%= sort_link(@q, 'name') %>
|
||||
</th>
|
||||
<th class="col-xs-2">
|
||||
<%= sort_link @q, 'registrant_name', Registrant.model_name.human %>
|
||||
</th>
|
||||
<th class="col-xs-2">
|
||||
<%= sort_link @q, 'valid_to', Domain.human_attribute_name(:expire_time) %>
|
||||
</th>
|
||||
<th class="col-xs-2"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<%= render @domains %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<%= paginate @domains %>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 text-right">
|
||||
<div class="pagination">
|
||||
<%= t :result_count, count: @domains.total_count %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -1,30 +0,0 @@
|
|||
- content_for :actions do
|
||||
- if @data.css('pw').text.present?
|
||||
= link_to(t(:edit), edit_registrar_domains_path(domain_name: params[:domain_name]),
|
||||
class: 'btn btn-default')
|
||||
= link_to(t(:renew), renew_registrar_domains_path(domain_name: params[:domain_name]),
|
||||
class: 'btn btn-default')
|
||||
= link_to(t(:delete), delete_registrar_domains_path(domain_name: params[:domain_name]),
|
||||
class: 'btn btn-default')
|
||||
- else
|
||||
= link_to(t(:transfer), transfer_registrar_domains_path(domain_name: params[:domain_name]),
|
||||
class: 'btn btn-default')
|
||||
= render 'shared/title', name: truncate(@data.css('name').text)
|
||||
|
||||
.row
|
||||
.col-sm-12
|
||||
- if @data.css('result').first['code'] == '1000'
|
||||
.row
|
||||
.col-md-12= render 'registrar/domains/partials/general'
|
||||
.row
|
||||
.col-md-12= render 'registrar/domains/partials/contacts'
|
||||
.row
|
||||
.col-md-12= render 'registrar/domains/partials/statuses'
|
||||
.row
|
||||
.col-md-12= render 'registrar/domains/partials/nameservers'
|
||||
.row
|
||||
.col-md-12= render 'registrar/domains/partials/dnskeys'
|
||||
- else
|
||||
.row
|
||||
.col-sm-6
|
||||
%h1= t(:not_found)
|
53
app/views/registrar/domains/info.html.erb
Normal file
53
app/views/registrar/domains/info.html.erb
Normal file
|
@ -0,0 +1,53 @@
|
|||
<% content_for :actions do %>
|
||||
<% if @data.css('pw').text.present? %>
|
||||
<%= link_to(t(:edit), edit_registrar_domains_path(domain_name: params[:domain_name]),
|
||||
class: 'btn btn-default') %>
|
||||
<%= link_to(t(:renew), renew_registrar_domains_path(domain_name: params[:domain_name]),
|
||||
class: 'btn btn-default') %>
|
||||
<%= link_to(t(:delete), delete_registrar_domains_path(domain_name: params[:domain_name]),
|
||||
class: 'btn btn-default') %>
|
||||
<% else %>
|
||||
<%= link_to t('.transfer_btn'), new_registrar_domain_transfer_path(domain_name: params[:domain_name]),
|
||||
class: 'btn btn-default' %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<%= render 'shared/title', name: truncate(@data.css('name').text) %>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<% if @data.css('result').first['code'] == '1000' %>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<%= render 'registrar/domains/partials/general' %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<%= render 'registrar/domains/partials/contacts' %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<%= render 'registrar/domains/partials/statuses' %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<%= render 'registrar/domains/partials/nameservers' %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<%= render 'registrar/domains/partials/dnskeys' %>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<h1>
|
||||
<%= t(:not_found) %>
|
||||
</h1>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
|
@ -1,27 +0,0 @@
|
|||
.panel.panel-default
|
||||
.panel-heading
|
||||
%h3.panel-title= t(:general)
|
||||
.panel-body
|
||||
%dl.dl-horizontal
|
||||
%dt= t(:authinfo_pw)
|
||||
%dd= @data.css('pw').text.present? ? @data.css('pw').text : t('hidden')
|
||||
|
||||
- if @data.css('pw').text.blank?
|
||||
%dt= t(:registrar_name)
|
||||
%dd= @data.css('clID').text
|
||||
|
||||
- registrant = Contact.find_by_code(@data.css('registrant').text)
|
||||
%dt= t('.registrant')
|
||||
%dd= "#{registrant.name} (#{@data.css('registrant').text})"
|
||||
|
||||
%dt= t('.registered')
|
||||
%dd= @data.css('crDate').text
|
||||
|
||||
%dt= t(:valid_to)
|
||||
%dd= @data.css('exDate').text
|
||||
|
||||
%dt= t('.created')
|
||||
%dd= @data.css('crDate').text
|
||||
|
||||
%dt= t('.updated')
|
||||
%dd= @data.css('upDate').text
|
41
app/views/registrar/domains/partials/_general.html.erb
Normal file
41
app/views/registrar/domains/partials/_general.html.erb
Normal file
|
@ -0,0 +1,41 @@
|
|||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">
|
||||
<%= t(:general) %>
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div class="panel-body">
|
||||
<dl class="dl-horizontal">
|
||||
<dt><%= Domain.human_attribute_name :transfer_code %></dt>
|
||||
<dd>
|
||||
<% if @data.css('pw').text.present? %>
|
||||
<%= tag(:input, type: 'text', value: @data.css('pw').text, readonly: true,
|
||||
class: 'form-control input-sm') %>
|
||||
<% end %>
|
||||
</dd>
|
||||
|
||||
|
||||
<% if @data.css('pw').text.blank? %>
|
||||
<dt><%= t(:registrar_name) %></dt>
|
||||
<dd><%= @data.css('clID').text %></dd>
|
||||
<% end %>
|
||||
|
||||
<% registrant = Contact.find_by_code(@data.css('registrant').text) %>
|
||||
<dt><%= t('.registrant') %></dt>
|
||||
<dd><%= "#{registrant.name} (#{@data.css('registrant').text})" %></dd>
|
||||
|
||||
<dt><%= t('.registered') %></dt>
|
||||
<dd><%= @data.css('crDate').text %></dd>
|
||||
|
||||
<dt><%= t(:valid_to) %></dt>
|
||||
<dd><%= @data.css('exDate').text %></dd>
|
||||
|
||||
<dt><%= t('.created') %></dt>
|
||||
<dd><%= @data.css('crDate').text %></dd>
|
||||
|
||||
<dt><%= t('.updated') %></dt>
|
||||
<dd><%= @data.css('upDate').text %></dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
|
@ -1,16 +0,0 @@
|
|||
= render 'shared/title', name: t(:transfer_domain)
|
||||
|
||||
.row
|
||||
.col-md-12
|
||||
.panel.panel-default
|
||||
.panel-heading
|
||||
%h3.panel-title= t(:result)
|
||||
.panel-body
|
||||
%dl.dl-horizontal
|
||||
%dt= t(:domain_name)
|
||||
%dd= @data.css('name').text
|
||||
|
||||
- @data.css('trnData').children.each do |x|
|
||||
- next if x.blank?
|
||||
%dt= t(x.name)
|
||||
%dd= x.text
|
|
@ -1,27 +0,0 @@
|
|||
= render 'shared/title', name: t(:transfer_domain)
|
||||
|
||||
.row
|
||||
.col-md-8
|
||||
= form_tag transfer_registrar_domains_path, class: 'form-horizontal', method: :post, multipart: true, autocomplete: 'off' do
|
||||
.form-group
|
||||
.col-md-3.control-label
|
||||
= label_tag :domain_name, t(:name), class: 'required'
|
||||
.col-md-7
|
||||
= text_field_tag :domain_name, params[:domain_name], class: 'form-control',
|
||||
placeholder: t(:domain_name), autocomplete: 'off', autofocus: true, required: true
|
||||
.form-group
|
||||
.col-md-3.control-label
|
||||
= label_tag :password, t(:password), class: 'required'
|
||||
.col-md-7
|
||||
= text_field_tag :password, params[:password],
|
||||
class: 'form-control', autocomplete: 'off', required: true
|
||||
.form-group
|
||||
.col-md-3.control-label
|
||||
= label_tag 'legal_document', t(:legal_document)
|
||||
.col-md-7
|
||||
= file_field_tag 'legal_document'
|
||||
.form-group
|
||||
.col-md-10.text-right
|
||||
%button.btn.btn-warning{ name: 'request' }= t(:transfer)
|
||||
/%button.btn.btn-warning{ name: 'approve' }= t(:approve)
|
||||
/%button.btn.btn-warning{ name: 'reject' }= t(:reject)
|
|
@ -43,8 +43,7 @@
|
|||
|
||||
%span.glyphicon.glyphicon-search
|
||||
|
||||
%button.btn.btn-default.js-reset-form
|
||||
= t(:clear_fields)
|
||||
= link_to(t('.reset_btn'), registrar_invoices_path, class: 'btn btn-default')
|
||||
%hr
|
||||
.row
|
||||
.col-md-12
|
||||
|
@ -72,9 +71,3 @@
|
|||
.row
|
||||
.col-md-12
|
||||
= paginate @invoices
|
||||
|
||||
:coffee
|
||||
$(".js-reset-form").on "click", (e) ->
|
||||
e.preventDefault();
|
||||
window.location = "#{registrar_invoices_path}"
|
||||
|
||||
|
|
|
@ -6,5 +6,6 @@
|
|||
|
||||
|
||||
:coffeescript
|
||||
$(document).ready ->
|
||||
$('.payment-form form').submit()
|
||||
load_listener = ->
|
||||
$('.payment-form form').submit()
|
||||
window.addEventListener 'load', load_listener
|
||||
|
|
|
@ -82,8 +82,10 @@
|
|||
%p.bg-info{style: 'padding: 15px;'}= t(:you_have_no_new_messages)
|
||||
|
||||
:coffee
|
||||
$(".js-keyrelay-confirm").on "click", ->
|
||||
$(".js-keyrelay-form").submit()
|
||||
load_listener = ->
|
||||
$(".js-keyrelay-confirm").on "click", ->
|
||||
$(".js-keyrelay-form").submit()
|
||||
|
||||
$(".js-transfer-confirm").on "click", ->
|
||||
$(".js-transfer-form").submit()
|
||||
$(".js-transfer-confirm").on "click", ->
|
||||
$(".js-transfer-form").submit()
|
||||
window.addEventListener 'load', load_listener
|
||||
|
|
|
@ -12,7 +12,8 @@
|
|||
%div.text-center
|
||||
00007, 60000007, 00000766
|
||||
|
||||
:coffee
|
||||
:coffee
|
||||
load_listener = ->
|
||||
$('.js-login').attr('disabled', false)
|
||||
|
||||
status_interval = null
|
||||
|
@ -37,4 +38,4 @@
|
|||
flash_alert(data.responseJSON.message)
|
||||
$('.js-login').attr('disabled', false)
|
||||
)
|
||||
|
||||
window.addEventListener 'load', load_listener
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
- content_for :tabs do
|
||||
.container.subnav
|
||||
%ul.nav.nav-tabs.navbar-right
|
||||
%li{role: :presentation, class: active == :domains ? 'active' : ''}
|
||||
= link_to t(:all), registrar_domains_path
|
||||
%li{role: :presentation, class: active == :new ? 'active' : ''}
|
||||
= link_to t(:new), new_registrar_domain_path
|
||||
%li{role: :presentation, class: active == :check ? 'active' : ''}
|
||||
= link_to t(:check), check_registrar_domains_path
|
||||
%li{role: :presentation, class: active == :transfer ? 'active' : ''}
|
||||
= link_to t(:transfer), transfer_registrar_domains_path
|
||||
%li{role: :presentation, class: active == :keyrelay ? 'active' : ''}
|
||||
= link_to t(:keyrelay), registrar_keyrelay_path
|
|
@ -61,8 +61,10 @@
|
|||
= CodeRay.scan(@result.to_s.force_encoding("UTF-8"), :xml).div().html_safe
|
||||
|
||||
:javascript
|
||||
window.addEventListener('load',
|
||||
function(){
|
||||
$('.js-load-xml').click(function() {
|
||||
$.get('xml_console/load_xml', {obj: $(this).data('obj'), epp_action: $(this).data('epp-action')}, function(data) {
|
||||
$('textarea[name="payload"]').html(data);
|
||||
});
|
||||
});
|
||||
});});
|
||||
|
|
|
@ -2,9 +2,12 @@ en:
|
|||
admin:
|
||||
domains:
|
||||
index:
|
||||
reset_btn: Reset
|
||||
header: Domains
|
||||
registrant: Registrant
|
||||
|
||||
search_form:
|
||||
reset_btn: Reset
|
||||
|
||||
edit:
|
||||
add_new_status_btn: Add new status
|
||||
back_btn: Back to domain
|
||||
|
|
|
@ -22,10 +22,9 @@ en:
|
|||
longer: "%a, %e. %b %Y, %H:%M"
|
||||
long: "%A, %e. %B %Y, %H:%M"
|
||||
short: "%d.%m.%y, %H:%M"
|
||||
shorts: "%d.%m.%y, %H:%M:%S"
|
||||
date: "%Y-%m-%d"
|
||||
date_long: "%d. %B %Y"
|
||||
ydate: "%Y.%m.%d"
|
||||
filename: "%Y-%m-%d_%H.%M"
|
||||
date:
|
||||
formats:
|
||||
default: "%Y-%m-%d"
|
||||
|
@ -79,7 +78,7 @@ en:
|
|||
period:
|
||||
not_a_number: 'Period is not a number'
|
||||
not_an_integer: 'Period must be an integer'
|
||||
auth_info:
|
||||
transfer_code:
|
||||
wrong_pw: 'Authorization error'
|
||||
domain_statuses:
|
||||
invalid: 'Statuses are invalid'
|
||||
|
@ -97,11 +96,6 @@ en:
|
|||
domain:
|
||||
<<: *epp_domain_ar_attributes
|
||||
|
||||
domain_transfer:
|
||||
attributes:
|
||||
base:
|
||||
transfer_can_be_approved_only_by_current_registrar: 'Transfer can be approved only by current domain registrar'
|
||||
|
||||
nameserver:
|
||||
attributes:
|
||||
hostname:
|
||||
|
@ -326,32 +320,13 @@ en:
|
|||
starting_balance: 'Starting balance'
|
||||
destroyed: 'Destroyed'
|
||||
|
||||
domain_transfer_requested: 'Domain transfer requested!'
|
||||
domain_transfer_approved: 'Domain transfer approved!'
|
||||
failed_to_approve_domain_transfer: 'Failed to approve domain transfer'
|
||||
approve: 'Approve'
|
||||
domain_already_belongs_to_the_querying_registrar: 'Domain already belongs to the querying registrar'
|
||||
other_registrar_has_already_requested_to_transfer_this_domain: 'Other registrar has already requested to transfer this domain.'
|
||||
transfer_domain: 'Transfer domain'
|
||||
failed_to_request_domain_transfer: 'Failed to request domain transfer' #not used atm
|
||||
domain_transfer: 'Domain transfer'
|
||||
request_domain_transfer: 'Request domain transfer'
|
||||
domain_valid_to: 'Domain valid to'
|
||||
accept_time: 'Accept time'
|
||||
transfer_from: 'Transfer from'
|
||||
transferred_at: 'Transferred at'
|
||||
domain_transfers_list: 'Domain transfers list'
|
||||
domain_transfers: 'Domain transfers'
|
||||
|
||||
password_invalid: 'Password invalid!'
|
||||
domain_was_not_found: 'Domain was not found!'
|
||||
domain_list: 'Domain list'
|
||||
create_new_domain: 'Create new domain'
|
||||
welcome: 'Welcome!'
|
||||
edit_statuses: 'Edit statuses'
|
||||
contact_list: 'Contact list'
|
||||
create_new_contact: 'Create new contact'
|
||||
domain_pw: 'Domain password'
|
||||
history: 'History'
|
||||
|
||||
new_registrar: 'New registrar'
|
||||
|
@ -421,7 +396,6 @@ en:
|
|||
tech_contacts_min_count: 'Tech contacts minimum count'
|
||||
tech_contacts_max_count: 'Tech contacts maximum count'
|
||||
action_failed_due_to_server_error: 'Action failed due to server error'
|
||||
pending_transfer_was_not_found: 'Pending transfer was not found'
|
||||
transfer_can_be_rejected_only_by_current_registrar: 'Transfer can be rejected only by current registrar'
|
||||
request_command: 'Request command'
|
||||
request_object: 'Request object'
|
||||
|
@ -441,7 +415,6 @@ en:
|
|||
attribute_is_invalid: 'Attribute is invalid: %{attribute}'
|
||||
request_successful: 'Request successful'
|
||||
choose: 'Choose...'
|
||||
clear_fields: 'Clear fields'
|
||||
created_before: 'Created before'
|
||||
created_after: 'Created after'
|
||||
billing_address: 'Billing address'
|
||||
|
@ -500,12 +473,9 @@ en:
|
|||
blank: "Password can't be blank"
|
||||
|
||||
username: 'Username'
|
||||
password: 'Password'
|
||||
authinfo_pw: 'AuthInfo pw'
|
||||
log_in: 'Log in'
|
||||
domains: 'Domains'
|
||||
register: 'Register'
|
||||
check: 'Check'
|
||||
contacts: 'Contacts'
|
||||
domain_info: 'Domain info'
|
||||
domain_details: 'Domain details'
|
||||
|
@ -548,9 +518,7 @@ en:
|
|||
new: New
|
||||
renew_domain: 'Renew domain'
|
||||
cur_exp_date: 'curExpDate'
|
||||
transfer: 'Transfer'
|
||||
query: 'Query'
|
||||
transfer_domain: 'Transfer domain'
|
||||
reject: 'Reject'
|
||||
approve: 'Approve'
|
||||
contact_info: 'Contact info'
|
||||
|
@ -806,7 +774,6 @@ en:
|
|||
manage: Manage
|
||||
pending_epp: Pending epp
|
||||
id: ID
|
||||
hidden: '[hidden]'
|
||||
created_at_from: 'Created at from'
|
||||
created_at_until: 'Created at until'
|
||||
is_registrant: 'Is registrant'
|
||||
|
@ -817,9 +784,6 @@ en:
|
|||
contact_is_not_valid: 'Contact %{value} is not valid, please fix the invalid contact'
|
||||
welcome_to_eis_registrar_portal: 'Welcome to EIS Registrar portal'
|
||||
interfaces: 'Interfaces'
|
||||
list_format_is_in_yaml: 'List format is in YAML'
|
||||
if_auth_info_is_left_empty_it_will_be_auto_generated: 'If auth info is left empty, it will be auto generated.'
|
||||
each_domain_name_must_end_with_colon_sign: 'Each domain name must end with colon (:) sign.'
|
||||
next: 'Next'
|
||||
previous: 'Previous'
|
||||
personal_domain_verification_url: 'Personal domain verification url'
|
||||
|
|
|
@ -2,7 +2,9 @@ en:
|
|||
registrant:
|
||||
domains:
|
||||
index:
|
||||
header: Domains
|
||||
registrant: Registrant
|
||||
reset_btn: Reset
|
||||
|
||||
download_list:
|
||||
registrant: Registrant
|
||||
|
|
5
config/locales/registrar/account_activities.en.yml
Normal file
5
config/locales/registrar/account_activities.en.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
en:
|
||||
registrar:
|
||||
account_activities:
|
||||
index:
|
||||
reset_btn: Reset
|
|
@ -1,6 +1,9 @@
|
|||
en:
|
||||
registrar:
|
||||
contacts:
|
||||
index:
|
||||
reset_btn: Reset
|
||||
|
||||
partials:
|
||||
domains:
|
||||
roles: Roles
|
||||
|
|
19
config/locales/registrar/domain_transfers.en.yml
Normal file
19
config/locales/registrar/domain_transfers.en.yml
Normal file
|
@ -0,0 +1,19 @@
|
|||
en:
|
||||
registrar:
|
||||
domain_transfers:
|
||||
new:
|
||||
header: Domain transfer
|
||||
single: One by one
|
||||
batch: Batch
|
||||
|
||||
create:
|
||||
header: Domain transfer
|
||||
transferred: Domains have been successfully transferred
|
||||
|
||||
form:
|
||||
single:
|
||||
transfer_btn: Transfer
|
||||
|
||||
batch:
|
||||
batch_file_help: CSV file with domain list provided by another registrar
|
||||
transfer_btn: Transfer batch
|
|
@ -2,14 +2,28 @@ en:
|
|||
registrar:
|
||||
domains:
|
||||
index:
|
||||
registrant: Registrant
|
||||
download_btn: Download
|
||||
header: Domains
|
||||
new_btn: New domain
|
||||
transfer_btn: Transfer
|
||||
csv:
|
||||
domain_name: Domain
|
||||
transfer_code: Transfer code
|
||||
registrant_name: Registrant name
|
||||
registrant_code: Registrant code
|
||||
expire_time: Date of expiry
|
||||
|
||||
info:
|
||||
transfer_btn: Transfer
|
||||
|
||||
search_form:
|
||||
download_btn: Download as CSV
|
||||
reset_btn: Reset
|
||||
|
||||
domain:
|
||||
edit_btn: Edit
|
||||
renew_btn: Renew
|
||||
delete_btn: Delete
|
||||
|
||||
form:
|
||||
save_btn: Save
|
||||
dnskeys:
|
||||
|
|
5
config/locales/registrar/invoices.en.yml
Normal file
5
config/locales/registrar/invoices.en.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
en:
|
||||
registrar:
|
||||
invoices:
|
||||
index:
|
||||
reset_btn: Reset
|
|
@ -54,7 +54,6 @@ Rails.application.routes.draw do
|
|||
post 'update', as: 'update'
|
||||
post 'destroy', as: 'destroy'
|
||||
get 'renew'
|
||||
match 'transfer', via: [:post, :get]
|
||||
get 'edit'
|
||||
get 'info'
|
||||
get 'check'
|
||||
|
@ -62,6 +61,7 @@ Rails.application.routes.draw do
|
|||
get 'search_contacts'
|
||||
end
|
||||
end
|
||||
resources :domain_transfers, only: %i[new create]
|
||||
|
||||
resources :contacts, constraints: {:id => /[^\/]+(?=#{ ActionController::Renderers::RENDERERS.map{|e| "\\.#{e}\\z"}.join("|") })|[^\/]+/} do
|
||||
member do
|
||||
|
@ -99,7 +99,7 @@ Rails.application.routes.draw do
|
|||
namespace :registrant do
|
||||
root 'domains#index'
|
||||
|
||||
resources :domains do
|
||||
resources :domains, only: %i[index show] do
|
||||
collection do
|
||||
get :download_list
|
||||
end
|
||||
|
@ -107,7 +107,6 @@ Rails.application.routes.draw do
|
|||
member do
|
||||
get 'domain_verification_url'
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
# resources :invoices do
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
class RemoveDomainContactsContactType < ActiveRecord::Migration
|
||||
def change
|
||||
remove_column :domain_contacts, :contact_type, :string
|
||||
end
|
||||
end
|
|
@ -0,0 +1,5 @@
|
|||
class AddDomainContactsContactIdFk < ActiveRecord::Migration
|
||||
def change
|
||||
add_foreign_key :domain_contacts, :contacts, name: 'domain_contacts_contact_id_fk'
|
||||
end
|
||||
end
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue