mirror of
https://github.com/internetee/registry.git
synced 2025-07-25 12:08:27 +02:00
Merge branch 'master' into registry-791
This commit is contained in:
commit
36b137eb84
129 changed files with 2226 additions and 3275 deletions
|
@ -59,5 +59,6 @@ module Repp
|
|||
mount Repp::AccountV1
|
||||
mount Repp::DomainTransfersV1
|
||||
mount Repp::NameserversV1
|
||||
mount Repp::DomainContactsV1
|
||||
end
|
||||
end
|
||||
|
|
47
app/api/repp/domain_contacts_v1.rb
Normal file
47
app/api/repp/domain_contacts_v1.rb
Normal file
|
@ -0,0 +1,47 @@
|
|||
module Repp
|
||||
class DomainContactsV1 < Grape::API
|
||||
version 'v1', using: :path
|
||||
|
||||
resource :domains do
|
||||
resource :contacts do
|
||||
patch '/' do
|
||||
current_contact = current_user.registrar.contacts
|
||||
.find_by(code: params[:current_contact_id])
|
||||
new_contact = current_user.registrar.contacts.find_by(code: params[:new_contact_id])
|
||||
|
||||
unless current_contact
|
||||
error!({ error: { type: 'invalid_request_error',
|
||||
param: 'current_contact_id',
|
||||
message: "No such contact: #{params[:current_contact_id]}"} },
|
||||
:bad_request)
|
||||
end
|
||||
|
||||
unless new_contact
|
||||
error!({ error: { type: 'invalid_request_error',
|
||||
param: 'new_contact_id',
|
||||
message: "No such contact: #{params[:new_contact_id]}" } },
|
||||
:bad_request)
|
||||
end
|
||||
|
||||
if new_contact.invalid?
|
||||
error!({ error: { type: 'invalid_request_error',
|
||||
param: 'new_contact_id',
|
||||
message: 'New contact must be valid' } },
|
||||
:bad_request)
|
||||
end
|
||||
|
||||
if current_contact == new_contact
|
||||
error!({ error: { type: 'invalid_request_error',
|
||||
message: 'New contact ID must be different from current' \
|
||||
' contact ID' } },
|
||||
:bad_request)
|
||||
end
|
||||
|
||||
affected_domains, skipped_domains = TechDomainContact
|
||||
.replace(current_contact, new_contact)
|
||||
@response = { affected_domains: affected_domains, skipped_domains: skipped_domains }
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
BIN
app/assets/images/every_pay.png
Normal file
BIN
app/assets/images/every_pay.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.7 KiB |
9
app/assets/javascripts/popover.js
Normal file
9
app/assets/javascripts/popover.js
Normal file
|
@ -0,0 +1,9 @@
|
|||
(function() {
|
||||
function initPopover() {
|
||||
$(function () {
|
||||
$('[data-toggle="popover"]').popover();
|
||||
})
|
||||
}
|
||||
|
||||
initPopover();
|
||||
})();
|
|
@ -7,6 +7,8 @@
|
|||
#= require select2
|
||||
#= require datepicker
|
||||
#= require spell_check
|
||||
#= require popover
|
||||
#= require text_field_trimmer
|
||||
#= require shared/general
|
||||
#= require registrar/autocomplete
|
||||
#= require registrar/application
|
||||
|
|
15
app/assets/javascripts/text_field_trimmer.js
Normal file
15
app/assets/javascripts/text_field_trimmer.js
Normal file
|
@ -0,0 +1,15 @@
|
|||
(function () {
|
||||
function trimTextFields() {
|
||||
let selector = 'input[type=text], input[type=search], input[type=email], textarea';
|
||||
let textFields = document.querySelectorAll(selector);
|
||||
let listener = function () {
|
||||
this.value = this.value.trim();
|
||||
};
|
||||
|
||||
for (let field of textFields) {
|
||||
field.addEventListener('change', listener);
|
||||
}
|
||||
}
|
||||
|
||||
trimTextFields();
|
||||
})();
|
|
@ -3,13 +3,11 @@ module Admin
|
|||
load_and_authorize_resource
|
||||
|
||||
def index
|
||||
|
||||
params[:q] ||= {}
|
||||
domains = BlockedDomain.all.order(:name)
|
||||
@q = domains.search(params[:q])
|
||||
@domains = @q.result.page(params[:page])
|
||||
@domains = @domains.per(params[:results_per_page]) if params[:results_per_page].to_i > 0
|
||||
|
||||
@domains = @domains.per(params[:results_per_page]) if params[:results_per_page].to_i.positive?
|
||||
end
|
||||
|
||||
def new
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
module Admin
|
||||
class ContactVersionsController < BaseController
|
||||
include ObjectVersionsHelper
|
||||
|
||||
load_and_authorize_resource
|
||||
|
||||
def index
|
||||
|
@ -24,7 +26,7 @@ module Admin
|
|||
versions = ContactVersion.includes(:item).where(whereS).order(created_at: :desc, id: :desc)
|
||||
@q = versions.search(params[:q])
|
||||
@versions = @q.result.page(params[:page])
|
||||
@versions = @versions.per(params[:results_per_page]) if params[:results_per_page].to_i > 0
|
||||
@versions = @versions.per(params[:results_per_page]) if params[:results_per_page].to_i.positive?
|
||||
|
||||
end
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ module Admin
|
|||
@contacts = @q.result.uniq.page(params[:page])
|
||||
end
|
||||
|
||||
@contacts = @contacts.per(params[:results_per_page]) if params[:results_per_page].to_i > 0
|
||||
@contacts = @contacts.per(params[:results_per_page]) if params[:results_per_page].to_i.positive?
|
||||
end
|
||||
|
||||
def search
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
module Admin
|
||||
class DomainVersionsController < BaseController
|
||||
include ObjectVersionsHelper
|
||||
|
||||
load_and_authorize_resource
|
||||
|
||||
def index
|
||||
|
@ -41,7 +43,7 @@ module Admin
|
|||
versions = DomainVersion.includes(:item).where(whereS).order(created_at: :desc, id: :desc)
|
||||
@q = versions.search(params[:q])
|
||||
@versions = @q.result.page(params[:page])
|
||||
@versions = @versions.per(params[:results_per_page]) if params[:results_per_page].to_i > 0
|
||||
@versions = @versions.per(params[:results_per_page]) if params[:results_per_page].to_i.positive?
|
||||
render "admin/domain_versions/archive"
|
||||
|
||||
end
|
||||
|
|
|
@ -32,7 +32,7 @@ module Admin
|
|||
end
|
||||
end
|
||||
|
||||
@domains = @domains.per(params[:results_per_page]) if params[:results_per_page].to_i > 0
|
||||
@domains = @domains.per(params[:results_per_page]) if params[:results_per_page].to_i.positive?
|
||||
end
|
||||
|
||||
# rubocop: enable Metrics/PerceivedComplexity
|
||||
|
|
|
@ -13,7 +13,7 @@ module Admin
|
|||
@deposit = Deposit.new(deposit_params.merge(registrar: r))
|
||||
@invoice = @deposit.issue_prepayment_invoice
|
||||
|
||||
if @invoice && @invoice.persisted?
|
||||
if @invoice&.persisted?
|
||||
flash[:notice] = t(:record_created)
|
||||
redirect_to [:admin, @invoice]
|
||||
else
|
||||
|
|
|
@ -4,13 +4,11 @@ module Admin
|
|||
before_action :set_domain, only: [:edit, :update]
|
||||
|
||||
def index
|
||||
|
||||
params[:q] ||= {}
|
||||
domains = ReservedDomain.all.order(:name)
|
||||
@q = domains.search(params[:q])
|
||||
@domains = @q.result.page(params[:page])
|
||||
@domains = @domains.per(params[:results_per_page]) if params[:results_per_page].to_i > 0
|
||||
|
||||
@domains = @domains.per(params[:results_per_page]) if params[:results_per_page].to_i.positive?
|
||||
end
|
||||
|
||||
def new
|
||||
|
|
|
@ -168,7 +168,7 @@ class EppController < ApplicationController
|
|||
|
||||
# validate legal document's type here because it may be in most of the requests
|
||||
@prefix = nil
|
||||
if element_count('extdata > legalDocument') > 0
|
||||
if element_count('extdata > legalDocument').positive?
|
||||
requires_attribute('extdata > legalDocument', 'type', values: LegalDocument::TYPES, policy: true)
|
||||
end
|
||||
|
||||
|
@ -279,7 +279,7 @@ class EppController < ApplicationController
|
|||
def optional(selector, *validations)
|
||||
full_selector = [@prefix, selector].compact.join(' ')
|
||||
el = params[:parsed_frame].css(full_selector).first
|
||||
return unless el && el.text.present?
|
||||
return unless el&.text.present?
|
||||
value = el.text
|
||||
|
||||
validations.each do |x|
|
||||
|
|
|
@ -6,7 +6,7 @@ class Registrant::DomainsController < RegistrantController
|
|||
@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
|
||||
@domains = @domains.per(params[:results_per_page]) if params[:results_per_page].to_i.positive?
|
||||
end
|
||||
|
||||
def show
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# As non-GDPR compliant, this controller is deprecated. Needs to be replaced with one that relies
|
||||
# on the REST WHOIS API.
|
||||
class Registrant::WhoisController < RegistrantController
|
||||
def index
|
||||
authorize! :view, :registrant_whois
|
||||
|
|
20
app/controllers/registrar/bulk_change_controller.rb
Normal file
20
app/controllers/registrar/bulk_change_controller.rb
Normal file
|
@ -0,0 +1,20 @@
|
|||
class Registrar
|
||||
class BulkChangeController < DeppController
|
||||
helper_method :available_contacts
|
||||
|
||||
def new
|
||||
authorize! :manage, :repp
|
||||
render file: 'registrar/bulk_change/new', locals: { active_tab: default_tab }
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def available_contacts
|
||||
current_user.registrar.contacts.order(:name).pluck(:name, :code)
|
||||
end
|
||||
|
||||
def default_tab
|
||||
:technical_contact
|
||||
end
|
||||
end
|
||||
end
|
|
@ -33,7 +33,7 @@ class Registrar
|
|||
@contacts = @q.result(distinct: :true).page(params[:page])
|
||||
end
|
||||
|
||||
@contacts = @contacts.per(params[:results_per_page]) if params[:results_per_page].to_i > 0
|
||||
@contacts = @contacts.per(params[:results_per_page]) if params[:results_per_page].to_i.positive?
|
||||
end
|
||||
|
||||
def download_list
|
||||
|
|
|
@ -10,7 +10,7 @@ class Registrar
|
|||
@deposit = Deposit.new(deposit_params.merge(registrar: current_user.registrar))
|
||||
@invoice = @deposit.issue_prepayment_invoice
|
||||
|
||||
if @invoice && @invoice.persisted?
|
||||
if @invoice&.persisted?
|
||||
flash[:notice] = t(:please_pay_the_following_invoice)
|
||||
redirect_to [:registrar, @invoice]
|
||||
else
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
class Registrar
|
||||
class DomainTransfersController < DeppController
|
||||
class DomainTransfersController < BulkChangeController
|
||||
before_action do
|
||||
authorize! :transfer, Depp::Domain
|
||||
end
|
||||
|
@ -58,7 +58,7 @@ class Registrar
|
|||
redirect_to registrar_domains_url
|
||||
else
|
||||
@api_errors = parsed_response[:errors]
|
||||
render :new
|
||||
render file: 'registrar/bulk_change/new', locals: { active_tab: :bulk_transfer }
|
||||
end
|
||||
else
|
||||
params[:request] = true # EPP domain:transfer "op" attribute
|
||||
|
|
|
@ -40,7 +40,7 @@ class Registrar
|
|||
end
|
||||
end
|
||||
|
||||
@domains = @domains.per(params[:results_per_page]) if params[:results_per_page].to_i > 0
|
||||
@domains = @domains.per(params[:results_per_page]) if params[:results_per_page].to_i.positive?
|
||||
|
||||
respond_to do |format|
|
||||
format.html
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
class Registrar
|
||||
class RegistrarNameserversController < DeppController
|
||||
def edit
|
||||
authorize! :manage, :repp
|
||||
end
|
||||
|
||||
class NameserversController < BulkChangeController
|
||||
def update
|
||||
authorize! :manage, :repp
|
||||
|
||||
|
@ -52,7 +48,7 @@ class Registrar
|
|||
redirect_to registrar_domains_url
|
||||
else
|
||||
@api_errors = parsed_response[:errors]
|
||||
render :edit
|
||||
render file: 'registrar/bulk_change/new', locals: { active_tab: :nameserver }
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,30 +1,34 @@
|
|||
class Registrar
|
||||
class PaymentsController < BaseController
|
||||
protect_from_forgery except: :back
|
||||
protect_from_forgery except: [:back, :callback]
|
||||
|
||||
skip_authorization_check # actually anyone can pay, no problems at all
|
||||
skip_before_action :authenticate_user!, :check_ip_restriction, only: [:back]
|
||||
before_action :check_bank
|
||||
skip_before_action :authenticate_user!, :check_ip_restriction, only: [:back, :callback]
|
||||
before_action :check_supported_payment_method
|
||||
|
||||
# to handle existing model we should
|
||||
# get invoice_id and then get number
|
||||
# build BankTransaction without connection with right reference number
|
||||
# do not connect transaction and invoice
|
||||
def pay
|
||||
invoice = Invoice.find(params[:invoice_id])
|
||||
@bank_link = BankLink::Request.new(params[:bank], invoice, self)
|
||||
@bank_link.make_transaction
|
||||
bank = params[:bank]
|
||||
opts = {
|
||||
return_url: registrar_return_payment_with_url(
|
||||
bank, invoice_id: invoice
|
||||
),
|
||||
response_url: registrar_response_payment_with_url(
|
||||
bank, invoice_id: invoice
|
||||
)
|
||||
}
|
||||
@payment = ::PaymentOrders.create_with_type(bank, invoice, opts)
|
||||
@payment.create_transaction
|
||||
end
|
||||
|
||||
|
||||
# connect invoice and transaction
|
||||
# both back and IPN
|
||||
def back
|
||||
@bank_link = BankLink::Response.new(params[:bank], params)
|
||||
if @bank_link.valid? && @bank_link.ok?
|
||||
@bank_link.complete_payment
|
||||
invoice = Invoice.find(params[:invoice_id])
|
||||
opts = { response: params }
|
||||
@payment = ::PaymentOrders.create_with_type(params[:bank], invoice, opts)
|
||||
if @payment.valid_response_from_intermediary? && @payment.settled_payment?
|
||||
@payment.complete_transaction
|
||||
|
||||
if @bank_link.invoice.binded?
|
||||
if invoice.binded?
|
||||
flash[:notice] = t(:pending_applied)
|
||||
else
|
||||
flash[:alert] = t(:something_wrong)
|
||||
|
@ -32,17 +36,31 @@ class Registrar
|
|||
else
|
||||
flash[:alert] = t(:something_wrong)
|
||||
end
|
||||
redirect_to registrar_invoice_path(@bank_link.invoice)
|
||||
redirect_to registrar_invoice_path(invoice)
|
||||
end
|
||||
|
||||
def callback
|
||||
invoice = Invoice.find(params[:invoice_id])
|
||||
opts = { response: params }
|
||||
@payment = ::PaymentOrders.create_with_type(params[:bank], invoice, opts)
|
||||
|
||||
if @payment.valid_response_from_intermediary? && @payment.settled_payment?
|
||||
@payment.complete_transaction
|
||||
end
|
||||
|
||||
render status: 200, json: { status: 'ok' }
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def banks
|
||||
ENV['payments_banks'].split(",").map(&:strip)
|
||||
def check_supported_payment_method
|
||||
return if supported_payment_method?
|
||||
raise StandardError.new("Not supported payment method")
|
||||
end
|
||||
|
||||
def check_bank
|
||||
raise StandardError.new("Not Implemented bank") unless banks.include?(params[:bank])
|
||||
|
||||
def supported_payment_method?
|
||||
PaymentOrders::PAYMENT_METHODS.include?(params[:bank])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
59
app/controllers/registrar/tech_contacts_controller.rb
Normal file
59
app/controllers/registrar/tech_contacts_controller.rb
Normal file
|
@ -0,0 +1,59 @@
|
|||
class Registrar
|
||||
class TechContactsController < BulkChangeController
|
||||
def update
|
||||
authorize! :manage, :repp
|
||||
|
||||
uri = URI.parse("#{ENV['repp_url']}domains/contacts")
|
||||
|
||||
request = Net::HTTP::Patch.new(uri)
|
||||
request.set_form_data(current_contact_id: params[:current_contact_id],
|
||||
new_contact_id: params[:new_contact_id])
|
||||
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
|
||||
|
||||
parsed_response = JSON.parse(response.body, symbolize_names: true)
|
||||
|
||||
if response.code == '200'
|
||||
notices = [t('.replaced')]
|
||||
|
||||
notices << "#{t('.affected_domains')}: #{parsed_response[:affected_domains].join(', ')}"
|
||||
|
||||
if parsed_response[:skipped_domains]
|
||||
notices << "#{t('.skipped_domains')}: #{parsed_response[:skipped_domains].join(', ')}"
|
||||
end
|
||||
|
||||
flash[:notice] = notices
|
||||
redirect_to registrar_domains_url
|
||||
else
|
||||
@error = parsed_response[:error]
|
||||
render file: 'registrar/bulk_change/new', locals: { active_tab: :technical_contact }
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
15
app/helpers/object_versions_helper.rb
Normal file
15
app/helpers/object_versions_helper.rb
Normal file
|
@ -0,0 +1,15 @@
|
|||
module ObjectVersionsHelper
|
||||
def attach_existing_fields(version, new_object)
|
||||
version.object_changes.to_h.each do |key, value|
|
||||
method_name = "#{key}=".to_sym
|
||||
if new_object.respond_to?(method_name)
|
||||
new_object.public_send(method_name, value.last)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def only_present_fields(version, model)
|
||||
field_names = model.column_names
|
||||
version.object.to_h.select { |key, _value| field_names.include?(key) }
|
||||
end
|
||||
end
|
|
@ -51,4 +51,4 @@ class UpdateWhoisRecordJob < Que::Job
|
|||
def delete_blocked(name)
|
||||
delete_reserved(name)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -13,9 +13,9 @@ class Ability
|
|||
|
||||
case @user.class.to_s
|
||||
when 'AdminUser'
|
||||
@user.roles.each { |role| send(role) } if @user.roles
|
||||
@user.roles&.each { |role| send(role) }
|
||||
when 'ApiUser'
|
||||
@user.roles.each { |role| send(role) } if @user.roles
|
||||
@user.roles&.each { |role| send(role) }
|
||||
when 'RegistrantUser'
|
||||
static_registrant
|
||||
end
|
||||
|
|
|
@ -1,158 +0,0 @@
|
|||
class BankLink
|
||||
module Base
|
||||
def prepend_size(value)
|
||||
value = (value || "").to_s.strip
|
||||
string = ""
|
||||
string << sprintf("%03i", value.size)
|
||||
string << value
|
||||
end
|
||||
end
|
||||
|
||||
class Request
|
||||
include Base
|
||||
include ActionView::Helpers::NumberHelper
|
||||
|
||||
# need controller here in order to handle random ports and domains
|
||||
# I don't want to do it but has to
|
||||
attr_accessor :type, :invoice, :controller
|
||||
def initialize(type, invoice, controller)
|
||||
@type, @invoice, @controller = type, invoice, controller
|
||||
end
|
||||
|
||||
def url
|
||||
ENV["payments_#{type}_url"]
|
||||
end
|
||||
|
||||
def fields
|
||||
@fields ||= (hash = {}
|
||||
hash["VK_SERVICE"] = "1012"
|
||||
hash["VK_VERSION"] = "008"
|
||||
hash["VK_SND_ID"] = ENV["payments_#{type}_seller_account"]
|
||||
hash["VK_STAMP"] = invoice.number
|
||||
hash["VK_AMOUNT"] = number_with_precision(invoice.total, :precision => 2, :separator => ".")
|
||||
hash["VK_CURR"] = invoice.currency
|
||||
hash["VK_REF"] = ""
|
||||
hash["VK_MSG"] = invoice.order
|
||||
hash["VK_RETURN"] = controller.registrar_return_payment_with_url(type)
|
||||
hash["VK_CANCEL"] = controller.registrar_return_payment_with_url(type)
|
||||
hash["VK_DATETIME"] = Time.now.strftime("%Y-%m-%dT%H:%M:%S%z")
|
||||
hash["VK_MAC"] = calc_mac(hash)
|
||||
hash["VK_ENCODING"] = "UTF-8"
|
||||
hash["VK_LANG"] = "ENG"
|
||||
hash)
|
||||
end
|
||||
|
||||
def calc_mac(fields)
|
||||
pars = %w(VK_SERVICE VK_VERSION VK_SND_ID VK_STAMP VK_AMOUNT VK_CURR VK_REF
|
||||
VK_MSG VK_RETURN VK_CANCEL VK_DATETIME).freeze
|
||||
data = pars.map{|e| prepend_size(fields[e]) }.join
|
||||
|
||||
sign(data)
|
||||
end
|
||||
|
||||
def make_transaction
|
||||
transaction = BankTransaction.where(description: fields["VK_MSG"]).first_or_initialize(
|
||||
reference_no: invoice.reference_no,
|
||||
currency: invoice.currency,
|
||||
iban: invoice.seller_iban
|
||||
)
|
||||
|
||||
transaction.save!
|
||||
end
|
||||
|
||||
private
|
||||
def sign(data)
|
||||
private_key = OpenSSL::PKey::RSA.new(File.read(ENV["payments_#{type}_seller_private"]))
|
||||
|
||||
signed_data = private_key.sign(OpenSSL::Digest::SHA1.new, data)
|
||||
signed_data = Base64.encode64(signed_data).gsub(/\n|\r/, '')
|
||||
signed_data
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
class Response
|
||||
include Base
|
||||
include ActionView::Helpers::NumberHelper
|
||||
|
||||
attr_accessor :type, :params, :invoice
|
||||
def initialize(type, params)
|
||||
@type, @params = type, params
|
||||
|
||||
@invoice = Invoice.find_by(number: params["VK_STAMP"]) if params["VK_STAMP"].present?
|
||||
end
|
||||
|
||||
def valid?
|
||||
!!validate
|
||||
end
|
||||
|
||||
def ok?
|
||||
params["VK_SERVICE"] == "1111"
|
||||
end
|
||||
|
||||
def complete_payment
|
||||
if valid?
|
||||
transaction = BankTransaction.find_by(description: params["VK_MSG"])
|
||||
transaction.sum = BigDecimal.new(params["VK_AMOUNT"].to_s)
|
||||
transaction.bank_reference = params['VK_T_NO']
|
||||
transaction.buyer_bank_code = params["VK_SND_ID"]
|
||||
transaction.buyer_iban = params["VK_SND_ACC"]
|
||||
transaction.buyer_name = params["VK_SND_NAME"]
|
||||
transaction.paid_at = Time.parse(params["VK_T_DATETIME"])
|
||||
transaction.save!
|
||||
|
||||
transaction.autobind_invoice
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
def validate
|
||||
case params["VK_SERVICE"]
|
||||
when "1111"
|
||||
validate_success && validate_amount && validate_currency
|
||||
when "1911"
|
||||
validate_cancel
|
||||
else
|
||||
false
|
||||
end
|
||||
end
|
||||
|
||||
def validate_success
|
||||
pars = %w(VK_SERVICE VK_VERSION VK_SND_ID VK_REC_ID VK_STAMP VK_T_NO VK_AMOUNT VK_CURR
|
||||
VK_REC_ACC VK_REC_NAME VK_SND_ACC VK_SND_NAME VK_REF VK_MSG VK_T_DATETIME).freeze
|
||||
|
||||
@validate_success ||= (
|
||||
data = pars.map{|e| prepend_size(params[e]) }.join
|
||||
verify_mac(data, params["VK_MAC"])
|
||||
)
|
||||
end
|
||||
|
||||
def validate_cancel
|
||||
pars = %w(VK_SERVICE VK_VERSION VK_SND_ID VK_REC_ID VK_STAMP VK_REF VK_MSG).freeze
|
||||
@validate_cancel ||= (
|
||||
data = pars.map{|e| prepend_size(params[e]) }.join
|
||||
verify_mac(data, params["VK_MAC"])
|
||||
)
|
||||
end
|
||||
|
||||
def validate_amount
|
||||
source = number_with_precision(BigDecimal.new(params["VK_AMOUNT"].to_s), precision: 2, separator: ".")
|
||||
target = number_with_precision(invoice.total, precision: 2, separator: ".")
|
||||
|
||||
source == target
|
||||
end
|
||||
|
||||
def validate_currency
|
||||
invoice.currency == params["VK_CURR"]
|
||||
end
|
||||
|
||||
|
||||
def verify_mac(data, mac)
|
||||
bank_public_key = OpenSSL::X509::Certificate.new(File.read(ENV["payments_#{type}_bank_certificate"])).public_key
|
||||
bank_public_key.verify(OpenSSL::Digest::SHA1.new, Base64.decode64(mac), data)
|
||||
end
|
||||
end
|
||||
end
|
|
@ -45,8 +45,10 @@ class Directo < ActiveRecord::Base
|
|||
end
|
||||
|
||||
data = builder.to_xml.gsub("\n",'')
|
||||
response = RestClient::Request.execute(url: ENV['directo_invoice_url'], method: :post, payload: {put: "1", what: "invoice", xmldata: data}, verify_ssl: false).to_s
|
||||
dump_result_to_db(mappers, response)
|
||||
Rails.logger.info("[Directo] XML request: #{data}")
|
||||
response = RestClient::Request.execute(url: ENV['directo_invoice_url'], method: :post, payload: {put: "1", what: "invoice", xmldata: data}, verify_ssl: false)
|
||||
Rails.logger.info("[Directo] Directo responded with code: #{response.code}, body: #{response.body}")
|
||||
dump_result_to_db(mappers, response.to_s)
|
||||
end
|
||||
|
||||
STDOUT << "#{Time.zone.now.utc} - Directo receipts sending finished. #{counter} of #{total} are sent\n"
|
||||
|
@ -165,11 +167,15 @@ class Directo < ActiveRecord::Base
|
|||
end
|
||||
|
||||
data = builder.to_xml.gsub("\n",'')
|
||||
Rails.logger.info("[Directo] XML request: #{data}")
|
||||
|
||||
if debug
|
||||
STDOUT << "#{Time.zone.now.utc} - Directo xml had to be sent #{data}\n"
|
||||
else
|
||||
response = RestClient::Request.execute(url: ENV['directo_invoice_url'], method: :post, payload: {put: "1", what: "invoice", xmldata: data}, verify_ssl: false).to_s
|
||||
response = RestClient::Request.execute(url: ENV['directo_invoice_url'], method: :post, payload: {put: "1", what: "invoice", xmldata: data}, verify_ssl: false)
|
||||
Rails.logger.info("[Directo] Directo responded with code: #{response.code}, body: #{response.body}")
|
||||
response = response.to_s
|
||||
|
||||
Setting.directo_monthly_number_last = directo_next
|
||||
Nokogiri::XML(response).css("Result").each do |res|
|
||||
Directo.create!(request: data, response: res.as_json.to_h, invoice_number: directo_next)
|
||||
|
@ -190,4 +196,3 @@ class Directo < ActiveRecord::Base
|
|||
@pricelists[account_activity.price_id] = account_activity.price
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -147,7 +147,7 @@ class Epp::Contact < Contact
|
|||
end
|
||||
|
||||
if doc = attach_legal_document(Epp::Domain.parse_legal_document_from_frame(frame))
|
||||
frame.css("legalDocument").first.content = doc.path if doc && doc.persisted?
|
||||
frame.css("legalDocument").first.content = doc.path if doc&.persisted?
|
||||
self.legal_document_id = doc.id
|
||||
end
|
||||
|
||||
|
@ -238,7 +238,7 @@ class Epp::Contact < Contact
|
|||
)
|
||||
self.legal_documents = [doc]
|
||||
|
||||
frame.css("legalDocument").first.content = doc.path if doc && doc.persisted?
|
||||
frame.css("legalDocument").first.content = doc.path if doc&.persisted?
|
||||
self.legal_document_id = doc.id
|
||||
end
|
||||
|
||||
|
|
|
@ -197,7 +197,7 @@ class Epp::Domain < Domain
|
|||
)
|
||||
self.legal_documents = [doc]
|
||||
|
||||
frame.css("legalDocument").first.content = doc.path if doc && doc.persisted?
|
||||
frame.css("legalDocument").first.content = doc.path if doc&.persisted?
|
||||
self.legal_document_id = doc.id
|
||||
end
|
||||
# rubocop: enable Metrics/PerceivedComplexity
|
||||
|
@ -472,7 +472,7 @@ class Epp::Domain < Domain
|
|||
at.deep_merge!(attrs_from(frame.css('rem'), current_user, 'rem'))
|
||||
|
||||
if doc = attach_legal_document(Epp::Domain.parse_legal_document_from_frame(frame))
|
||||
frame.css("legalDocument").first.content = doc.path if doc && doc.persisted?
|
||||
frame.css("legalDocument").first.content = doc.path if doc&.persisted?
|
||||
self.legal_document_id = doc.id
|
||||
end
|
||||
|
||||
|
@ -547,7 +547,7 @@ class Epp::Domain < Domain
|
|||
check_discarded
|
||||
|
||||
if doc = attach_legal_document(Epp::Domain.parse_legal_document_from_frame(frame))
|
||||
frame.css("legalDocument").first.content = doc.path if doc && doc.persisted?
|
||||
frame.css("legalDocument").first.content = doc.path if doc&.persisted?
|
||||
end
|
||||
|
||||
if Setting.request_confirmation_on_domain_deletion_enabled &&
|
||||
|
|
|
@ -6,7 +6,8 @@ class LegalDocument < ActiveRecord::Base
|
|||
if ENV['legal_document_types'].present?
|
||||
TYPES = ENV['legal_document_types'].split(',').map(&:strip)
|
||||
else
|
||||
TYPES = %w(pdf bdoc ddoc zip rar gz tar 7z odt doc docx).freeze
|
||||
TYPES = %w(pdf asice asics sce scs adoc edoc bdoc ddoc zip rar gz tar 7z odt
|
||||
doc docx).freeze
|
||||
end
|
||||
|
||||
attr_accessor :body
|
||||
|
|
15
app/models/payment_orders.rb
Normal file
15
app/models/payment_orders.rb
Normal file
|
@ -0,0 +1,15 @@
|
|||
module PaymentOrders
|
||||
PAYMENT_INTERMEDIARIES = ENV['payments_intermediaries'].to_s.strip.split(', ').freeze
|
||||
PAYMENT_BANKLINK_BANKS = ENV['payments_banks'].to_s.strip.split(', ').freeze
|
||||
PAYMENT_METHODS = [PAYMENT_INTERMEDIARIES, PAYMENT_BANKLINK_BANKS].flatten.freeze
|
||||
|
||||
def self.create_with_type(type, invoice, opts = {})
|
||||
raise ArgumentError unless PAYMENT_METHODS.include?(type)
|
||||
|
||||
if PAYMENT_BANKLINK_BANKS.include?(type)
|
||||
BankLink.new(type, invoice, opts)
|
||||
elsif type == 'every_pay'
|
||||
EveryPay.new(type, invoice, opts)
|
||||
end
|
||||
end
|
||||
end
|
146
app/models/payment_orders/bank_link.rb
Normal file
146
app/models/payment_orders/bank_link.rb
Normal file
|
@ -0,0 +1,146 @@
|
|||
module PaymentOrders
|
||||
class BankLink < Base
|
||||
BANK_LINK_VERSION = '008'
|
||||
|
||||
NEW_TRANSACTION_SERVICE_NUMBER = '1012'
|
||||
SUCCESSFUL_PAYMENT_SERVICE_NUMBER = '1111'
|
||||
CANCELLED_PAYMENT_SERVICE_NUMBER = '1911'
|
||||
|
||||
NEW_MESSAGE_KEYS = %w(VK_SERVICE VK_VERSION VK_SND_ID VK_STAMP VK_AMOUNT
|
||||
VK_CURR VK_REF VK_MSG VK_RETURN VK_CANCEL
|
||||
VK_DATETIME).freeze
|
||||
SUCCESS_MESSAGE_KEYS = %w(VK_SERVICE VK_VERSION VK_SND_ID VK_REC_ID VK_STAMP
|
||||
VK_T_NO VK_AMOUNT VK_CURR VK_REC_ACC VK_REC_NAME
|
||||
VK_SND_ACC VK_SND_NAME VK_REF VK_MSG
|
||||
VK_T_DATETIME).freeze
|
||||
CANCEL_MESSAGE_KEYS = %w(VK_SERVICE VK_VERSION VK_SND_ID VK_REC_ID VK_STAMP
|
||||
VK_REF VK_MSG).freeze
|
||||
|
||||
def form_fields
|
||||
hash = {}
|
||||
hash["VK_SERVICE"] = NEW_TRANSACTION_SERVICE_NUMBER
|
||||
hash["VK_VERSION"] = BANK_LINK_VERSION
|
||||
hash["VK_SND_ID"] = seller_account
|
||||
hash["VK_STAMP"] = invoice.number
|
||||
hash["VK_AMOUNT"] = number_with_precision(invoice.total, precision: 2, separator: ".")
|
||||
hash["VK_CURR"] = invoice.currency
|
||||
hash["VK_REF"] = ""
|
||||
hash["VK_MSG"] = invoice.order
|
||||
hash["VK_RETURN"] = return_url
|
||||
hash["VK_CANCEL"] = return_url
|
||||
hash["VK_DATETIME"] = Time.zone.now.strftime("%Y-%m-%dT%H:%M:%S%z")
|
||||
hash["VK_MAC"] = calc_mac(hash)
|
||||
hash["VK_ENCODING"] = "UTF-8"
|
||||
hash["VK_LANG"] = "ENG"
|
||||
hash
|
||||
end
|
||||
|
||||
def valid_response_from_intermediary?
|
||||
return false unless response
|
||||
|
||||
case response["VK_SERVICE"]
|
||||
when SUCCESSFUL_PAYMENT_SERVICE_NUMBER
|
||||
valid_successful_transaction?
|
||||
when CANCELLED_PAYMENT_SERVICE_NUMBER
|
||||
valid_cancel_notice?
|
||||
else
|
||||
false
|
||||
end
|
||||
end
|
||||
|
||||
def complete_transaction
|
||||
return unless valid_successful_transaction?
|
||||
|
||||
transaction = BankTransaction.find_by(
|
||||
description: invoice.order,
|
||||
currency: invoice.currency,
|
||||
iban: invoice.seller_iban
|
||||
)
|
||||
|
||||
transaction.sum = response['VK_AMOUNT']
|
||||
transaction.bank_reference = response['VK_T_NO']
|
||||
transaction.buyer_bank_code = response["VK_SND_ID"]
|
||||
transaction.buyer_iban = response["VK_SND_ACC"]
|
||||
transaction.buyer_name = response["VK_SND_NAME"]
|
||||
transaction.paid_at = Time.parse(response["VK_T_DATETIME"])
|
||||
|
||||
transaction.save!
|
||||
transaction.autobind_invoice
|
||||
end
|
||||
|
||||
def settled_payment?
|
||||
response["VK_SERVICE"] == SUCCESSFUL_PAYMENT_SERVICE_NUMBER
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def valid_successful_transaction?
|
||||
valid_success_notice? && valid_amount? && valid_currency?
|
||||
end
|
||||
|
||||
def valid_cancel_notice?
|
||||
valid_mac?(response, CANCEL_MESSAGE_KEYS)
|
||||
end
|
||||
|
||||
def valid_success_notice?
|
||||
valid_mac?(response, SUCCESS_MESSAGE_KEYS)
|
||||
end
|
||||
|
||||
def valid_amount?
|
||||
source = number_with_precision(
|
||||
BigDecimal.new(response["VK_AMOUNT"]), precision: 2, separator: "."
|
||||
)
|
||||
target = number_with_precision(
|
||||
invoice.total, precision: 2, separator: "."
|
||||
)
|
||||
|
||||
source == target
|
||||
end
|
||||
|
||||
def valid_currency?
|
||||
invoice.currency == response["VK_CURR"]
|
||||
end
|
||||
|
||||
def sign(data)
|
||||
private_key = OpenSSL::PKey::RSA.new(File.read(seller_certificate))
|
||||
signed_data = private_key.sign(OpenSSL::Digest::SHA1.new, data)
|
||||
signed_data = Base64.encode64(signed_data).gsub(/\n|\r/, '')
|
||||
signed_data
|
||||
end
|
||||
|
||||
def calc_mac(fields)
|
||||
pars = NEW_MESSAGE_KEYS
|
||||
data = pars.map { |element| prepend_size(fields[element]) }.join
|
||||
sign(data)
|
||||
end
|
||||
|
||||
def valid_mac?(hash, keys)
|
||||
data = keys.map { |element| prepend_size(hash[element]) }.join
|
||||
verify_mac(data, hash["VK_MAC"])
|
||||
end
|
||||
|
||||
def verify_mac(data, mac)
|
||||
bank_public_key = OpenSSL::X509::Certificate.new(File.read(bank_certificate)).public_key
|
||||
bank_public_key.verify(OpenSSL::Digest::SHA1.new, Base64.decode64(mac), data)
|
||||
end
|
||||
|
||||
def prepend_size(value)
|
||||
value = (value || "").to_s.strip
|
||||
string = ""
|
||||
string << format("%03i", value.size)
|
||||
string << value
|
||||
end
|
||||
|
||||
def seller_account
|
||||
ENV["payments_#{type}_seller_account"]
|
||||
end
|
||||
|
||||
def seller_certificate
|
||||
ENV["payments_#{type}_seller_private"]
|
||||
end
|
||||
|
||||
def bank_certificate
|
||||
ENV["payments_#{type}_bank_certificate"]
|
||||
end
|
||||
end
|
||||
end
|
33
app/models/payment_orders/base.rb
Normal file
33
app/models/payment_orders/base.rb
Normal file
|
@ -0,0 +1,33 @@
|
|||
module PaymentOrders
|
||||
class Base
|
||||
include ActionView::Helpers::NumberHelper
|
||||
|
||||
attr_reader :type,
|
||||
:invoice,
|
||||
:return_url,
|
||||
:response_url,
|
||||
:response
|
||||
|
||||
def initialize(type, invoice, opts = {})
|
||||
@type = type
|
||||
@invoice = invoice
|
||||
@return_url = opts[:return_url]
|
||||
@response_url = opts[:response_url]
|
||||
@response = opts[:response]
|
||||
end
|
||||
|
||||
def create_transaction
|
||||
transaction = BankTransaction.where(description: invoice.order).first_or_initialize(
|
||||
reference_no: invoice.reference_no,
|
||||
currency: invoice.currency,
|
||||
iban: invoice.seller_iban
|
||||
)
|
||||
|
||||
transaction.save!
|
||||
end
|
||||
|
||||
def form_url
|
||||
ENV["payments_#{type}_url"]
|
||||
end
|
||||
end
|
||||
end
|
84
app/models/payment_orders/every_pay.rb
Normal file
84
app/models/payment_orders/every_pay.rb
Normal file
|
@ -0,0 +1,84 @@
|
|||
module PaymentOrders
|
||||
class EveryPay < Base
|
||||
USER = ENV['payments_every_pay_api_user'].freeze
|
||||
KEY = ENV['payments_every_pay_api_key'].freeze
|
||||
ACCOUNT_ID = ENV['payments_every_pay_seller_account'].freeze
|
||||
SUCCESSFUL_PAYMENT = %w(settled authorized).freeze
|
||||
|
||||
def form_fields
|
||||
base_json = base_params
|
||||
base_json[:nonce] = SecureRandom.hex(15)
|
||||
hmac_fields = (base_json.keys + ['hmac_fields']).sort.uniq!
|
||||
|
||||
base_json[:hmac_fields] = hmac_fields.join(',')
|
||||
hmac_string = hmac_fields.map { |key, _v| "#{key}=#{base_json[key]}" }.join('&')
|
||||
hmac = OpenSSL::HMAC.hexdigest('sha1', KEY, hmac_string)
|
||||
base_json[:hmac] = hmac
|
||||
|
||||
base_json
|
||||
end
|
||||
|
||||
def valid_response_from_intermediary?
|
||||
return false unless response
|
||||
valid_hmac? && valid_amount? && valid_account?
|
||||
end
|
||||
|
||||
def settled_payment?
|
||||
SUCCESSFUL_PAYMENT.include?(response[:payment_state])
|
||||
end
|
||||
|
||||
def complete_transaction
|
||||
return unless valid_response_from_intermediary? && settled_payment?
|
||||
|
||||
transaction = BankTransaction.find_by(
|
||||
description: invoice.order,
|
||||
currency: invoice.currency,
|
||||
iban: invoice.seller_iban
|
||||
)
|
||||
|
||||
transaction.sum = response[:amount]
|
||||
transaction.paid_at = Date.strptime(response[:timestamp], '%s')
|
||||
transaction.buyer_name = response[:cc_holder_name]
|
||||
|
||||
transaction.save!
|
||||
transaction.autobind_invoice
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def base_params
|
||||
{
|
||||
api_username: USER,
|
||||
account_id: ACCOUNT_ID,
|
||||
timestamp: Time.now.to_i.to_s,
|
||||
callback_url: response_url,
|
||||
customer_url: return_url,
|
||||
amount: number_with_precision(invoice.total, precision: 2),
|
||||
order_reference: SecureRandom.hex(15),
|
||||
transaction_type: 'charge',
|
||||
hmac_fields: ''
|
||||
}.with_indifferent_access
|
||||
end
|
||||
|
||||
def valid_hmac?
|
||||
hmac_fields = response[:hmac_fields].split(',')
|
||||
hmac_hash = {}
|
||||
hmac_fields.map do |field|
|
||||
symbol = field.to_sym
|
||||
hmac_hash[symbol] = response[symbol]
|
||||
end
|
||||
|
||||
hmac_string = hmac_hash.map { |key, _v| "#{key}=#{hmac_hash[key]}" }.join('&')
|
||||
expected_hmac = OpenSSL::HMAC.hexdigest('sha1', KEY, hmac_string)
|
||||
expected_hmac == response[:hmac]
|
||||
end
|
||||
|
||||
def valid_amount?
|
||||
invoice.total == BigDecimal.new(response[:amount])
|
||||
end
|
||||
|
||||
def valid_account?
|
||||
response[:account_id] == ACCOUNT_ID
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,2 +1,23 @@
|
|||
class TechDomainContact < DomainContact
|
||||
# Audit log is needed, therefore no raw SQL
|
||||
def self.replace(current_contact, new_contact)
|
||||
affected_domains = []
|
||||
skipped_domains = []
|
||||
tech_contacts = where(contact: current_contact)
|
||||
|
||||
transaction do
|
||||
tech_contacts.each do |tech_contact|
|
||||
if tech_contact.domain.discarded?
|
||||
skipped_domains << tech_contact.domain.name
|
||||
next
|
||||
end
|
||||
|
||||
tech_contact.contact = new_contact
|
||||
tech_contact.save!
|
||||
affected_domains << tech_contact.domain.name
|
||||
end
|
||||
end
|
||||
|
||||
return affected_domains.sort, skipped_domains.sort
|
||||
end
|
||||
end
|
||||
|
|
|
@ -36,6 +36,7 @@ class WhoisRecord < ActiveRecord::Base
|
|||
registrant = domain.registrant
|
||||
|
||||
@disclosed = []
|
||||
h[:disclaimer] = disclaimer_text if disclaimer_text.present?
|
||||
h[:name] = domain.name
|
||||
h[:status] = domain.statuses.map { |x| status_map[x] || x }
|
||||
h[:registered] = domain.registered_at.try(:to_s, :iso8601)
|
||||
|
@ -120,4 +121,10 @@ class WhoisRecord < ActiveRecord::Base
|
|||
def destroy_whois_record
|
||||
Whois::Record.where(name: name).delete_all
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def disclaimer_text
|
||||
Setting.registry_whois_disclaimer
|
||||
end
|
||||
end
|
||||
|
|
|
@ -37,7 +37,7 @@ class DomainNameValidator < ActiveModel::EachValidator
|
|||
|
||||
def validate_blocked(value)
|
||||
return true unless value
|
||||
return false if BlockedDomain.where(name: value).count > 0
|
||||
return false if BlockedDomain.where(name: value).count.positive?
|
||||
DNS::Zone.where(origin: value).count.zero?
|
||||
end
|
||||
end
|
||||
|
|
|
@ -57,8 +57,9 @@
|
|||
%tbody
|
||||
- @versions.each do |version|
|
||||
- if version
|
||||
- contact = Contact.new(version.object.to_h)
|
||||
- version.object_changes.to_h.each { |k,v| contact.public_send("#{k}=", v.last) }
|
||||
- attributes = only_present_fields(version, Contact)
|
||||
- contact = Contact.new(attributes)
|
||||
- attach_existing_fields(version, contact)
|
||||
|
||||
%tr
|
||||
%td= link_to(contact.name, admin_contact_version_path(version.id))
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
- contact = Contact.new(@version.object.to_h)
|
||||
- @version.object_changes.to_h.each { |k,v| contact.public_send("#{k}=", v.last ) }
|
||||
- attributes = only_present_fields(@version, Contact)
|
||||
- contact = Contact.new(attributes)
|
||||
- attach_existing_fields(@version, contact)
|
||||
= render 'shared/title', name: contact.name
|
||||
|
||||
.row
|
||||
|
@ -41,11 +42,11 @@
|
|||
|
||||
%br
|
||||
|
||||
%dt= t(:created)
|
||||
%dt= t(:created_at)
|
||||
%dd{class: changing_css_class(@version,"created_at")}
|
||||
= l(contact.created_at, format: :short)
|
||||
|
||||
%dt= t(:updated)
|
||||
%dt= t(:updated_at)
|
||||
%dd{class: changing_css_class(@version,"updated_at")}
|
||||
= l(contact.updated_at, format: :short)
|
||||
|
||||
|
@ -61,7 +62,7 @@
|
|||
|
||||
- if contact.street.present?
|
||||
%dt= t(:street)
|
||||
%dd{class: changing_css_class(@version,"street")}= contact.street.to_s.gsub("\n", '<br>').html_safe
|
||||
%dd{class: changing_css_class(@version,"street")}= contact.street
|
||||
|
||||
- if contact.city.present?
|
||||
%dt= t(:city)
|
||||
|
|
|
@ -55,8 +55,9 @@
|
|||
%tbody
|
||||
- @versions.each do |version|
|
||||
- if version
|
||||
- domain = Domain.new(version.object.to_h)
|
||||
- version.object_changes.to_h.each{|k,v| domain.public_send("#{k}=", v.last) }
|
||||
- attributes = only_present_fields(version, Domain)
|
||||
- domain = Domain.new(attributes)
|
||||
- attach_existing_fields(version, domain)
|
||||
|
||||
%tr
|
||||
%td= link_to(domain.name, admin_domain_version_path(version.id))
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
- domain = Domain.new(@version.object.to_h)
|
||||
- @version.object_changes.to_h.each{|k,v| domain.public_send("#{k}=", v.last) }
|
||||
- present_fields = only_present_fields(@version, Domain)
|
||||
- domain = Domain.new(present_fields)
|
||||
- attach_existing_fields(@version, domain)
|
||||
|
||||
- if @version
|
||||
- children = HashWithIndifferentAccess.new(@version.children)
|
||||
|
|
|
@ -99,6 +99,7 @@
|
|||
= render 'setting_row', var: :registry_state
|
||||
= render 'setting_row', var: :registry_zip
|
||||
= render 'setting_row', var: :registry_country_code
|
||||
= render 'setting_row', var: :registry_whois_disclaimer
|
||||
|
||||
.row
|
||||
.col-md-12.text-right
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
<% if flash[:notice] %>
|
||||
<div class="alert alert-success alert-dismissible">
|
||||
<button class="close" data-dismiss="alert" type=button><span>×</span></button>
|
||||
<p><%= flash[:notice] %></p>
|
||||
<% if flash[:notice].respond_to?(:join) %>
|
||||
<p><%= flash[:notice].join('<br>').html_safe %></p>
|
||||
<% else %>
|
||||
<p><%= flash[:notice] %></p>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
|
@ -22,7 +22,7 @@ xml.epp_head do
|
|||
xml.tag!('domain:contact', ac.code, 'type' => 'admin')
|
||||
end
|
||||
|
||||
if @nameservers && @nameservers.any?
|
||||
if @nameservers&.any?
|
||||
xml.tag!('domain:ns') do
|
||||
@nameservers.each do |x|
|
||||
xml.tag!('domain:hostAttr') do
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
<%- if json['disclaimer'].present? -%>
|
||||
<%= json['disclaimer'].scan(/\S.{0,72}\S(?=\s|$)|\S+/).join("\n") %>
|
||||
<%- end -%>
|
||||
Estonia .ee Top Level Domain WHOIS server
|
||||
|
||||
Domain:
|
||||
|
@ -23,18 +26,18 @@ changed: <%= json['registrant_changed'].to_s.tr('T',' ').sub('+', ' +') %>
|
|||
<%- if json['admin_contacts'].present? -%>
|
||||
Administrative contact:
|
||||
<%- for contact in json['admin_contacts'] -%>
|
||||
name: <%= contact['name'] %>
|
||||
name: Not Disclosed
|
||||
email: Not Disclosed - Visit www.internet.ee for webbased WHOIS
|
||||
changed: <%= contact['changed'].to_s.tr('T',' ').sub('+', ' +') %>
|
||||
changed: Not Disclosed
|
||||
<%- end -%>
|
||||
|
||||
<%- end -%>
|
||||
<% if json['tech_contacts'].present? %>
|
||||
Technical contact:
|
||||
<%- for contact in json['tech_contacts'] -%>
|
||||
name: <%= contact['name'] %>
|
||||
name: Not Disclosed
|
||||
email: Not Disclosed - Visit www.internet.ee for webbased WHOIS
|
||||
changed: <%= contact['changed'].to_s.tr('T',' ').sub('+', ' +') %>
|
||||
changed: Not Disclosed
|
||||
<%- end -%>
|
||||
|
||||
<%- end -%>
|
||||
|
|
|
@ -1,54 +0,0 @@
|
|||
!!! 5
|
||||
%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(:registrant_head_title)
|
||||
= csrf_meta_tags
|
||||
= stylesheet_link_tag 'registrant-manifest', media: 'all'
|
||||
= favicon_link_tag 'favicon.ico'
|
||||
%body
|
||||
/ Fixed navbar
|
||||
%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 registrant_root_path, class: 'navbar-brand' do
|
||||
= t(:registrant_head_title)
|
||||
- if unstable_env.present?
|
||||
.text-center
|
||||
%small{style: 'color: #0074B3;'}= unstable_env
|
||||
- if current_user
|
||||
.navbar-collapse.collapse
|
||||
%ul.nav.navbar-nav.public-nav
|
||||
- if can? :view, Depp::Domain
|
||||
- active_class = %w(registrant/domains registrant/check registrant/renew registrant/tranfer registrant/keyrelays).include?(params[:controller]) ? 'active' :nil
|
||||
%li{class: active_class}= link_to t(:domains), registrant_domains_path
|
||||
|
||||
- active_class = %w(registrant/whois).include?(params[:controller]) ? 'active' :nil
|
||||
%li{class: active_class}= link_to t(:whois), registrant_whois_path
|
||||
|
||||
%ul.nav.navbar-nav.navbar-right
|
||||
- if user_signed_in?
|
||||
%li= link_to t(:log_out, user: current_user), '/registrant/logout'
|
||||
|
||||
.container
|
||||
= render 'shared/flash'
|
||||
= yield
|
||||
|
||||
%footer.footer
|
||||
.container
|
||||
.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
|
84
app/views/layouts/registrant/application.html.erb
Normal file
84
app/views/layouts/registrant/application.html.erb
Normal file
|
@ -0,0 +1,84 @@
|
|||
<!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(:registrant_head_title) %>
|
||||
</title>
|
||||
<% end %>
|
||||
<%= csrf_meta_tags %>
|
||||
<%= stylesheet_link_tag 'registrant-manifest', media: 'all' %>
|
||||
<%= favicon_link_tag 'favicon.ico' %>
|
||||
</head>
|
||||
<body>
|
||||
<!-- Fixed navbar
|
||||
-->
|
||||
<nav class="navbar navbar-default navbar-fixed-top">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button 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 registrant_root_path, class: 'navbar-brand' do %>
|
||||
<%= t(:registrant_head_title) %>
|
||||
<% if unstable_env.present? %>
|
||||
<div class="text-center">
|
||||
<small style="color: #0074B3;">
|
||||
<%= unstable_env %>
|
||||
</small>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% if current_user %>
|
||||
<div class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav public-nav">
|
||||
<% if can? :view, Depp::Domain %>
|
||||
<% active_class = %w(registrant/domains registrant/check registrant/renew registrant/tranfer registrant/keyrelays).include?(params[:controller]) ? 'active' :nil %>
|
||||
<li class="<%= active_class %>">
|
||||
<%= link_to t(:domains), registrant_domains_path %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% active_class = %w(registrant/whois).include?(params[:controller]) ? 'active' :nil %>
|
||||
<li class="<%= active_class %>">
|
||||
<%= link_to 'Internet.ee', 'https://internet.ee' %>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<% if user_signed_in? %>
|
||||
<li>
|
||||
<%= link_to t(:log_out, user: current_user), '/registrant/logout' %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</nav>
|
||||
<div class="container">
|
||||
<%= render 'shared/flash' %>
|
||||
<%= 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 'registrant-manifest', async: true %>
|
||||
</body>
|
||||
</html>
|
|
@ -18,7 +18,7 @@
|
|||
<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">
|
||||
<button 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>
|
||||
|
@ -39,7 +39,7 @@
|
|||
</div>
|
||||
</nav>
|
||||
<div class="container">
|
||||
<%= render 'shared/flash' %>
|
||||
<%= render 'flash_messages' %>
|
||||
<% if depp_controller? %>
|
||||
<%= render 'registrar/shared/epp_results' %>
|
||||
<% end %>
|
||||
|
|
|
@ -1,45 +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'
|
||||
= javascript_include_tag 'registrar-manifest'
|
||||
= 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', id: 'registrar-home-btn' do
|
||||
= t(:registrar_head_title)
|
||||
- if unstable_env.present?
|
||||
.text-center
|
||||
%small{style: 'color: #0074B3;'}= unstable_env
|
||||
- if current_user
|
||||
= 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
|
54
app/views/layouts/registrar/sessions.html.erb
Normal file
54
app/views/layouts/registrar/sessions.html.erb
Normal file
|
@ -0,0 +1,54 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="<%= locale %>">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<% 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' %>
|
||||
<%= javascript_include_tag 'registrar-manifest' %>
|
||||
</head>
|
||||
<body>
|
||||
<nav class="navbar navbar-default navbar-fixed-top">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<%= link_to registrar_root_path, class: 'navbar-brand',
|
||||
id: 'registrar-home-btn' do %>
|
||||
<%= t(:registrar_head_title) %>
|
||||
<% if unstable_env.present? %>
|
||||
<div class="text-center">
|
||||
<small style="color: #0074B3;">
|
||||
<%= unstable_env %>
|
||||
</small>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div class="container">
|
||||
<%= render 'flash_messages' %>
|
||||
<%= 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>
|
||||
</body>
|
||||
</html>
|
|
@ -8,7 +8,7 @@
|
|||
%dd= @contact.org_name
|
||||
|
||||
%dt= t(:street)
|
||||
%dd= @contact.street.to_s.gsub("\n", '<br>').html_safe
|
||||
%dd= @contact.street
|
||||
|
||||
%dt= t(:city)
|
||||
%dd= @contact.city
|
||||
|
|
34
app/views/registrar/bulk_change/_bulk_transfer_form.html.erb
Normal file
34
app/views/registrar/bulk_change/_bulk_transfer_form.html.erb
Normal file
|
@ -0,0 +1,34 @@
|
|||
<%= form_tag registrar_domain_transfers_path, multipart: true, class: 'form-horizontal' do %>
|
||||
<%= render 'registrar/domain_transfers/form/api_errors' %>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-md-2 control-label">
|
||||
<%= label_tag :batch_file %>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<%= file_field_tag :batch_file, required: true %>
|
||||
<span class="help-block"><%= t '.file_field_hint' %></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-md-4 col-md-offset-2 text-right">
|
||||
<button class="btn btn-warning">
|
||||
<%= t '.submit_btn' %>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-md-6">
|
||||
<a class="btn btn-default btn-xs" role="button" data-toggle="collapse"
|
||||
href="#bulk_change_bulk_transfer_help"><%= t '.help_btn' %>
|
||||
</a>
|
||||
<div class="collapse" id="bulk_change_bulk_transfer_help">
|
||||
<div class="well">
|
||||
<%= t '.help' %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
|
@ -1,12 +1,13 @@
|
|||
<%= form_tag registrar_update_registrar_nameserver_path, method: :put, class: 'form-horizontal' do %>
|
||||
<%= form_tag registrar_nameservers_path, method: :patch, class: 'form-horizontal' do %>
|
||||
<%= render 'registrar/domain_transfers/form/api_errors' %>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-md-2 control-label">
|
||||
<%= label_tag :old_hostname %>
|
||||
</div>
|
||||
|
||||
<div class="col-md-5">
|
||||
<%= text_field_tag :old_hostname, params[:old_hostname], autofocus: true,
|
||||
required: true,
|
||||
<div class="col-md-4">
|
||||
<%= text_field_tag :old_hostname, params[:old_hostname], required: true,
|
||||
class: 'form-control' %>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -16,7 +17,7 @@
|
|||
<%= label_tag :new_hostname %>
|
||||
</div>
|
||||
|
||||
<div class="col-md-5">
|
||||
<div class="col-md-4">
|
||||
<%= text_field_tag :new_hostname, params[:new_hostname], required: true,
|
||||
class: 'form-control' %>
|
||||
</div>
|
||||
|
@ -27,7 +28,7 @@
|
|||
<%= label_tag :ipv4 %>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="col-md-4">
|
||||
<%= text_area_tag :ipv4, params[:ipv4], class: 'form-control' %>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -37,17 +38,30 @@
|
|||
<%= label_tag :ipv6 %>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="col-md-4">
|
||||
<%= text_area_tag :ipv6, params[:ipv6], class: 'form-control' %>
|
||||
<span class="help-block"><%= t '.ip_hint' %></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-md-5 col-md-offset-2 text-right">
|
||||
<div class="col-md-4 col-md-offset-2 text-right">
|
||||
<button class="btn btn-warning">
|
||||
<%= t '.replace_btn' %>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-md-6">
|
||||
<a class="btn btn-default btn-xs" role="button" data-toggle="collapse"
|
||||
href="#bulk_change_nameserver_help"><%= t '.help_btn' %>
|
||||
</a>
|
||||
<div class="collapse" id="bulk_change_nameserver_help">
|
||||
<div class="well">
|
||||
<%= t '.help' %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
60
app/views/registrar/bulk_change/_tech_contact_form.html.erb
Normal file
60
app/views/registrar/bulk_change/_tech_contact_form.html.erb
Normal file
|
@ -0,0 +1,60 @@
|
|||
<%= form_tag registrar_tech_contacts_path, method: :patch, class: 'form-horizontal' do %>
|
||||
<% if @error %>
|
||||
<div class="alert alert-danger">
|
||||
<%= @error[:message] %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-md-2 control-label">
|
||||
<%= label_tag :current_contact_id, t('.current_contact_id') %>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<%= text_field_tag :current_contact_id, params[:current_contact_id],
|
||||
list: :contacts,
|
||||
required: true,
|
||||
autofocus: true,
|
||||
class: 'form-control' %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-md-2 control-label">
|
||||
<%= label_tag :new_contact_id, t('.new_contact_id') %>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<%= text_field_tag :new_contact_id, params[:new_contact_id],
|
||||
list: :contacts,
|
||||
required: true,
|
||||
class: 'form-control' %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-md-4 col-md-offset-2 text-right">
|
||||
<button class="btn btn-warning">
|
||||
<%= t '.submit_btn' %>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-md-6">
|
||||
<a class="btn btn-default btn-xs" role="button" data-toggle="collapse"
|
||||
href="#bulk_change_tech_contact_help"><%= t '.help_btn' %></a>
|
||||
<div class="collapse" id="bulk_change_tech_contact_help">
|
||||
<div class="well">
|
||||
<%= t '.help' %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<datalist id="contacts">
|
||||
<% available_contacts.each do |data| %>
|
||||
<option value="<%= data.second %>"><%= data.first %></option>
|
||||
<% end %>
|
||||
</datalist>
|
37
app/views/registrar/bulk_change/new.html.erb
Normal file
37
app/views/registrar/bulk_change/new.html.erb
Normal file
|
@ -0,0 +1,37 @@
|
|||
<ol class="breadcrumb">
|
||||
<li><%= link_to t('registrar.domains.index.header'), registrar_domains_path %></li>
|
||||
</ol>
|
||||
|
||||
<div class="page-header">
|
||||
<h1><%= t '.header' %></h1>
|
||||
</div>
|
||||
|
||||
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="<%= 'active' if active_tab == :technical_contact %>">
|
||||
<a href="#technical_contact" data-toggle="tab"><%= t '.technical_contact' %></a>
|
||||
</li>
|
||||
|
||||
<li class="<%= 'active' if active_tab == :nameserver %>">
|
||||
<a href="#nameserver" data-toggle="tab"><%= t '.nameserver' %></a>
|
||||
</li>
|
||||
|
||||
<li class="<%= 'active' if active_tab == :bulk_transfer %>">
|
||||
<a href="#bulk_transfer" data-toggle="tab"><%= t '.bulk_transfer' %></a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane<%= ' active' if active_tab == :technical_contact %>"
|
||||
id="technical_contact">
|
||||
<%= render 'tech_contact_form', available_contacts: available_contacts %>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane<%= ' active' if active_tab == :nameserver %>" id="nameserver">
|
||||
<%= render 'nameserver_form' %>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane<%= ' active' if active_tab == :bulk_transfer %>" id="bulk_transfer">
|
||||
<%= render 'bulk_transfer_form' %>
|
||||
</div>
|
||||
</div>
|
|
@ -1,4 +1,6 @@
|
|||
<%= form_tag registrar_domain_transfers_path, multipart: true, class: 'form-horizontal' do %>
|
||||
<%= render 'registrar/domain_transfers/form/api_errors' %>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-md-3 control-label">
|
||||
<%= label_tag :domain_name, nil, class: 'required' %>
|
||||
|
@ -30,7 +32,7 @@
|
|||
<div class="form-group">
|
||||
<div class="col-md-10 text-right">
|
||||
<button class="btn btn-warning">
|
||||
<%= t '.transfer_btn' %>
|
||||
<%= t '.submit_btn' %>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
|
@ -1,19 +0,0 @@
|
|||
<%= 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 %>
|
|
@ -6,24 +6,6 @@
|
|||
|
||||
<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>
|
||||
<%= render 'form' %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
<div class="page-header">
|
||||
<div class="row">
|
||||
<div class="col-sm-7">
|
||||
<div class="col-sm-5">
|
||||
<h1><%= t '.header' %></h1>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-5 text-right">
|
||||
<div class="col-sm-7 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' %>
|
||||
<%= link_to t('.replace_nameserver_btn'), registrar_edit_registrar_nameserver_path,
|
||||
<%= link_to t('.bulk_change_btn'), new_registrar_bulk_change_path,
|
||||
class: 'btn btn-default' %>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -24,22 +24,22 @@
|
|||
<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>
|
||||
<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 %>
|
||||
<%= render @domains %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
%h4= t(:pay_by_bank_link)
|
||||
%h4= t('registrar.invoices.pay_invoice')
|
||||
%hr
|
||||
- ENV['payments_banks'].split(",").each do |meth|
|
||||
|
||||
- locals[:payment_channels].each do |meth|
|
||||
- meth = meth.strip
|
||||
= link_to registrar_payment_with_path(meth, invoice_id: params[:id]) do
|
||||
= image_tag("#{meth}.png")
|
||||
|
|
|
@ -17,4 +17,4 @@
|
|||
|
||||
- if !@invoice.cancelled? && !@invoice.binded?
|
||||
.row.semifooter
|
||||
.col-md-12.text-right= render 'registrar/invoices/partials/banklinks'
|
||||
.col-md-6-offset-6.text-right= render 'registrar/invoices/partials/banklinks', locals: { payment_channels: PaymentOrders::PAYMENT_METHODS }
|
||||
|
|
|
@ -1,11 +1,14 @@
|
|||
.h3
|
||||
= t('registrar.invoices.redirected_to_intermediary')
|
||||
|
||||
.payment-form
|
||||
= form_tag @bank_link.url, method: :post do
|
||||
- @bank_link.fields.each do |k, v|
|
||||
= form_tag @payment.form_url, method: :post do
|
||||
- @payment.form_fields.each do |k, v|
|
||||
= hidden_field_tag k, v
|
||||
= submit_tag "Mine maksma"
|
||||
= submit_tag t('registrar.invoices.go_to_intermediary')
|
||||
|
||||
|
||||
:coffeescript
|
||||
load_listener = ->
|
||||
$('.payment-form form').submit()
|
||||
window.addEventListener 'load', load_listener
|
||||
:javascript
|
||||
function load_listener() {
|
||||
$('.payment-form form').submit();
|
||||
}
|
||||
window.addEventListener('load', load_listener)
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
<ol class="breadcrumb">
|
||||
<li><%= link_to t('registrar.domains.index.header'), registrar_domains_path %></li>
|
||||
</ol>
|
||||
|
||||
<div class="page-header">
|
||||
<h1><%= t '.header' %></h1>
|
||||
</div>
|
||||
|
||||
<%= render 'registrar/domain_transfers/form/api_errors' %>
|
||||
|
||||
<%= render 'form' %>
|
Loading…
Add table
Add a link
Reference in a new issue