Merge remote-tracking branch 'origin/master' into 110163446-confirm_emails

This commit is contained in:
Stas 2016-01-04 15:18:11 +02:00
commit 24862ba16d
45 changed files with 794 additions and 388 deletions

View file

@ -5,9 +5,7 @@ class Admin::PendingDeletesController < AdminController
def update def update
authorize! :update, :pending authorize! :update, :pending
@epp_domain = Epp::Domain.find(params[:domain_id]) # only epp domain has apply pending if registrant_verification.domain_registrant_delete_confirm!
@epp_domain.is_admin= true
if @epp_domain.apply_pending_delete!
redirect_to admin_domain_path(@domain.id), notice: t(:pending_applied) redirect_to admin_domain_path(@domain.id), notice: t(:pending_applied)
else else
redirect_to admin_edit_domain_path(@domain.id), alert: t(:failure) redirect_to admin_edit_domain_path(@domain.id), alert: t(:failure)
@ -17,7 +15,7 @@ class Admin::PendingDeletesController < AdminController
def destroy def destroy
authorize! :destroy, :pending authorize! :destroy, :pending
if @domain.clean_pendings! if registrant_verification.domain_registrant_delete_reject!
redirect_to admin_domain_path(@domain.id), notice: t(:pending_removed) redirect_to admin_domain_path(@domain.id), notice: t(:pending_removed)
else else
redirect_to admin_domain_path(@domain.id), alert: t(:failure) redirect_to admin_domain_path(@domain.id), alert: t(:failure)
@ -26,6 +24,14 @@ class Admin::PendingDeletesController < AdminController
private private
def registrant_verification
# steal token
token = @domain.registrant_verification_token
@registrant_verification = RegistrantVerification.new(domain_id: @domain.id,
domain_name: @domain.name,
verification_token: token)
end
def find_domain def find_domain
@domain = Domain.find(params[:domain_id]) @domain = Domain.find(params[:domain_id])
end end

View file

@ -5,8 +5,7 @@ class Admin::PendingUpdatesController < AdminController
def update def update
authorize! :update, :pending authorize! :update, :pending
@epp_domain = Epp::Domain.find(params[:domain_id]) # only epp domain has apply pending if registrant_verification.domain_registrant_change_confirm!
if @epp_domain.apply_pending_update!
redirect_to admin_domain_path(@domain.id), notice: t(:pending_applied) redirect_to admin_domain_path(@domain.id), notice: t(:pending_applied)
else else
redirect_to edit_admin_domain_path(@domain.id), alert: t(:failure) redirect_to edit_admin_domain_path(@domain.id), alert: t(:failure)
@ -15,14 +14,21 @@ class Admin::PendingUpdatesController < AdminController
def destroy def destroy
authorize! :destroy, :pending authorize! :destroy, :pending
if registrant_verification.domain_registrant_change_reject!
if @domain.clean_pendings!
redirect_to admin_domain_path(@domain.id), notice: t(:pending_removed) redirect_to admin_domain_path(@domain.id), notice: t(:pending_removed)
else else
redirect_to admin_domain_path(@domain.id), alert: t(:failure) redirect_to admin_domain_path(@domain.id), alert: t(:failure)
end end
end end
def registrant_verification
# steal token
token = @domain.registrant_verification_token
@registrant_verification = RegistrantVerification.new(domain_id: @domain.id,
domain_name: @domain.name,
verification_token: token)
end
private private
def find_domain def find_domain

View file

@ -67,8 +67,7 @@ class ApplicationController < ActionController::Base
end end
def user_log_str(user) def user_log_str(user)
return 'public' if user.nil? user.nil? ? 'public' : user.id_role_username
"#{user.id}-#{user.class}: #{user.username}"
end end
def comma_support_for(parent_key, key) def comma_support_for(parent_key, key)

View file

@ -29,11 +29,6 @@ class Epp::DomainsController < EppController
handle_errors(@domain) and return if @domain.errors.any? handle_errors(@domain) and return if @domain.errors.any?
handle_errors and return unless balance_ok?('create') # loads pricelist in this method handle_errors and return unless balance_ok?('create') # loads pricelist in this method
if !@domain_pricelist.try(:price)#checking if pricelist is not found
@domain.add_epp_error('2306', nil, nil, 'No price list for domain')
handle_errors(@domain) and return if @domain.errors.any?
end
ActiveRecord::Base.transaction do ActiveRecord::Base.transaction do
if @domain.save # TODO: Maybe use validate: false here because we have already validated the domain? if @domain.save # TODO: Maybe use validate: false here because we have already validated the domain?
current_user.registrar.debit!({ current_user.registrar.debit!({
@ -107,10 +102,6 @@ class Epp::DomainsController < EppController
period_unit = Epp::Domain.parse_period_unit_from_frame(params[:parsed_frame]) || 'y' period_unit = Epp::Domain.parse_period_unit_from_frame(params[:parsed_frame]) || 'y'
balance_ok?('renew', period, period_unit) # loading pricelist balance_ok?('renew', period, period_unit) # loading pricelist
if !@domain_pricelist.try(:price)#checking if pricelist is not found
@domain.add_epp_error('2306', nil, nil, 'No price list for domain')
handle_errors(@domain) and return if @domain.errors.any?
end
ActiveRecord::Base.transaction do ActiveRecord::Base.transaction do
success = @domain.renew( success = @domain.renew(
@ -258,12 +249,19 @@ class Epp::DomainsController < EppController
def balance_ok?(operation, period = nil, unit = nil) def balance_ok?(operation, period = nil, unit = nil)
@domain_pricelist = @domain.pricelist(operation, period.try(:to_i), unit) @domain_pricelist = @domain.pricelist(operation, period.try(:to_i), unit)
if current_user.registrar.balance < @domain_pricelist.price.amount if @domain_pricelist.try(:price) # checking if price list is not found
if current_user.registrar.balance < @domain_pricelist.price.amount
epp_errors << {
code: '2104',
msg: I18n.t('billing_failure_credit_balance_low')
}
return false
end
else
epp_errors << { epp_errors << {
code: '2104', code: '2104',
msg: I18n.t('billing_failure_credit_balance_low') msg: I18n.t(:active_price_missing_for_this_operation)
} }
return false return false
end end
true true

View file

@ -3,18 +3,61 @@ class Registrar::ContactsController < Registrar::DeppController # EPP controller
def index def index
authorize! :view, Depp::Contact authorize! :view, Depp::Contact
limit, offset = pagination_details
res = depp_current_user.repp_request('contacts', { details: true, limit: limit, offset: offset }) params[:q] ||= {}
if res.code == '200' params[:q].delete_if { |_k, v| v.blank? }
@response = res.parsed_body.with_indifferent_access if params[:q].length == 1 && params[:q][:name_matches].present?
@contacts = @response ? @response[:contacts] : [] @contacts = Contact.find_by(name: params[:q][:name_matches])
@paginatable_array = Kaminari.paginate_array(
[], total_count: @response[:total_number_of_records]
).page(params[:page]).per(limit)
end end
flash.now[:epp_results] = [{ 'code' => res.code, 'msg' => res.message }]
if params[:statuses_contains]
contacts = current_user.registrar.contacts.includes(:registrar).where(
"contacts.statuses @> ?::varchar[]", "{#{params[:statuses_contains].join(',')}}"
)
else
contacts = current_user.registrar.contacts.includes(:registrar)
end
normalize_search_parameters do
@q = contacts.search(params[:q])
@contacts = @q.result.page(params[:page])
end
@contacts = @contacts.per(params[:results_per_page]) if params[:results_per_page].to_i > 0
end
def download_list
authorize! :view, Depp::Contact
params[:q] ||= {}
params[:q].delete_if { |_k, v| v.blank? }
if params[:q].length == 1 && params[:q][:name_matches].present?
@contacts = Contact.find_by(name: params[:q][:name_matches])
end
if params[:statuses_contains]
contacts = current_user.registrar.contacts.includes(:registrar).where(
"contacts.statuses @> ?::varchar[]", "{#{params[:statuses_contains].join(',')}}"
)
else
contacts = current_user.registrar.contacts.includes(:registrar)
end
normalize_search_parameters do
@q = contacts.search(params[:q])
@contacts = @q.result.page(params[:page])
end
@contacts = @contacts.per(params[:results_per_page]) if params[:results_per_page].to_i > 0
respond_to do |format|
format.csv { render text: @contacts.to_csv }
format.pdf do
pdf = @contacts.pdf(render_to_string('registrar/contacts/download_list', layout: false))
send_data pdf, filename: 'contacts.pdf'
end
end
end end
def new def new
@ -75,4 +118,18 @@ class Registrar::ContactsController < Registrar::DeppController # EPP controller
def init_epp_contact def init_epp_contact
Depp::Contact.user = depp_current_user Depp::Contact.user = depp_current_user
end end
def normalize_search_parameters
ca_cache = params[:q][:valid_to_lteq]
begin
end_time = params[:q][:valid_to_lteq].try(:to_date)
params[:q][:valid_to_lteq] = end_time.try(:end_of_day)
rescue
logger.warn('Invalid date')
end
yield
params[:q][:valid_to_lteq] = ca_cache
end
end end

View file

@ -10,8 +10,9 @@ class DomainUpdateConfirmJob < Que::Job
e.instance_variable_set("@changed_attributes", e.changed_attributes.merge("statuses"=>[])) e.instance_variable_set("@changed_attributes", e.changed_attributes.merge("statuses"=>[]))
end end
domain.clean_pendings! domain.clean_pendings!
WhoisRecord.find_by(domain_id: domain.id).save
when RegistrantVerification::REJECTED when RegistrantVerification::REJECTED
DomainMailer.pending_update_rejected_notification_for_new_registrant(domain_id).deliver domain.send_mail :pending_update_rejected_notification_for_new_registrant
domain.poll_message!(:poll_pending_update_rejected_by_registrant) domain.poll_message!(:poll_pending_update_rejected_by_registrant)
domain.clean_pendings! domain.clean_pendings!
domain.instance_variable_set("@changed_attributes", domain.changed_attributes.merge("statuses"=>[])) domain.instance_variable_set("@changed_attributes", domain.changed_attributes.merge("statuses"=>[]))

View file

@ -1,109 +1,28 @@
class DomainMailer < ApplicationMailer class DomainMailer < ApplicationMailer
include Que::Mailer include Que::Mailer
def pending_update_request_for_old_registrant(domain_id, old_registrant_id, should_deliver) def pending_update_request_for_old_registrant(params)
@domain = Domain.find_by(id: domain_id) compose_from(params)
@old_registrant = Registrant.find(old_registrant_id)
return unless @domain
return if delivery_off?(@domain, should_deliver)
if @domain.registrant_verification_token.blank?
logger.warn "EMAIL NOT DELIVERED: registrant_verification_token is missing for #{@domain.name}"
return
end
if @domain.registrant_verification_asked_at.blank?
logger.warn "EMAIL NOT DELIVERED: registrant_verification_asked_at is missing for #{@domain.name}"
return
end
confirm_path = "#{ENV['registrant_url']}/registrant/domain_update_confirms"
@verification_url = "#{confirm_path}/#{@domain.id}?token=#{@domain.registrant_verification_token}"
return if whitelist_blocked?(@old_registrant.email)
mail(to: format(@old_registrant.email),
subject: "#{I18n.t(:pending_update_request_for_old_registrant_subject,
name: @domain.name)} [#{@domain.name}]")
end end
def pending_update_notification_for_new_registrant(domain_id, old_registrant_id, should_deliver) def pending_update_notification_for_new_registrant(params)
@domain = Domain.find_by(id: domain_id) compose_from(params)
@old_registrant = Registrant.find(old_registrant_id)
return unless @domain
return if delivery_off?(@domain, should_deliver)
if @domain.registrant_verification_token.blank?
logger.warn "EMAIL NOT DELIVERED: registrant_verification_token is missing for #{@domain.name}"
return
end
if @domain.registrant_verification_asked_at.blank?
logger.warn "EMAIL NOT DELIVERED: registrant_verification_asked_at is missing for #{@domain.name}"
return
end
@new_registrant = @domain.registrant # NB! new registrant at this point
return if whitelist_blocked?(@new_registrant.email)
mail(to: format(@new_registrant.email),
subject: "#{I18n.t(:pending_update_notification_for_new_registrant_subject,
name: @domain.name)} [#{@domain.name}]")
end end
def registrant_updated_notification_for_new_registrant(domain_id, should_deliver) def registrant_updated_notification_for_new_registrant(params)
@domain = Domain.find_by(id: domain_id) compose_from(params)
return unless @domain
return if delivery_off?(@domain, should_deliver)
return if whitelist_blocked?(@domain.registrant_email)
mail(to: format(@domain.registrant_email),
subject: "#{I18n.t(:registrant_updated_notification_for_new_registrant_subject,
name: @domain.name)} [#{@domain.name}]")
end end
def registrant_updated_notification_for_old_registrant(domain_id, should_deliver) def registrant_updated_notification_for_old_registrant(params)
domain = Domain.find_by(id: domain_id) compose_from(params)
return unless domain
return if delivery_off?(@domain, should_deliver)
@old_registrant_email = domain.registrant_email # Nb! before applying pending updates
return if whitelist_blocked?(@old_registrant_email)
mail(to: format(@old_registrant_email),
subject: "#{I18n.t(:registrant_updated_notification_for_old_registrant_subject,
name: @domain.name)} [#{@domain.name}]")
end end
def pending_update_rejected_notification_for_new_registrant(domain_id) def pending_update_rejected_notification_for_new_registrant(params)
@domain = Domain.find_by(id: domain_id) compose_from(params)
return unless @domain
# no delivery off control, driggered by que, no epp request
@new_registrant_email = @domain.pending_json['new_registrant_email']
@new_registrant_name = @domain.pending_json['new_registrant_name']
return if whitelist_blocked?(@new_registrant_email)
mail(to: format(@new_registrant_email),
subject: "#{I18n.t(:pending_update_rejected_notification_for_new_registrant_subject,
name: @domain.name)} [#{@domain.name}]")
end end
def pending_update_expired_notification_for_new_registrant(domain_id) def pending_update_expired_notification_for_new_registrant(params)
@domain = Domain.find_by(id: domain_id) compose_from(params)
return unless @domain
# no delivery off control, driggered by cron, no epp request
@new_registrant_email = @domain.pending_json['new_registrant_email']
@new_registrant_name = @domain.pending_json['new_registrant_name']
return if whitelist_blocked?(@new_registrant_email)
if @new_registrant_email.blank?
logger.info "EMAIL NOT DELIVERED: no registrant email [pending_update_expired_notification_for_new_registrant]"
return
end
mail(to: format(@new_registrant_email),
subject: "#{I18n.t(:pending_update_expired_notification_for_new_registrant_subject,
name: @domain.name)} [#{@domain.name}]")
end end
def pending_deleted(domain_id, old_registrant_id, should_deliver) def pending_deleted(domain_id, old_registrant_id, should_deliver)
@ -197,4 +116,18 @@ class DomainMailer < ApplicationMailer
subject: "#{I18n.t(:force_delete_subject)}" subject: "#{I18n.t(:force_delete_subject)}"
) )
end end
private
# app/models/DomainMailModel provides the data for mail that can be composed_from
# which ensures that values of objects are captured when they are valid, not later when this method is executed
def compose_from(params)
@params = params
return if delivery_off?(params, params[:deliver_emails])
return if whitelist_blocked?(params[:recipient])
params[:errors].map do |error|
logger.warn error
return
end
mail(to: params[:recipient], subject: params[:subject])
end
end end

View file

@ -1,23 +1,30 @@
module UserEvents module UserEvents
extend ActiveSupport::Concern extend ActiveSupport::Concern
# TODO: remove old included do
# module ClassMethods # EPP requires a server defined creator ID, which should be registrar code if we have one
# def registrar_events(id) def cr_id
# registrar = Registrar.find(id) # try this, rebuild user for registrar before searching history? really?
# return [] unless registrar registrar = self.creator.try(:registrar)
# @events = [] if registrar.present? # Did creator return a kind of User that has a registrar?
# registrar.users.each { |user| @events << user_events(user.id) } registrar.code
# registrar.epp_users.each { |user| @events << epp_user_events(user.id) } else
# @events if self.versions.first.try(:object).nil?
# end changes = self.versions.first.try(:object_changes)
cr_registrar_id = changes['registrar_id'].second if changes.present?
else
# untested, expected never to execute
cr_registrar_id = self.versions.first.object['registrar_id']
end
# def user_events(id) if cr_registrar_id.present?
# where(whodunnit: id.to_s) Registrar.find(cr_registrar_id).code
# end else
# cr_id optional for domain, but required for contact; but we want something here anyway
self.creator_str # Fallback if we failed, maybe we can find a string here
end
end
end
end
# def epp_user_events(id)
# where(whodunnit: "#{id}-EppUser")
# end
# end
end end

View file

@ -22,32 +22,30 @@ module Versions
def creator def creator
return nil if creator_str.blank? return nil if creator_str.blank?
creator = user_from_id_role_username creator_str
if creator_str =~ /^\d+-AdminUser:/
creator = AdminUser.find_by(id: creator_str)
elsif creator_str =~ /^\d+-ApiUser:/
creator = ApiUser.find_by(id: creator_str)
elsif creator_str =~ /^\d+-api-/ # depricated
creator = ApiUser.find_by(id: creator_str)
end
creator.present? ? creator : creator_str creator.present? ? creator : creator_str
end end
def updator def updator
return nil if updator_str.blank? return nil if updator_str.blank?
updator = user_from_id_role_username updator_str
if updator_str =~ /^\d+-AdminUser:/
updator = AdminUser.find_by(id: updator_str)
elsif updator_str =~ /^\d+-ApiUser:/
updator = ApiUser.find_by(id: updator_str)
elsif updator_str =~ /^\d+-api-/ # depricated
updator = ApiUser.find_by(id: updator_str)
end
updator.present? ? updator : updator_str updator.present? ? updator : updator_str
end end
def user_from_id_role_username(str)
user = ApiUser.find_by(id: $1) if str =~ /^(\d+)-(ApiUser:|api-)/
unless user.present?
user = AdminUser.find_by(id: $1) if str =~ /^(\d+)-AdminUser:/
unless user.present?
# on import we copied Registrar name, which may eql code
registrar = Registrar.find_by(name: str)
# assume each registrar has only one user
user = registrar.api_users.first if registrar
end
end
user
end
# callbacks # callbacks
def touch_domain_version def touch_domain_version
domain.try(:touch_with_version) domain.try(:touch_with_version)

View file

@ -1,6 +1,7 @@
class Contact < ActiveRecord::Base class Contact < ActiveRecord::Base
include Versions # version/contact_version.rb include Versions # version/contact_version.rb
include EppErrors include EppErrors
include UserEvents
belongs_to :registrar belongs_to :registrar
has_many :domain_contacts has_many :domain_contacts
@ -57,6 +58,11 @@ class Contact < ActiveRecord::Base
before_save :manage_statuses before_save :manage_statuses
def manage_statuses def manage_statuses
if domain_transfer # very ugly but need better workflow
self.statuses = statuses | [OK, LINKED]
return
end
manage_linked manage_linked
manage_ok manage_ok
end end
@ -80,6 +86,7 @@ class Contact < ActiveRecord::Base
] ]
attr_accessor :deliver_emails attr_accessor :deliver_emails
attr_accessor :domain_transfer # hack but solves problem faster
# #
# STATUSES # STATUSES
@ -203,6 +210,21 @@ class Contact < ActiveRecord::Base
['DeleteProhibited', SERVER_DELETE_PROHIBITED] ['DeleteProhibited', SERVER_DELETE_PROHIBITED]
] ]
end end
def to_csv
CSV.generate do |csv|
csv << column_names
all.each do |contact|
csv << contact.attributes.values_at(*column_names)
end
end
end
def pdf(html)
kit = PDFKit.new(html)
kit.to_pdf
end
end end
def roid def roid
@ -472,7 +494,7 @@ class Contact < ActiveRecord::Base
end end
def update_related_whois_records def update_related_whois_records
related_domain_descriptions.each{ |x, y| WhoisRecord.find_by(name: x).save} related_domain_descriptions.each{ |x, y| WhoisRecord.find_by(name: x).try(:save) }
end end
end end

View file

@ -152,23 +152,17 @@ module Depp
} }
end end
data.css('dsData').each_with_index do |x, i| data.css('keyData').each_with_index do |x, i|
ds = { ret[:dnskeys_attributes][i] = {
ds_key_tag: x.css('keyTag').first.try(:text), flags: x.css('flags').text,
ds_alg: x.css('alg').first.try(:text), protocol: x.css('protocol').text,
ds_digest_type: x.css('digestType').first.try(:text), alg: x.css('alg').text,
ds_digest: x.css('digest').first.try(:text) public_key: x.css('pubKey').text,
ds_key_tag: x.css('keyTag').first.try(:text),
ds_alg: x.css('alg').first.try(:text),
ds_digest_type: x.css('digestType').first.try(:text),
ds_digest: x.css('digest').first.try(:text)
} }
kd = x.css('keyData').first
ds.merge!({
flags: kd.css('flags').first.try(:text),
protocol: kd.css('protocol').first.try(:text),
alg: kd.css('alg').first.try(:text),
public_key: kd.css('pubKey').first.try(:text)
}) if kd
ret[:dnskeys_attributes][i] = ds
end end
data.css('status').each_with_index do |x, i| data.css('status').each_with_index do |x, i|

View file

@ -1,5 +1,6 @@
# rubocop: disable Metrics/ClassLength # rubocop: disable Metrics/ClassLength
class Domain < ActiveRecord::Base class Domain < ActiveRecord::Base
include UserEvents
include Versions # version/domain_version.rb include Versions # version/domain_version.rb
include Statuses include Statuses
has_paper_trail class_name: "DomainVersion", meta: { children: :children_log } has_paper_trail class_name: "DomainVersion", meta: { children: :children_log }
@ -238,10 +239,10 @@ class Domain < ActiveRecord::Base
end end
count += 1 count += 1
if domain.pending_update? if domain.pending_update?
DomainMailer.pending_update_expired_notification_for_new_registrant(domain.id).deliver domain.send_mail :pending_update_expired_notification_for_new_registrant
end end
if domain.pending_delete? || domain.pending_delete_confirmation? if domain.pending_delete? || domain.pending_delete_confirmation?
DomainMailer.pending_delete_expired_notification(domain.id, deliver_emails).deliver DomainMailer.pending_delete_expired_notification(domain.id, true).deliver
end end
domain.clean_pendings! domain.clean_pendings!
unless Rails.env.test? unless Rails.env.test?
@ -307,7 +308,7 @@ class Domain < ActiveRecord::Base
c = 0 c = 0
Domain.where("statuses @> '{deleteCandidate}'::varchar[]").each do |x| Domain.where("statuses @> '{deleteCandidate}'::varchar[]").each do |x|
Whois::Record.where('domain_id = ?', x.id).try(':destroy') WhoisRecord.where(domain_id: x.id).destroy_all
destroy_with_message x destroy_with_message x
STDOUT << "#{Time.zone.now.utc} Domain.destroy_delete_candidates: by deleteCandidate ##{x.id} (#{x.name})\n" unless Rails.env.test? STDOUT << "#{Time.zone.now.utc} Domain.destroy_delete_candidates: by deleteCandidate ##{x.id} (#{x.name})\n" unless Rails.env.test?
@ -315,7 +316,7 @@ class Domain < ActiveRecord::Base
end end
Domain.where('force_delete_at <= ?', Time.zone.now).each do |x| Domain.where('force_delete_at <= ?', Time.zone.now).each do |x|
Whois::Record.where('domain_id = ?', x.id).try(':destroy') WhoisRecord.where(domain_id: x.id).destroy_all
destroy_with_message x destroy_with_message x
STDOUT << "#{Time.zone.now.utc} Domain.destroy_delete_candidates: by force delete time ##{x.id} (#{x.name})\n" unless Rails.env.test? STDOUT << "#{Time.zone.now.utc} Domain.destroy_delete_candidates: by force delete time ##{x.id} (#{x.name})\n" unless Rails.env.test?
c += 1 c += 1
@ -439,7 +440,6 @@ class Domain < ActiveRecord::Base
end end
def pending_update! def pending_update!
old_registrant_id = registrant_id_was
return true if pending_update? return true if pending_update?
self.epp_pending_update = true # for epp self.epp_pending_update = true # for epp
@ -451,8 +451,8 @@ class Domain < ActiveRecord::Base
new_registrant_email = registrant.email new_registrant_email = registrant.email
new_registrant_name = registrant.name new_registrant_name = registrant.name
DomainMailer.pending_update_request_for_old_registrant(id, old_registrant_id, deliver_emails).deliver send_mail :pending_update_request_for_old_registrant
DomainMailer.pending_update_notification_for_new_registrant(id, old_registrant_id, deliver_emails).deliver send_mail :pending_update_notification_for_new_registrant
reload # revert back to original reload # revert back to original
@ -818,5 +818,10 @@ class Domain < ActiveRecord::Base
status_notes[status] = notes[i] status_notes[status] = notes[i]
end end
end end
def send_mail(action)
DomainMailer.send(action, DomainMailModel.new(self).send(action)).deliver
end
end end
# rubocop: enable Metrics/ClassLength # rubocop: enable Metrics/ClassLength

View file

@ -0,0 +1,180 @@
class DomainMailModel
# Capture current values used in app/views/mailers/domain_mailer/* and app/mailers/domain_mailer will send later
def initialize(domain)
@domain = domain
@params = {errors: [], deliver_emails: domain.deliver_emails, id: domain.id}
end
def pending_update_request_for_old_registrant
registrant_old
subject(:pending_update_request_for_old_registrant_subject)
confirm_update
domain_info
compose
end
def pending_update_notification_for_new_registrant
registrant # new registrant at this point
subject(:pending_update_notification_for_new_registrant_subject)
domain_info
compose
end
def registrant_updated_notification_for_new_registrant
registrant
subject(:registrant_updated_notification_for_new_registrant_subject)
domain_info
compose
end
def registrant_updated_notification_for_old_registrant
registrant_pending
registrant_old
subject(:registrant_updated_notification_for_old_registrant_subject)
new_registrant = Registrant.find @domain.pending_json['new_registrant_id']
@params[:registrant_name] = new_registrant.name
@params[:registrant_ident] = new_registrant.ident
@params[:registrant_priv] = new_registrant.priv?
@params[:registrant_email] = new_registrant.email
@params[:registrant_street] = new_registrant.street
@params[:registrant_city] = new_registrant.city
@params[:registrant_country] = new_registrant.country.name
compose
end
def pending_update_rejected_notification_for_new_registrant
registrant_pending
subject(:pending_update_rejected_notification_for_new_registrant_subject)
@params[:deliver_emails] = true # triggered from que
@params[:registrar_name] = @domain.registrar.name
compose
end
def pending_update_expired_notification_for_new_registrant
registrant_pending
subject(:pending_update_expired_notification_for_new_registrant_subject)
domain_info
compose
end
def pending_deleted
registrant
subject(:domain_pending_deleted_subject)
confirm_delete
compose
end
def pending_delete_rejected_notification
registrant
subject(:pending_delete_rejected_notification_subject)
compose
end
def pending_delete_expired_notification
registrant
subject(:pending_delete_expired_notification_subject)
compose
end
def delete_confirmation
registrant
subject(:delete_confirmation_subject)
compose
end
def force_delete
admins
subject(:force_delete_subject)
compose
end
private
def registrant_old
@params[:recipient] = format Registrant.find(@domain.registrant_id_was).email
end
def registrant
@params[:recipient] = format @domain.registrant.email
end
def registrant_pending
@params[:recipient] = format @domain.pending_json['new_registrant_email']
@params[:new_registrant_name] = @domain.pending_json['new_registrant_name']
@params[:old_registrant_name] = @domain.registrant.name
end
# registrant and domain admin contacts
def admins
emails = ([@domain.registrant.email] + @domain.admin_contacts.map { |x| format(x.email) })
@params[:recipient] = emails.uniq.map { |x| format(x) }
end
# puny internet domain name, TODO: username<email>
def format(email)
return warn_no_email if email.nil?
user, host = email.split('@')
host = SimpleIDN.to_ascii(host)
"#{user}@#{host}"
end
def subject(subject)
@params[:name] = @domain.name
@params[:subject] = "#{I18n.t(subject, name: @domain.name)}, [#{@domain.name}]"
end
def confirm_update
verification_url('domain_update_confirms')
end
def confirm_delete
verification_url('domain_delete_confirms')
end
def compose
@params
end
def verification_url(path)
token = verification_token or return
@params[:verification_url] = "#{ENV['registrant_url']}/registrant/#{path}/#{@domain.id}?token=#{token}"
end
def verification_token
return warn_missing(:registrant_verification_token) if @domain.registrant_verification_token.blank?
return warn_missing(:registrant_verification_asked_at) if @domain.registrant_verification_asked_at.blank?
@domain.registrant_verification_token
end
def domain_info
[:name, :registrar_name,
:registrant_name, :registrant_ident, :registrant_email,
:registrant_street,:registrant_city
].each do |attr|
@params.store attr, @domain.send(attr)
end
@params.store :registrant_country, @domain.registrant_country.name
@params.store :registrant_priv, @domain.registrant.priv?
@params.store :old_registrant_name, Registrant.find(@domain.registrant_id_was).name
@params
end
def warn_no_email(item = 'email')
warn_missing item
nil
end
def warn_missing(item)
warn_not_delivered "#{item.to_s} is missing for #{@domain.name}"
end
def warn_not_delivered(reason)
message = "EMAIL NOT DELIVERED: #{reason}"
@params[:errors] << message
# Rails.logger.warn message
nil
end
end

View file

@ -3,10 +3,12 @@ class Epp::Domain < Domain
include EppErrors include EppErrors
# TODO: remove this spagetti once data in production is correct. # TODO: remove this spagetti once data in production is correct.
attr_accessor :is_renewal attr_accessor :is_renewal, :is_transfer
before_validation :manage_permissions before_validation :manage_permissions
def manage_permissions def manage_permissions
return if is_admin # this bad hack for 109086524, refactor later
return true if is_transfer
return unless update_prohibited? || delete_prohibited? return unless update_prohibited? || delete_prohibited?
add_epp_error('2304', nil, nil, I18n.t(:object_status_prohibits_operation)) add_epp_error('2304', nil, nil, I18n.t(:object_status_prohibits_operation))
false false
@ -14,7 +16,7 @@ class Epp::Domain < Domain
after_validation :validate_contacts after_validation :validate_contacts
def validate_contacts def validate_contacts
return true if is_renewal return true if is_renewal || is_transfer
ok = true ok = true
active_admins = admin_domain_contacts.select { |x| !x.marked_for_destruction? } active_admins = admin_domain_contacts.select { |x| !x.marked_for_destruction? }
@ -500,18 +502,23 @@ class Epp::Domain < Domain
# rubocop: enable Metrics/CyclomaticComplexity # rubocop: enable Metrics/CyclomaticComplexity
def apply_pending_update! def apply_pending_update!
old_registrant_email = DomainMailer.registrant_updated_notification_for_old_registrant(id, deliver_emails)
preclean_pendings preclean_pendings
user = ApiUser.find(pending_json['current_user_id']) user = ApiUser.find(pending_json['current_user_id'])
frame = Nokogiri::XML(pending_json['frame']) frame = Nokogiri::XML(pending_json['frame'])
self.deliver_emails = true # turn on email delivery
send_mail :registrant_updated_notification_for_old_registrant
statuses.delete(DomainStatus::PENDING_UPDATE) statuses.delete(DomainStatus::PENDING_UPDATE)
yield(self) if block_given? # need to skip statuses check here yield(self) if block_given? # need to skip statuses check here
self.save
::PaperTrail.whodunnit = user.id_role_username # updator str should be the request originator not the approval user
return unless update(frame, user, false) return unless update(frame, user, false)
clean_pendings! clean_pendings!
self.deliver_emails = true # turn on email delivery
DomainMailer.registrant_updated_notification_for_new_registrant(id, deliver_emails).deliver send_mail :registrant_updated_notification_for_new_registrant
old_registrant_email.deliver update_whois_record
true true
end end
@ -592,6 +599,8 @@ class Epp::Domain < Domain
# rubocop: disable Metrics/CyclomaticComplexity # rubocop: disable Metrics/CyclomaticComplexity
def transfer(frame, action, current_user) def transfer(frame, action, current_user)
@is_transfer = true
case action case action
when 'query' when 'query'
return domain_transfers.last if domain_transfers.any? return domain_transfers.last if domain_transfers.any?
@ -619,6 +628,7 @@ class Epp::Domain < Domain
oc.registrar_id = registrar_id oc.registrar_id = registrar_id
oc.copy_from_id = c.id oc.copy_from_id = c.id
oc.prefix_code oc.prefix_code
oc.domain_transfer = true
oc.save!(validate: false) oc.save!(validate: false)
oc oc
end end

View file

@ -17,7 +17,8 @@ class Invoice < ActiveRecord::Base
validates :invoice_type, :due_date, :currency, :seller_name, validates :invoice_type, :due_date, :currency, :seller_name,
:seller_iban, :buyer_name, :invoice_items, :vat_prc, presence: true :seller_iban, :buyer_name, :invoice_items, :vat_prc, presence: true
before_create :set_invoice_number before_create :set_invoice_number, :check_vat
def set_invoice_number def set_invoice_number
last_no = Invoice.order(number: :desc).where('number IS NOT NULL').limit(1).pluck(:number).first last_no = Invoice.order(number: :desc).where('number IS NOT NULL').limit(1).pluck(:number).first
@ -34,6 +35,12 @@ class Invoice < ActiveRecord::Base
false false
end end
def check_vat
if buyer.country_code != 'EE' && buyer.vat_no.present?
self.vat_prc = 0
end
end
before_save -> { self.sum_cache = sum } before_save -> { self.sum_cache = sum }
class << self class << self

View file

@ -31,7 +31,7 @@ class Pricelist < ActiveRecord::Base
def pricelist_for(zone, operation, period) def pricelist_for(zone, operation, period)
lists = valid.where(category: zone, operation_category: operation, duration: period) lists = valid.where(category: zone, operation_category: operation, duration: period)
return lists.first if lists.count == 1 return lists.first if lists.count == 1
lists.where('valid_to IS NOT NULL').order(valid_from: :desc).first lists.order(valid_from: :desc).first
end end
end end
end end

View file

@ -12,7 +12,6 @@ class RegistrantVerification < ActiveRecord::Base
belongs_to :domain belongs_to :domain
validates :verification_token, :domain_name, :domain, :action, :action_type, presence: true validates :verification_token, :domain_name, :domain, :action, :action_type, presence: true
validates :domain, uniqueness: { scope: [:domain_id, :verification_token] }
def domain_registrant_change_confirm! def domain_registrant_change_confirm!
self.action_type = DOMAIN_REGISTRANT_CHANGE self.action_type = DOMAIN_REGISTRANT_CHANGE

View file

@ -3,4 +3,9 @@ class User < ActiveRecord::Base
devise :trackable, :timeoutable devise :trackable, :timeoutable
attr_accessor :phone attr_accessor :phone
def id_role_username
"#{self.id}-#{self.class}: #{self.username}"
end
end end

View file

@ -3,7 +3,5 @@ class ContactVersion < PaperTrail::Version
self.table_name = :log_contacts self.table_name = :log_contacts
self.sequence_name = :log_contacts_id_seq self.sequence_name = :log_contacts_id_seq
# include UserEvents
# scope :deleted, -> { where(event: 'destroy') } # scope :deleted, -> { where(event: 'destroy') }
end end

View file

@ -4,7 +4,5 @@ class DomainVersion < PaperTrail::Version
self.table_name = :log_domains self.table_name = :log_domains
self.sequence_name = :log_domains_id_seq self.sequence_name = :log_domains_id_seq
include UserEvents
scope :deleted, -> { where(event: 'destroy') } scope :deleted, -> { where(event: 'destroy') }
end end

View file

@ -23,6 +23,10 @@ class WhoisRecord < ActiveRecord::Base
end end
end end
def self.find_by_name(name)
WhoisRecord.where("lower(name) = ?", name.downcase)
end
def generated_json def generated_json
@generated_json ||= generate_json @generated_json ||= generate_json
end end
@ -44,7 +48,7 @@ class WhoisRecord < ActiveRecord::Base
h[:changed] = domain.updated_at.try(:to_s, :iso8601) h[:changed] = domain.updated_at.try(:to_s, :iso8601)
h[:expire] = domain.valid_to.try(:to_date).try(:to_s) h[:expire] = domain.valid_to.try(:to_date).try(:to_s)
h[:outzone] = domain.outzone_at.try(:to_date).try(:to_s) h[:outzone] = domain.outzone_at.try(:to_date).try(:to_s)
h[:delete] = domain.delete_at.try(:to_date).try(:to_s) h[:delete] = [domain.delete_at, domain.force_delete_at].compact.min.try(:to_date).try(:to_s)
h[:registrant] = domain.registrant.name h[:registrant] = domain.registrant.name
@ -113,6 +117,6 @@ class WhoisRecord < ActiveRecord::Base
end end
def destroy_whois_record def destroy_whois_record
Whois::Record.where(name: name).delete_all() Whois::Record.where(name: name).delete_all
end end
end end

View file

@ -6,7 +6,7 @@
%dt= t(:id) %dt= t(:id)
%dd= @contact.code %dd= @contact.code
%dt= t(:password) %dt= t(:authinfo_pw)
%dd %dd
= text_field_tag :auth_info, @contact.auth_info, readonly: true, class: 'partially-hidden' = text_field_tag :auth_info, @contact.auth_info, readonly: true, class: 'partially-hidden'

View file

@ -12,7 +12,7 @@
%dt= t(:registrar) %dt= t(:registrar)
%dd= link_to(@domain.registrar, admin_registrar_path(@domain.registrar)) %dd= link_to(@domain.registrar, admin_registrar_path(@domain.registrar))
%dt= t(:password) %dt= t(:authinfo_pw)
%dd %dd
= text_field_tag :password, @domain.auth_info, readonly: true, class: 'partially-hidden' = text_field_tag :password, @domain.auth_info, readonly: true, class: 'partially-hidden'

View file

@ -28,7 +28,7 @@
%dt= t(:public_key) %dt= t(:public_key)
%dd= @keyrelay.key_data_public_key %dd= @keyrelay.key_data_public_key
%dt= t(:password) %dt= t(:authinfo_pw)
%dd= @keyrelay.auth_info_pw %dd= @keyrelay.auth_info_pw
%dt= t(:expiry_relative) %dt= t(:expiry_relative)

View file

@ -46,15 +46,15 @@ xml.epp_head do
xml.tag!('contact:email', 'No access') xml.tag!('contact:email', 'No access')
end end
xml.tag!('contact:clID', @contact.registrar.try(:name)) xml.tag!('contact:clID', @contact.registrar.try(:code))
if @contact.creator.try(:registrar).blank? && Rails.env.test?
xml.tag!('contact:crID', 'TEST-CREATOR') xml.tag!('contact:crID', @contact.cr_id)
else
xml.tag!('contact:crID', @contact.creator.try(:registrar))
end
xml.tag!('contact:crDate', @contact.created_at.try(:iso8601)) xml.tag!('contact:crDate', @contact.created_at.try(:iso8601))
if @contact.updated_at != @contact.created_at if @contact.updated_at != @contact.created_at
xml.tag!('contact:upID', @contact.updator.try(:registrar)) upID = @contact.updator.try(:registrar)
upID = upID.code if upID.present? # Did updator return a kind of User that has a registrar?
xml.tag!('contact:upID', upID) if upID.present? # optional upID
xml.tag!('contact:upDate', @contact.updated_at.try(:iso8601)) xml.tag!('contact:upDate', @contact.updated_at.try(:iso8601))
end end
# xml.tag!('contact:trDate', '123') if false # xml.tag!('contact:trDate', '123') if false

View file

@ -36,19 +36,20 @@ xml.epp_head do
## TODO Find out what this domain:host is all about ## TODO Find out what this domain:host is all about
xml.tag!('domain:clID', @domain.registrar_name) xml.tag!('domain:clID', @domain.registrar.code)
xml.tag!('domain:crID', @domain.creator.try(:registrar)) if @domain.creator
xml.tag!('domain:crID', @domain.cr_id)
xml.tag!('domain:crDate', @domain.created_at.try(:iso8601)) xml.tag!('domain:crDate', @domain.created_at.try(:iso8601))
xml.tag!('domain:upDate', @domain.updated_at.try(:iso8601)) if @domain.updated_at != @domain.created_at if @domain.updated_at != @domain.created_at
upID = @domain.updator.try(:registrar)
upID = upID.code if upID.present? # Did updator return a kind of User that has a registrar?
xml.tag!('domain:upID', upID) if upID.present? # optional upID
xml.tag!('domain:upDate', @domain.updated_at.try(:iso8601))
end
xml.tag!('domain:exDate', @domain.valid_to.try(:iso8601)) xml.tag!('domain:exDate', @domain.valid_to.try(:iso8601))
# TODO Make domain stampable
#xml.tag!('domain:upID', @domain.updated_by)
# TODO Make domain transferrable # TODO Make domain transferrable
#xml.tag!('domain:trDate', @domain.transferred_at) if @domain.transferred_at #xml.tag!('domain:trDate', @domain.transferred_at) if @domain.transferred_at

View file

@ -1,8 +1,8 @@
Tere, Tere,
<br><br> <br><br>
Domeeni <%= @domain.name %> registreerija <%= @domain.registrant_name %> ei kinnitanud tähtaegselt registreerija vahetuse taotlust. Domeeni <%= @domain.name %> registreerija vahetus on sellest tulenevalt tühistatud. Domeeni <%= @params[:name] %> registreerija <%= @params[:registrant_name] %> ei kinnitanud tähtaegselt registreerija vahetuse taotlust. Domeeni <%= @params[:name] %> registreerija vahetus on sellest tulenevalt tühistatud.
<br><br> <br><br>
Küsimuste korral palun võtke ühendust registripidajaga <%= @domain.registrar_name %>, kelle kontaktid leiate http://internet.ee/registripidajad/akrediteeritud-registripidajad Küsimuste korral palun võtke ühendust registripidajaga <%= @params[:registrar_name] %>, kelle kontaktid leiate http://internet.ee/registripidajad/akrediteeritud-registripidajad
<br><br> <br><br>
Lugupidamisega<br> Lugupidamisega<br>
Eesti Interneti SA Eesti Interneti SA
@ -11,9 +11,9 @@ Eesti Interneti SA
<br><br> <br><br>
Hi, Hi,
<br><br> <br><br>
Domain registrant change has been expired for the domain <%= @domain.name %>. Domain registrant change has been expired for the domain <%= @params[:name] %>.
<br><br> <br><br>
Please contact to your registrar <%= @domain.registrar_name %> if you have any questions. Please contact to your registrar <%= @params[:registrar_name] %> if you have any questions.
<br><br> <br><br>
Best Regards,<br> Best Regards,<br>
Estonian Internet Foundation Estonian Internet Foundation

View file

@ -1,8 +1,8 @@
Tere, Tere,
Domeeni <%= @domain.name %> registreerija <%= @domain.registrant_name %> ei kinnitanud tähtaegselt registreerija vahetuse taotlust. Domeeni <%= @domain.name %> registreerija vahetus on sellest tulenevalt tühistatud. Domeeni <%= @params[:name] %> registreerija <%= @params[:registrant_name] %> ei kinnitanud tähtaegselt registreerija vahetuse taotlust. Domeeni <%= @params[:name] %> registreerija vahetus on sellest tulenevalt tühistatud.
Küsimuste korral palun võtke ühendust registripidajaga <%= @domain.registrar_name %>, kelle kontaktid leiate http://internet.ee/registripidajad/akrediteeritud-registripidajad Küsimuste korral palun võtke ühendust registripidajaga <%= @params[:registrar_name] %>, kelle kontaktid leiate http://internet.ee/registripidajad/akrediteeritud-registripidajad
Lugupidamisega Lugupidamisega
Eesti Interneti SA Eesti Interneti SA
@ -11,9 +11,9 @@ Eesti Interneti SA
Hi, Hi,
Domain registrant change has been expired for the domain <%= @domain.name %>. Domain registrant change has been expired for the domain <%= @params[:name] %>.
Please contact to your registrar <%= @domain.registrar_name %> if you have any questions. Please contact to your registrar <%= @params[:registrar_name] %> if you have any questions.
Best Regards, Best Regards,
Estonian Internet Foundation Estonian Internet Foundation

View file

@ -1,25 +1,25 @@
Tere, Tere,
<br><br> <br><br>
Registripidaja <%= @domain.registrar_name %> vahendusel on algatatud <%= @domain.name %> domeeni omanikuvahetuse protseduur. Registripidaja <%= @params[:registrar_name] %> vahendusel on algatatud <%= @params[:name] %> domeeni omanikuvahetuse protseduur.
<br><br> <br><br>
Palun veenduge, et muudatus on korrektne ning probleemide korral pöörduge oma registripidaja poole. Teie registripidaja on <%= @domain.registrar_name %> Palun veenduge, et muudatus on korrektne ning probleemide korral pöörduge oma registripidaja poole. Teie registripidaja on <%= @params[:registrar_name] %>
<br><br> <br><br>
Uued registreerija andmed:<br> Uue registreerija andmed:<br>
Nimi: <%= @domain.registrant_name %><br> Nimi: <%= @params[:registrant_name] %><br>
<% if @domain.registrant.priv? %> <% if @params[:registrant_priv] %>
Isikukood: <%= @domain.registrant_ident %><br> Isikukood: <%= @params[:registrant_ident] %><br>
<% else %> <% else %>
Äriregistrikood: <%= @domain.registrant_ident %><br> Äriregistrikood: <%= @params[:registrant_ident] %><br>
<% end %> <% end %>
Tänav: <%= @domain.registrant_street %><br> Tänav: <%= @params[:registrant_street] %><br>
Linn: <%= @domain.registrant_city %><br> Linn: <%= @params[:registrant_city] %><br>
Riik: <%= @domain.registrant_country %> Riik: <%= @params[:registrant_country] %>
<br><br> <br><br>
Juhime Teie tähelepanu asjaolule, et omanikuvahetuse protseduur viiaks lõpule vaid juhul, kui domeeni hetkel kehtiv registreerija <%= @old_registrant.name %> omanikuvahetuse tähtaegselt kinnitab. Juhime Teie tähelepanu asjaolule, et omanikuvahetuse protseduur viiaks lõpule vaid juhul, kui domeeni hetkel kehtiv registreerija <%= @params[:old_registrant_name] %> omanikuvahetuse tähtaegselt kinnitab.
<br><br> <br><br>
Juhul kui <%= @old_registrant.name %> lükkab omanikuvahtuse taotluse tagasi või ei anna kinnitust enne <%= Setting.expire_pending_confirmation %> tundi, omanikuvahetuse protseduur tühistatakse. Juhul kui <%= @params[:old_registrant_name] %> lükkab omanikuvahtuse taotluse tagasi või ei anna kinnitust enne <%= Setting.expire_pending_confirmation %> tundi, omanikuvahetuse protseduur tühistatakse.
<br><br> <br><br>
Küsimuste korral palun võtke ühendust registripidajaga <%= @domain.registrar_name %>, kelle kontaktid leiate http://internet.ee/registripidajad/akrediteeritud-registripidajad Küsimuste korral palun võtke ühendust registripidajaga <%= @params[:registrar_name] %>, kelle kontaktid leiate http://internet.ee/registripidajad/akrediteeritud-registripidajad
<br><br> <br><br>
Lugupidamisega<br> Lugupidamisega<br>
Eesti Interneti SA Eesti Interneti SA
@ -28,20 +28,20 @@ Eesti Interneti SA
<br><br> <br><br>
Hi, Hi,
<br><br> <br><br>
Registrant change process for the domain <%= @domain.name %> has been started. Registrant change process for the domain <%= @params[:name] %> has been started.
<br><br> <br><br>
New registrant:<br> New registrant:<br>
Name: <%= @domain.registrant_name %><br> Name: <%= @params[:registrant_name] %><br>
<% if @domain.registrant.priv? %> <% if @params[:registrant_priv] %>
Personal code: <%= @domain.registrant_ident %><br> Personal code: <%= @params[:registrant_ident] %><br>
<% else %> <% else %>
Business Registry code: <%= @domain.registrant_ident %><br> Business Registry code: <%= @params[:registrant_ident] %><br>
<% end %> <% end %>
Street: <%= @domain.registrant_street %><br> Street: <%= @params[:registrant_street] %><br>
City: <%= @domain.registrant_city %><br> City: <%= @params[:registrant_city] %><br>
Country: <%= @domain.registrant_country %> Country: <%= @params[:registrant_country] %>
<br><br> <br><br>
Please contact to your registrar <%= @domain.registrar_name %> if you have any questions. Please contact to your registrar <%= @params[:registrar_name] %> if you have any questions.
<br><br> <br><br>
Best Regards,<br> Best Regards,<br>
Estonian Internet Foundation Estonian Internet Foundation

View file

@ -1,25 +1,25 @@
Tere, Tere,
Registripidaja <%= @domain.registrar_name %> vahendusel on algatatud <%= @domain.name %> domeeni omanikuvahetuse protseduur. Registripidaja <%= @params[:registrar_name] %> vahendusel on algatatud <%= @params[:name] %> domeeni omanikuvahetuse protseduur.
Palun veenduge, et muudatus on korrektne ning probleemide korral pöörduge oma registripidaja poole. Teie registripidaja on <%= @domain.registrar_name %> Palun veenduge, et muudatus on korrektne ning probleemide korral pöörduge oma registripidaja poole. Teie registripidaja on <%= @params[:registrar_name] %>
Uued registreerija andmed: Uue registreerija andmed:
Nimi: <%= @domain.registrant_name %> Nimi: <%= @params[:registrant_name] %>
<% if @domain.registrant.priv? %> <% if @params[:registrant_priv] %>
Isikukood: <%= @domain.registrant_ident %> Isikukood: <%= @params[:registrant_ident] %>
<% else %> <% else %>
Äriregistrikood: <%= @domain.registrant_ident %> Äriregistrikood: <%= @params[:registrant_ident] %>
<% end %> <% end %>
Tänav: <%= @domain.registrant_street %> Tänav: <%= @params[:registrant_street] %>
Linn: <%= @domain.registrant_city %> Linn: <%= @params[:registrant_city] %>
Riik: <%= @domain.registrant_country %> Riik: <%= @params[:registrant_country] %>
Juhime Teie tähelepanu asjaolule, et omanikuvahetuse protseduur viiaks lõpule vaid juhul, kui domeeni hetkel kehtiv registreerija <%= @old_registrant.name %> omanikuvahetuse tähtaegselt kinnitab. Juhime Teie tähelepanu asjaolule, et omanikuvahetuse protseduur viiaks lõpule vaid juhul, kui domeeni hetkel kehtiv registreerija <%= @params[:old_registrant_name] %> omanikuvahetuse tähtaegselt kinnitab.
Juhul kui <%= @old_registrant.name %> lükkab omanikuvahtuse taotluse tagasi või ei anna kinnitust enne <%= Setting.expire_pending_confirmation %> tundi, omanikuvahetuse protseduur tühistatakse. Juhul kui <%= @params[:old_registrant_name] %> lükkab omanikuvahtuse taotluse tagasi või ei anna kinnitust enne <%= Setting.expire_pending_confirmation %> tundi, omanikuvahetuse protseduur tühistatakse.
Küsimuste korral palun võtke ühendust registripidajaga <%= @domain.registrar_name %>, kelle kontaktid leiate http://internet.ee/registripidajad/akrediteeritud-registripidajad Küsimuste korral palun võtke ühendust registripidajaga <%= @params[:registrar_name] %>, kelle kontaktid leiate http://internet.ee/registripidajad/akrediteeritud-registripidajad
Lugupidamisega Lugupidamisega
Eesti Interneti SA Eesti Interneti SA
@ -28,20 +28,20 @@ Eesti Interneti SA
Hi, Hi,
Registrant change process for the domain <%= @domain.name %> has been started. Registrant change process for the domain <%= @params[:name] %> has been started.
New registrant: New registrant:
Name: <%= @domain.registrant_name %> Name: <%= @params[:registrant_name] %>
<% if @domain.registrant.priv? %> <% if @params[:registrant_priv] %>
Personal code: <%= @domain.registrant_ident %> Personal code: <%= @params[:registrant_ident] %>
<% else %> <% else %>
Business Registry code: <%= @domain.registrant_ident %> Business Registry code: <%= @params[:registrant_ident] %>
<% end %> <% end %>
Street: <%= @domain.registrant_street %> Street: <%= @params[:registrant_street] %>
City: <%= @domain.registrant_city %> City: <%= @params[:registrant_city] %>
Country: <%= @domain.registrant_country %> Country: <%= @params[:registrant_country] %>
Please contact to your registrar <%= @domain.registrar_name %> if you have any questions. Please contact to your registrar <%= @params[:registrar_name] %> if you have any questions.
Best Regards, Best Regards,
Estonian Internet Foundation Estonian Internet Foundation

View file

@ -1,8 +1,8 @@
Tere, Tere,
<br><br> <br><br>
Domeeni <%= @domain.name %> registreerija <%= @new_registrant_name %> on domeeni registreerija vahetamise taotluse tagasi lükanud. Domeeni <%= @params[:name] %> registreerija <%= @params[:old_registrant_name] %> on domeeni registreerija vahetamise taotluse tagasi lükanud.
<br><br> <br><br>
Küsimuste korral palun võtke ühendust registripidajaga <%= @domain.registrar_name %>, kelle kontaktid leiate http://internet.ee/registripidajad/akrediteeritud-registripidajad Küsimuste korral palun võtke ühendust registripidajaga <%= @params[:registrar_name] %>, kelle kontaktid leiate http://internet.ee/registripidajad/akrediteeritud-registripidajad
<br><br> <br><br>
Lugupidamisega,<br> Lugupidamisega,<br>
Eesti Interneti SA Eesti Interneti SA
@ -11,9 +11,9 @@ Eesti Interneti SA
<br><br> <br><br>
Hi, Hi,
<br><br> <br><br>
Registrant change was declined for the domain <%= @domain.name %>. Registrant change was declined for the domain <%= @params[:name] %>.
<br><br> <br><br>
Please contact to your registrar <%= @domain.registrar_name %> if you have any questions. Please contact to your registrar <%= @params[:registrar_name] %> if you have any questions.
<br><br> <br><br>
Best Regards,<br> Best Regards,<br>
Estonian Internet Foundation Estonian Internet Foundation

View file

@ -1,8 +1,8 @@
Tere, Tere,
Domeeni <%= @domain.name %> registreerija <%= @new_registrant_name %> on domeeni registreerija vahetamise taotluse tagasi lükanud. Domeeni <%= @params[:name] %> registreerija <%= @params[:old_registrant_name] %> on domeeni registreerija vahetamise taotluse tagasi lükanud.
Küsimuste korral palun võtke ühendust registripidajaga <%= @domain.registrar_name %>, kelle kontaktid leiate http://internet.ee/registripidajad/akrediteeritud-registripidajad Küsimuste korral palun võtke ühendust registripidajaga <%= @params[:registrar_name] %>, kelle kontaktid leiate http://internet.ee/registripidajad/akrediteeritud-registripidajad
Lugupidamisega Lugupidamisega
Eesti Interneti SA Eesti Interneti SA
@ -11,9 +11,9 @@ Eesti Interneti SA
Hi, Hi,
Registrant change was declined for the domain <%= @domain.name %>. Registrant change was declined for the domain <%= @params[:name] %>.
Please contact to your registrar <%= @domain.registrar_name %> if you have any questions. Please contact to your registrar <%= @params[:registrar_name] %> if you have any questions.
Best Regards, Best Regards,
Estonian Internet Foundation Estonian Internet Foundation

View file

@ -1,23 +1,23 @@
Tere, Tere,
<br><br> <br><br>
Registrisse laekus taotlus domeeni <%= @domain.name %> registreerija vahetuseks. Palun veenduge, et muudatus on korrektne ning probleemide korral pöörduge oma registripidaja poole. Teie registripidaja on <%= @domain.registrar_name %> Registrisse laekus taotlus domeeni <%= @params[:name] %> registreerija vahetuseks. Palun veenduge, et muudatus on korrektne ning probleemide korral pöörduge oma registripidaja poole. Teie registripidaja on <%= @params[:registrar_name] %>
<br><br> <br><br>
Uued registreerija andmed:<br> Uue registreerija andmed:<br>
Nimi: <%= @domain.registrant_name %><br> Nimi: <%= @params[:registrant_name] %><br>
<% if @domain.registrant.priv? %> <% if @params[:registrant_priv] %>
Isikukood: <%= @domain.registrant_ident %><br> Isikukood: <%= @params[:registrant_ident] %><br>
<% else %> <% else %>
Äriregistrikood: <%= @domain.registrant_ident %><br> Äriregistrikood: <%= @params[:registrant_ident] %><br>
<% end %> <% end %>
Tänav: <%= @domain.registrant_street %><br> Tänav: <%= @params[:registrant_street] %><br>
Linn: <%= @domain.registrant_city %><br> Linn: <%= @params[:registrant_city] %><br>
Riik: <%= @domain.registrant_country %> Riik: <%= @params[:registrant_country] %>
<br><br> <br><br>
Taotlus on aktiivne <%= Setting.expire_pending_confirmation %> tundi ja lükatakse automaatselt tagasi kui te seda enne ise ei kinnita või tagasi lükka. Taotlus on aktiivne <%= Setting.expire_pending_confirmation %> tundi ja lükatakse automaatselt tagasi kui te seda enne ise ei kinnita või tagasi lükka.
<br><br> <br><br>
Muudatuse kinnitamiseks külastage palun allolevat võrgulehekülge, kontrollige uuesti üle muudatuse andmed ning vajutage nuppu kinnitan:<br> Muudatuse kinnitamiseks külastage palun allolevat võrgulehekülge, kontrollige uuesti üle muudatuse andmed ning vajutage nuppu kinnitan:<br>
<%= link_to @verification_url, @verification_url %> <%= link_to @params[:verification_url], @params[:verification_url] %>
<br><br> <br><br>
Lugupidamisega<br> Lugupidamisega<br>
Eesti Interneti SA Eesti Interneti SA
@ -26,23 +26,23 @@ Eesti Interneti SA
<br><br> <br><br>
Hi, Hi,
<br><br> <br><br>
Application for changing registrant of your domain <%= @domain.name %> has been filed. Please make sure that the update and information are correct. Incase of problems please turn to your registrar. Your registrar is <%= @domain.registrar_name %> Application for changing registrant of your domain <%= @params[:name] %> has been filed. Please make sure that the update and information are correct. Incase of problems please turn to your registrar. Your registrar is <%= @params[:registrar_name] %>
<br><br> <br><br>
New registrant:<br> New registrant:<br>
Name: <%= @domain.registrant_name %><br> Name: <%= @params[:registrant_name] %><br>
<% if @domain.registrant.priv? %> <% if @params[:registrant_priv] %>
Personal code: <%= @domain.registrant_ident %><br> Personal code: <%= @params[:registrant_ident] %><br>
<% else %> <% else %>
Business Registry code: <%= @domain.registrant_ident %><br> Business Registry code: <%= @params[:registrant_ident] %><br>
<% end %> <% end %>
Street: <%= @domain.registrant_street %><br> Street: <%= @params[:registrant_street] %><br>
City: <%= @domain.registrant_city %><br> City: <%= @params[:registrant_city] %><br>
Country: <%= @domain.registrant_country %> Country: <%= @params[:registrant_country] %>
<br><br> <br><br>
The application will remain in pending status for <%= Setting.expire_pending_confirmation %> hrs and will be automaticcally rejected if it is not approved nor rejected before. The application will remain in pending status for <%= Setting.expire_pending_confirmation %> hrs and will be automaticcally rejected if it is not approved nor rejected before.
<br><br> <br><br>
To confirm the update please visit this website, once again review the data and press approve:<br> To confirm the update please visit this website, once again review the data and press approve:<br>
<%= link_to @verification_url, @verification_url %> <%= link_to @params[:verification_url], @params[:verification_url] %>
<br><br> <br><br>
Best Regards,<br> Best Regards,<br>
Estonian Internet Foundation Estonian Internet Foundation

View file

@ -1,21 +1,21 @@
Tere, Tere,
Registrisse laekus taotlus domeeni <%= @domain.name %> registreerija vahetuseks. Palun veenduge, et muudatus on korrektne ning probleemide korral pöörduge oma registripidaja poole. Teie registripidaja on <%= @domain.registrar_name %> Registrisse laekus taotlus domeeni <%= @params[:name] %> registreerija vahetuseks. Palun veenduge, et muudatus on korrektne ning probleemide korral pöörduge oma registripidaja poole. Teie registripidaja on <%= @params[:registrar_name] %>
Uued registreerija andmed: Uue registreerija andmed:
Nimi: <%= @domain.registrant_name %> Nimi: <%= @params[:registrant_name] %>
<% if @domain.registrant.priv? %> <% if @params[:registrant_priv] %>
Isikukood: <%= @domain.registrant_ident %> Isikukood: <%= @params[:registrant_ident] %>
<% else %> <% else %>
Äriregistrikood: <%= @domain.registrant_ident %> Äriregistrikood: <%= @params[:registrant_ident] %>
<% end %> <% end %>
Tänav: <%= @domain.registrant_street %> Tänav: <%= @params[:registrant_street] %>
Linn: <%= @domain.registrant_city %> Linn: <%= @params[:registrant_city] %>
Riik: <%= @domain.registrant_country %> Riik: <%= @params[:registrant_country] %>
Taotlus on aktiivne <%= Setting.expire_pending_confirmation %> tundi ja lükatakse automaatselt tagasi kui te seda enne ise ei kinnita või tagasi lükka. Taotlus on aktiivne <%= Setting.expire_pending_confirmation %> tundi ja lükatakse automaatselt tagasi kui te seda enne ise ei kinnita või tagasi lükka.
Muudatuse kinnitamiseks külastage palun allolevat võrgulehekülge, kontrollige uuesti üle muudatuse andmed ning vajutage nuppu kinnitan: Muudatuse kinnitamiseks külastage palun allolevat võrgulehekülge, kontrollige uuesti üle muudatuse andmed ning vajutage nuppu kinnitan:
<%= @verification_url %> <%= @params[:verification_url] %>
Lugupidamisega Lugupidamisega
Eesti Interneti SA Eesti Interneti SA
@ -24,22 +24,22 @@ Eesti Interneti SA
Hi, Hi,
Application for changing registrant of your domain <%= @domain.name %> has been filed. Please make sure that the update and information are correct. Incase of problems please turn to your registrar. Your registrar is <%= @domain.registrar_name %> Application for changing registrant of your domain <%= @params[:name] %> has been filed. Please make sure that the update and information are correct. Incase of problems please turn to your registrar. Your registrar is <%= @params[:registrar_name] %>
New registrant: New registrant:
Name: <%= @domain.registrant_name %> Name: <%= @params[:registrant_name] %>
<% if @domain.registrant.priv? %> <% if @params[:registrant_priv] %>
Personal code: <%= @domain.registrant_ident %> Personal code: <%= @params[:registrant_ident] %>
<% else %> <% else %>
Business Registry code: <%= @domain.registrant_ident %> Business Registry code: <%= @params[:registrant_ident] %>
<% end %> <% end %>
Street: <%= @domain.registrant_street %> Street: <%= @params[:registrant_street] %>
City: <%= @domain.registrant_city %> City: <%= @params[:registrant_city] %>
Country: <%= @domain.registrant_country %> Country: <%= @params[:registrant_country] %>
The application will remain in pending status for <%= Setting.expire_pending_confirmation %> hrs and will be automaticcally rejected if it is not approved nor rejected before. The application will remain in pending status for <%= Setting.expire_pending_confirmation %> hrs and will be automaticcally rejected if it is not approved nor rejected before.
To confirm the update please visit this website, once again review the data and press approve: To confirm the update please visit this website, once again review the data and press approve:
<%= @verification_url %> <%= @params[:verification_url] %>
Best Regards, Best Regards,
Estonian Internet Foundation Estonian Internet Foundation

View file

@ -1,18 +1,18 @@
Tere, Tere,
<br><br> <br><br>
Domeeni <%= @domain.name %> registreerija vahetuse taotlus on kinnitatud ning andmed registris uuendatud. Domeeni <%= @params[:name] %> registreerija vahetuse taotlus on kinnitatud ning andmed registris uuendatud.
<br><br> <br><br>
Uued registreerija andmed:<br> Uue registreerija andmed:<br>
Nimi: <%= @domain.registrant_name %><br> Nimi: <%= @params[:registrant_name] %><br>
<% if @domain.registrant.priv? %> <% if @params[:registrant_priv] %>
Isikukood: <%= @domain.registrant_ident %><br> Isikukood: <%= @params[:registrant_ident] %><br>
<% else %> <% else %>
Äriregistrikood: <%= @domain.registrant_ident %><br> Äriregistrikood: <%= @params[:registrant_ident] %><br>
<% end %> <% end %>
Epost: <%= @domain.registrant_email %><br> Epost: <%= @params[:registrant_email] %><br>
Tänav: <%= @domain.registrant_street %><br> Tänav: <%= @params[:registrant_street] %><br>
Linn: <%= @domain.registrant_city %><br> Linn: <%= @params[:registrant_city] %><br>
Riik: <%= @domain.registrant_country %> Riik: <%= @params[:registrant_country] %>
<br><br> <br><br>
Lugupidamisega<br> Lugupidamisega<br>
Eesti Interneti SA Eesti Interneti SA
@ -21,19 +21,19 @@ Eesti Interneti SA
<br><br> <br><br>
Hi, Hi,
<br><br> <br><br>
Process for changing registrant of the domain <%= @domain.name %> has been approved and the data in the registry is updated. Process for changing registrant of the domain <%= @params[:name] %> has been approved and the data in the registry is updated.
<br><br> <br><br>
New registrant:<br> New registrant:<br>
Name: <%= @domain.registrant_name %><br> Name: <%= @params[:registrant_name] %><br>
<% if @domain.registrant.priv? %> <% if @params[:registrant_priv] %>
Personal code: <%= @domain.registrant_ident %><br> Personal code: <%= @params[:registrant_ident] %><br>
<% else %> <% else %>
Business Registry code: <%= @domain.registrant_ident %><br> Business Registry code: <%= @params[:registrant_ident] %><br>
<% end %> <% end %>
E-mail: <%= @domain.registrant_email %><br> E-mail: <%= @params[:registrant_email] %><br>
Street: <%= @domain.registrant_street %><br> Street: <%= @params[:registrant_street] %><br>
City: <%= @domain.registrant_city %><br> City: <%= @params[:registrant_city] %><br>
Country: <%= @domain.registrant_country %> Country: <%= @params[:registrant_country] %>
<br><br> <br><br>
Best Regards,<br> Best Regards,<br>
Estonian Internet Foundation Estonian Internet Foundation

View file

@ -1,18 +1,18 @@
Tere, Tere,
Domeeni <%= @domain.name %> registreerija vahetuse taotlus on kinnitatud ning andmed registris uuendatud. Domeeni <%= @params[:name] %> registreerija vahetuse taotlus on kinnitatud ning andmed registris uuendatud.
Uued registreerija andmed: Uue registreerija andmed:
Nimi: <%= @domain.registrant_name %> Nimi: <%= @params[:registrant_name] %>
<% if @domain.registrant.priv? %> <% if @params[:registrant_priv] %>
Isikukood: <%= @domain.registrant_ident %> Isikukood: <%= @params[:registrant_ident] %>
<% else %> <% else %>
Äriregistrikood: <%= @domain.registrant_ident %> Äriregistrikood: <%= @params[:registrant_ident] %>
<% end %> <% end %>
Epost: <%= @domain.registrant_email %> Epost: <%= @params[:registrant_email] %>
Tänav: <%= @domain.registrant_street %> Tänav: <%= @params[:registrant_street] %>
Linn: <%= @domain.registrant_city %> Linn: <%= @params[:registrant_city] %>
Riik: <%= @domain.registrant_country %> Riik: <%= @params[:registrant_country] %>
Lugupidamisega Lugupidamisega
Eesti Interneti SA Eesti Interneti SA
@ -21,19 +21,19 @@ Eesti Interneti SA
Hi, Hi,
Process for changing registrant of the domain <%= @domain.name %> has been approved and the data in the registry is updated. Process for changing registrant of the domain <%= @params[:name] %> has been approved and the data in the registry is updated.
New registrant: New registrant:
Name: <%= @domain.registrant_name %> Name: <%= @params[:registrant_name] %>
<% if @domain.registrant.priv? %> <% if @params[:registrant_priv] %>
Personal code: <%= @domain.registrant_ident %> Personal code: <%= @params[:registrant_ident] %>
<% else %> <% else %>
Business Registry code: <%= @domain.registrant_ident %> Business Registry code: <%= @params[:registrant_ident] %>
<% end %> <% end %>
E-mail: <%= @domain.registrant_email %> E-mail: <%= @params[:registrant_email] %>
Street: <%= @domain.registrant_street %> Street: <%= @params[:registrant_street] %>
City: <%= @domain.registrant_city %> City: <%= @params[:registrant_city] %>
Country: <%= @domain.registrant_country %> Country: <%= @params[:registrant_country] %>
Best Regards, Best Regards,
Estonian Internet Foundation Estonian Internet Foundation

View file

@ -1,9 +1,18 @@
Tere, Tere,
<br><br> <br><br>
Domeeni <%= @domain.name %> registreerija vahetuse taotlus on kinnitatud ning andmed registris uuendatud. Domeeni <%= @params[:name] %> registreerija vahetuse taotlus on kinnitatud ning andmed registris uuendatud.
<br><br> <br><br>
Uued registreerija:<br> Uue registreerija andmed:<br>
Nimi: <%= @domain.registrant_name %> Nimi: <%= @params[:new_registrant_name] %><br>
<% if @params[:registrant_priv] %>
Isikukood: <%= @params[:registrant_ident] %><br>
<% else %>
Äriregistrikood: <%= @params[:registrant_ident] %><br>
<% end %>
Epost: <%= @params[:registrant_email] %><br>
Tänav: <%= @params[:registrant_street] %><br>
Linn: <%= @params[:registrant_city] %><br>
Riik: <%= @params[:registrant_country] %>
<br><br> <br><br>
Lugupidamisega<br> Lugupidamisega<br>
Eesti Interneti SA Eesti Interneti SA
@ -12,10 +21,19 @@ Eesti Interneti SA
<br><br> <br><br>
Hi, Hi,
<br><br> <br><br>
Process for changing registrant of the domain <%= @domain.name %> has been approved and the data in the registry is updated. Process for changing registrant of the domain <%= @params[:name] %> has been approved and the data in the registry is updated.
<br><br> <br><br>
New registrant:<br> New registrant:<br>
Name: <%= @domain.registrant_name %> Name: <%= @params[:new_registrant_name] %><br>
<% if @params[:registrant_priv] %>
Personal code: <%= @params[:registrant_ident] %><br>
<% else %>
Business Registry code: <%= @params[:registrant_ident] %><br>
<% end %>
E-mail: <%= @params[:registrant_email] %><br>
Street: <%= @params[:registrant_street] %><br>
City: <%= @params[:registrant_city] %><br>
Country: <%= @params[:registrant_country] %>
<br><br> <br><br>
Best Regards,<br> Best Regards,<br>
Estonian Internet Foundation Estonian Internet Foundation

View file

@ -1,9 +1,19 @@
Tere, Tere,
Domeeni <%= @domain.name %> registreerija vahetuse taotlus on kinnitatud ning andmed registris uuendatud. Domeeni <%= @params[:name] %> registreerija vahetuse taotlus on kinnitatud ning andmed registris uuendatud.
Uued registreerija: Uue registreerija andmed:
Nimi: <%= @domain.registrant_name %> Nimi: <%= @params[:new_registrant_name] %>
<% if @params[:registrant_priv] %>
Isikukood: <%= @params[:registrant_ident] %>
<% else %>
Äriregistrikood: <%= @params[:registrant_ident] %>
<% end %>
Epost: <%= @params[:registrant_email] %>
Tänav: <%= @params[:registrant_street] %>
Linn: <%= @params[:registrant_city] %>
Riik: <%= @params[:registrant_country] %>
Lugupidamisega Lugupidamisega
Eesti Interneti SA Eesti Interneti SA
@ -12,10 +22,20 @@ Eesti Interneti SA
Hi, Hi,
Process for changing registrant of the domain <%= @domain.name %> has been approved and the data in the registry is updated. Process for changing registrant of the domain <%= @params[:name] %> has been approved and the data in the registry is updated.
New registrant: New registrant:
Name: <%= @domain.registrant_name %> Name: <%= @params[:new_registrant_name] %>
<% if @params[:registrant_priv] %>
Personal code: <%= @params[:registrant_ident] %>
<% else %>
Business Registry code: <%= @params[:registrant_ident] %>
<% end %>
E-mail: <%= @params[:registrant_email] %>
Street: <%= @params[:registrant_street] %>
City: <%= @params[:registrant_city] %>
Country: <%= @params[:registrant_country] %>
Best Regards, Best Regards,
Estonian Internet Foundation Estonian Internet Foundation

View file

@ -0,0 +1,30 @@
!!!
%html
%head
%meta{:content => "text/html; charset=utf-8", "http-equiv" => "Content-Type"}
%title Contacts
%body
.row
.col-md-12
.table-responsive
%table.table.table-hover.table-bordered.table-condensed
%thead
%tr
%th{class: 'col-xs-2'}
=t(:name)
%th{class: 'col-xs-2'}
=t(:id)
%th{class: 'col-xs-2'}
=t(:ident)
%th{class: 'col-xs-2'}
=t(:created_at)
%th{class: 'col-xs-2'}
=t(:registrar)
%tbody
- @contacts.each do |contact|
%tr
%td= contact
%td= contact.code
%td= ident_for(contact)
%td= l(contact.created_at, format: :short)
%td= contact.registrar

View file

@ -2,23 +2,130 @@
= link_to(t(:new), new_registrar_contact_path, class: 'btn btn-primary') = link_to(t(:new), new_registrar_contact_path, class: 'btn btn-primary')
= render 'shared/title', name: t(:contacts) = render 'shared/title', name: t(:contacts)
- if @response .row
.table-responsive .col-md-12
%table.table.table-hover.table-condensed = search_form_for [:registrar, @q], html: { style: 'margin-bottom: 0;', class: 'js-form', autocomplete: 'off' } do |f|
%thead .row
%tr .col-md-3
%th{class: 'col-xs-3'}= t(:name) .form-group
%th{class: 'col-xs-3'}= t(:id) = f.label :name
%th{class: 'col-xs-3'}= t(:ident) = f.search_field :name_matches, value: params[:q][:name_matches], class: 'form-control', placeholder: t(:name)
%th{class: 'col-xs-3'}= t(:actions) .col-md-3
%tbody .form-group
- @contacts.each do |c| = f.label t(:id)
%tr = f.search_field :code_eq, class: 'form-control', placeholder: t(:id)
%td= link_to(c[:name], registrar_contact_path(id: c[:code])) .col-md-3
%td= c[:code] .form-group
%td= ident_for(c) = f.label t(:ident)
%td = f.search_field :ident_matches, class: 'form-control', placeholder: t(:ident)
= link_to(t(:edit), edit_registrar_contact_path(c[:code]), class: 'btn btn-primary btn-xs') .col-md-3
= link_to(t(:delete), delete_registrar_contact_path(c[:code]), class: 'btn btn-default btn-xs') .form-group
= label_tag t(:ident_type)
= select_tag '[q][ident_type_eq]', options_for_select(Contact::IDENT_TYPES, params[:q][:ident_type_eq]), { include_blank: true, placeholder: t(:choose), class: 'form-control selectize' }
.row
.col-md-3
.form-group
= f.label t(:email)
= f.search_field :email_matches, class: 'form-control', placeholder: t(:email)
.col-md-3
.form-group
= label_tag t(:country)
= select_tag '[q][country_code_eq]', SortedCountry.all_options(params[:q][:country_code_eq]), { include_blank: true, placeholder: t(:choose), class: 'form-control selectize' }
.col-md-3
.form-group
= f.label t(:is_registrant)
%div
= f.check_box :registrant_domains_id_not_null
.col-md-3
.form-group
= label_tag t(:contact_type)
= select_tag '[q][domain_contacts_type_in]', options_for_select([['admin', 'AdminDomainContact'], ['tech', 'TechDomainContact']], params[:q][:domain_contacts_type_in]), { multiple: true, placeholder: t(:choose), class: 'form-control js-combobox' }
.row
.col-md-3
.form-group
= f.label t(:registrar)
= 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(:created_at_from)
= f.search_field :created_at_gteq, value: params[:q][:created_at_gteq], class: 'form-control datepicker', placeholder: t(:created_at_from)
.col-md-3
.form-group
= f.label t(:created_at_until)
= f.search_field :created_at_lteq, value: params[:q][:created_at_lteq], class: 'form-control datepicker', placeholder: t(:created_at_until)
.col-md-3
.form-group
= f.label t(:updated_at)
= f.search_field :updated_at_gteq, value: params[:q][:updated_at_gteq], class: 'form-control datepicker', placeholder: t(:updated_at)
.row
.col-md-6
.form-group
= label_tag t(:status)
= select_tag :statuses_contains, options_for_select(Contact::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
&nbsp;
%span.glyphicon.glyphicon-search
&nbsp;
%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_registrar_contacts_path(q: params[:q], format: "pdf")
%li= link_to 'CSV', download_list_registrar_contacts_path(q: params[:q], format: "csv")
.col-md-3
.col-md-3
.col-md-3
= paginate @paginatable_array %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', t(:name))
%th{class: 'col-xs-2'}
= sort_link(@q, 'code', t(:id))
%th{class: 'col-xs-2'}
= sort_link(@q, 'ident', t(:ident))
%th{class: 'col-xs-2'}
= sort_link(@q, 'email', t(:created_at))
%th{class: 'col-xs-2'}
= sort_link(@q, 'registrar_name', t(:registrar))
%th{class: 'col-xs-2'}= t(:actions)
%tbody
- @contacts.each do |contact|
%tr
%td= link_to(contact.name, registrar_contact_path(id: contact.code))
%td= contact.code
%td= ident_for(contact)
%td= l(contact.created_at, format: :short)
%td
- if contact.registrar
= contact.registrar
%td
= link_to(t(:edit), edit_registrar_contact_path(contact.code), class: 'btn btn-primary btn-xs')
= link_to(t(:delete), delete_registrar_contact_path(contact.code), class: 'btn btn-default btn-xs')
.row
.col-md-6
= paginate @contacts
.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}"

View file

@ -6,7 +6,7 @@
%dt= t(:id) %dt= t(:id)
%dd= @contact.id %dd= @contact.id
%dt= t(:password) %dt= t(:authinfo_pw)
%dd %dd
= text_field_tag :password, @contact.password, readonly: true, class: 'partially-hidden' = text_field_tag :password, @contact.password, readonly: true, class: 'partially-hidden'

View file

@ -3,7 +3,7 @@
%h3.panel-title= t(:general) %h3.panel-title= t(:general)
.panel-body .panel-body
%dl.dl-horizontal %dl.dl-horizontal
%dt= t(:password) %dt= t(:authinfo_pw)
%dd= @data.css('pw').text.present? ? @data.css('pw').text : t('hidden') %dd= @data.css('pw').text.present? ? @data.css('pw').text : t('hidden')
- if @data.css('pw').text.blank? - if @data.css('pw').text.blank?

View file

@ -30,7 +30,7 @@
%dt= t(:domain_name) %dt= t(:domain_name)
%dd= @data.css('name').text %dd= @data.css('name').text
%dt= t(:password) %dt= t(:authinfo_pw)
%dd= @data.css('pw').text %dd= @data.css('pw').text
- if @data.css('relative').text.present? - if @data.css('relative').text.present?

View file

@ -280,6 +280,7 @@ en:
domain_details: 'Domain details' domain_details: 'Domain details'
registered_at: 'Registered at' registered_at: 'Registered at'
password: 'Password' password: 'Password'
authinfo_pw: 'AuthInfo pw'
valid_from: 'Valid from' valid_from: 'Valid from'
general: 'General' general: 'General'
contacts: 'Contacts' contacts: 'Contacts'
@ -554,6 +555,7 @@ en:
username: 'Username' username: 'Username'
password: 'Password' password: 'Password'
authinfo_pw: 'AuthInfo pw'
log_in: 'Log in' log_in: 'Log in'
domains: 'Domains' domains: 'Domains'
register: 'Register' register: 'Register'
@ -904,7 +906,7 @@ en:
edit_zone: 'Edit zone' edit_zone: 'Edit zone'
there_are_count_domains_in_this_zone: 'There are %{count} domains in this zone' there_are_count_domains_in_this_zone: 'There are %{count} domains in this zone'
poll_pending_update_confirmed_by_registrant: 'Registrant confirmed domain update' poll_pending_update_confirmed_by_registrant: 'Registrant confirmed domain update'
poll_pending_update_rejected_by_registranti: 'Registrant rejected domain update' poll_pending_update_rejected_by_registrant: 'Registrant rejected domain update'
poll_pending_delete_rejected_by_registrant: 'Registrant rejected domain deletion' poll_pending_delete_rejected_by_registrant: 'Registrant rejected domain deletion'
poll_pending_delete_confirmed_by_registrant: 'Registrant confirmed domain deletion' poll_pending_delete_confirmed_by_registrant: 'Registrant confirmed domain deletion'
manage: Manage manage: Manage

View file

@ -74,6 +74,7 @@ Rails.application.routes.draw do
collection do collection do
get 'check' get 'check'
get 'download_list'
end end
end end