MERGE: merged staging at 3235647, resolved merge conflict

This commit is contained in:
Matt Farnsworth 2015-10-30 16:12:20 +02:00
commit 45588dc72a
78 changed files with 308808 additions and 421 deletions

View file

@ -14,3 +14,5 @@ $(document).on 'page:change', ->
# client side validate all forms
$('form').each ->
$(this).validate()
$('[data-toggle="popover"]').popover()

View file

@ -4,6 +4,7 @@
#= require jquery.validate.additional-methods
#= require turbolinks
#= require bootstrap-sprockets
#= require typeahead.bundle.min
#= require jquery.nested_attributes
#= require shared/jquery.validate.bootstrap
#= require jquery-ui/datepicker
@ -11,4 +12,5 @@
#= require shared/general
#= require registrar/autocomplete
#= require registrar/application

View file

@ -0,0 +1,27 @@
class @Autocomplete
constructor: ->
@buildAutocomplete(el) for el in document.querySelectorAll('[data-autocomplete]')
buildAutocomplete: (el)->
name = el.dataset.autocomplete[1..-1].replace(/\//g, "_") # cahcing
$(el).typeahead 'destroy'
$(el).typeahead(
name: name,
highlight: true,
hint: false
,
displayKey: "display_key"
source: (query, syncResults)->
$.getJSON "#{el.dataset.autocomplete}?query=#{query}", (data)->
syncResults(data)
).on('typeahead:selected', (e, item) ->
console.log e.currentTarget.id
orig = document.querySelector('#' + e.currentTarget.id.replace(/_helper$/, ''))
orig.value = item.value
)
$(document).on "ready page:load", ->
new Autocomplete

View file

@ -3,13 +3,15 @@ class Admin::ReservedDomainsController < AdminController
def index
rd = ReservedDomain.first_or_initialize
@reserved_domains = rd.names.to_yaml
rd.names = nil if rd.names.blank?
@reserved_domains = rd.names.to_yaml.gsub(/---.?\n/, '').gsub(/\.\.\..?\n/, '')
end
def create
@reserved_domains = params[:reserved_domains]
begin
params[:reserved_domains] = "---\n" if params[:reserved_domains].blank?
names = YAML.load(params[:reserved_domains])
fail if names == false
rescue

View file

@ -116,7 +116,7 @@ class Epp::SessionsController < EppController
def connection_limit_ok?
return true if Rails.env.test? || Rails.env.development?
c = EppSession.where(
'registrar_id = ? AND updated_at >= ?', @api_user.registrar_id, Time.zone.now - 5.minutes
'registrar_id = ? AND updated_at >= ?', @api_user.registrar_id, Time.zone.now - 1.second
).count
return false if c >= 4

View file

@ -150,6 +150,10 @@ class EppController < ApplicationController
end
@errors.uniq!
logger.error "\nFOLLOWING ERRORS OCCURRED ON EPP QUERY:"
logger.error @errors.inspect
logger.error "\n"
# Requested by client, ticket #2688
# Known issues: error request is exactly 1 second slower and server can handle less load

View file

@ -1,6 +1,6 @@
class Registrar::DomainsController < Registrar::DeppController # EPP controller
before_action :init_domain, except: :new
before_action :init_contacts_autocomplete_map, only: [:new, :edit, :create, :update]
helper_method :contacts
# rubocop: disable Metrics/PerceivedComplexity
# rubocop: disable Metrics/CyclomaticComplexity
@ -138,17 +138,27 @@ class Registrar::DomainsController < Registrar::DeppController # EPP controller
end
end
def search_contacts
authorize! :create, Depp::Domain
scope = current_user.registrar.contacts.limit(10)
if params[:query].present?
escaped_str = ActiveRecord::Base.connection.quote_string params[:query]
scope = scope.where("name ilike '%#{escaped_str}%' OR code ilike '%#{escaped_str}%' ")
end
render json: scope.pluck(:name, :code).map { |c| {display_key: "#{c.second} #{c.first}", value: c.second} }
end
private
def init_domain
@domain = Depp::Domain.new(current_user: depp_current_user)
end
def init_contacts_autocomplete_map
@contacts_autocomplete_map ||=
current_user.registrar.contacts.pluck(:name, :code).map { |c| ["#{c.second} #{c.first}", c.second] }
# @priv_contacts_autocomplete_map ||=
# current_user.registrar.priv_contacts.pluck(:name, :code).map { |c| ["#{c.second} #{c.first}", c.second] }
def contacts
current_user.registrar.contacts
end
def normalize_search_parameters

View file

@ -6,12 +6,16 @@ class DomainUpdateConfirmJob < Que::Job
case action
when RegistrantVerification::CONFIRMED
domain.poll_message!(:poll_pending_update_confirmed_by_registrant)
domain.apply_pending_update!
domain.apply_pending_update! do |e|
e.instance_variable_set("@changed_attributes", e.changed_attributes.merge("statuses"=>[]))
end
domain.clean_pendings!
when RegistrantVerification::REJECTED
DomainMailer.pending_update_rejected_notification_for_new_registrant(domain).deliver_now
domain.poll_message!(:poll_pending_update_rejected_by_registrant)
domain.clean_pendings!
domain.instance_variable_set("@changed_attributes", domain.changed_attributes.merge("statuses"=>[]))
domain.save
end
destroy # it's best to destroy the job in the same transaction
end

View file

@ -0,0 +1,10 @@
class RegenerateRegistrarWhoisesJob < Que::Job
def run(registrar_id)
# no return as we want restart job if fails
registrar = Registrar.find(registrar_id)
registrar.whois_records.select(:id).find_in_batches(batch_size: 20) do |group|
RegenerateWhoisRecordJob.enqueue group.map(&:id)
end
end
end

View file

@ -0,0 +1,10 @@
class RegenerateWhoisRecordJob < Que::Job
def run(ids)
ids.each do |id|
record = WhoisRecord.find_by(id: id)
return unless record
record.save
end
end
end

View file

@ -345,6 +345,10 @@ class Contact < ActiveRecord::Base
end
end
def search_name
"#{code} #{name}"
end
def set_linked
statuses << LINKED if statuses.detect { |s| s == LINKED }.blank?
end

View file

@ -257,7 +257,7 @@ class Domain < ActiveRecord::Base
next unless domain.expirable?
domain.set_graceful_expired
STDOUT << "#{Time.zone.now.utc} Domain.start_expire_period: ##{domain.id} (#{domain.name}) #{domain.changes}\n" unless Rails.env.test?
domain.save(validate: false)
domain.save
end
STDOUT << "#{Time.zone.now.utc} - Successfully expired #{domains.count} domains\n" unless Rails.env.test?
@ -370,13 +370,16 @@ class Domain < ActiveRecord::Base
def renewable?
if Setting.days_to_renew_domain_before_expire != 0
if ((valid_to - Time.zone.now.beginning_of_day).to_i / 1.day) + 1 > Setting.days_to_renew_domain_before_expire
# if you can renew domain at days_to_renew before domain expiration
if (valid_to.to_date - Date.today) + 1 > Setting.days_to_renew_domain_before_expire
return false
end
end
return false if statuses.include?(DomainStatus::DELETE_CANDIDATE) || statuses.include?(DomainStatus::FORCE_DELETE)
return false if statuses.include_any?(DomainStatus::DELETE_CANDIDATE, DomainStatus::SERVER_RENEW_PROHIBITED,
DomainStatus::CLIENT_RENEW_PROHIBITED, DomainStatus::PENDING_RENEW,
DomainStatus::PENDING_TRANSFER, DomainStatus::PENDING_DELETE,
DomainStatus::PENDING_UPDATE, 'pendingDeleteConfirmation')
true
end
@ -636,7 +639,7 @@ class Domain < ActiveRecord::Base
def set_graceful_expired
self.outzone_at = valid_to + Setting.expire_warning_period.days
self.delete_at = outzone_at + Setting.redemption_grace_period.days
statuses << DomainStatus::EXPIRED
self.statuses |= [DomainStatus::EXPIRED]
end
def set_expired

View file

@ -69,7 +69,7 @@ class DomainStatus < ActiveRecord::Base
SERVER_ADMIN_CHANGE_PROHIBITED = 'serverAdminChangeProhibited'
SERVER_TECH_CHANGE_PROHIBITED = 'serverTechChangeProhibited'
PENDING_DELETE_CONFIRMATION = 'pendingDeleteConfirmation'
FORCE_DELETE = 'forceDelete'
FORCE_DELETE = 'serverForceDelete'
DELETE_CANDIDATE = 'deleteCandidate'
EXPIRED = 'expired'
RESERVED = 'reserved'
@ -122,6 +122,7 @@ class DomainStatus < ActiveRecord::Base
class << self
def admin_statuses
<<<<<<< HEAD
[
SERVER_HOLD,
# sync with admin_statuses_map
@ -134,12 +135,31 @@ class DomainStatus < ActiveRecord::Base
SERVER_UPDATE_PROHIBITED,
SERVER_DELETE_PROHIBITED
]
=======
# [
# SERVER_HOLD,
# # sync with admin_statuses_map
# # SERVER_MANUAL_INZONE,
# # SERVER_RENEW_PROHIBITED,
# # SERVER_TRANSFER_PROHIBITED,
# # SERVER_REGISTRANT_CHANGE_PROHIBITED,
# # SERVER_ADMIN_CHANGE_PROHIBITED,
# # SERVER_TECH_CHANGE_PROHIBITED,
# SERVER_DELETE_PROHIBITED,
# SERVER_UPDATE_PROHIBITED
# ]
admin_statuses_map.map(&:second)
>>>>>>> staging
end
def admin_statuses_map
[
['Hold', SERVER_HOLD],
<<<<<<< HEAD
# sync with admin_statuses
=======
>>>>>>> staging
['ManualInzone', SERVER_MANUAL_INZONE],
# [''],
['RenewProhibited', SERVER_RENEW_PROHIBITED],

View file

@ -479,6 +479,7 @@ class Epp::Domain < Domain
user = ApiUser.find(pending_json['current_user_id'])
frame = Nokogiri::XML(pending_json['frame'])
statuses.delete(DomainStatus::PENDING_UPDATE)
yield(self) if block_given? # need to skip statuses check here
return unless update(frame, user, false)
clean_pendings!

View file

@ -3,6 +3,7 @@ module Legacy
self.table_name = :contact
belongs_to :object_registry, foreign_key: :id
belongs_to :object, foreign_key: :id
belongs_to :object_state, foreign_key: :id, primary_key: :object_id
has_one :object_state, -> { where('valid_to IS NULL') }, foreign_key: :object_id
end
end

View file

@ -1,5 +1,8 @@
module Legacy
class Dnskey < Db
self.table_name = :dnskey
belongs_to :object_registry, foreign_key: :id
belongs_to :object, foreign_key: :id
end
end

View file

@ -2,6 +2,8 @@ module Legacy
class Nsset < Db
self.table_name = :nsset
belongs_to :object, foreign_key: :id
belongs_to :object_registry, foreign_key: :id
has_many :hosts, foreign_key: :nssetid
end
end

View file

@ -1,6 +1,7 @@
module Legacy
class Object < Db
self.table_name = :object
belongs_to :registrar, foreign_key: :upid, primary_key: :legacy_id, class_name: '::Registrar'
def self.instance_method_already_implemented?(method_name)
return true if method_name == 'update'

View file

@ -2,40 +2,39 @@ module Legacy
class ObjectState < Db
self.table_name = :object_state
def name
# legacy values
# 2 => "serverRenewProhibited",
# 5 => "serverOutzoneManual",
# 6 => "serverInzoneManual",
# 7 => "serverBlocked",
# 8 => "expirationWarning",
# 9 => "expired",
# 10 => "unguarded",
# 11 => "validationWarning1",
# 12 => "validationWarning2",
# 13 => "notValidated",
# 14 => "nssetMissing",
# 15 => "outzone",
# 18 => "serverRegistrantChangeProhibited",
# 19 => "deleteWarning",
# 20 => "outzoneUnguarded",
# 1 => "serverDeleteProhibited",
# 3 => "serverTransferProhibited",
# 4 => "serverUpdateProhibited",
# 16 => "linked",
# 17 => "deleteCandidate",
# 21 => "forceDelete"
# legacy values. Just for log
# 2 => "serverRenewProhibited",
# 5 => "serverOutzoneManual",
# 6 => "serverInzoneManual",
# 7 => "serverBlocked",
# 8 => "expirationWarning",
# 9 => "expired",
# 10 => "unguarded",
# 11 => "validationWarning1",
# 12 => "validationWarning2",
# 13 => "notValidated",
# 14 => "nssetMissing",
# 15 => "outzone",
# 18 => "serverRegistrantChangeProhibited",
# 19 => "deleteWarning",
# 20 => "outzoneUnguarded",
# 1 => "serverDeleteProhibited",
# 3 => "serverTransferProhibited",
# 4 => "serverUpdateProhibited",
# 16 => "linked",
# 17 => "deleteCandidate",
# 21 => "forceDelete"
# new values
map = {
# new values
STATE_NAMES = {
2 => "serverRenewProhibited",
5 => "serverHold",
6 => "serverManualInzone",
7 => "serverBlocked",
# 7 => "serverBlocked",
9 => "expired",
11 => "validationWarning1",
13 => "notValidated",
14 => "nssetMissing",
# 11 => "validationWarning1",
# 13 => "notValidated",
14 => "inactive",
15 => "serverHold",
18 => "serverRegistrantChangeProhibited",
1 => "serverDeleteProhibited",
@ -43,10 +42,12 @@ module Legacy
4 => "serverUpdateProhibited",
16 => "linked",
17 => "deleteCandidate", # grupistaatus
21 => "forceDelete" # grupistaatus
}
21 => "serverForceDelete" # grupistaatus
}.freeze
map[state_id]
def name
STATE_NAMES[state_id]
end
def desc

View file

@ -51,10 +51,10 @@ class Registrar < ActiveRecord::Base
WHOIS_TRIGGERS = %w(name email phone street city state zip)
after_save :update_whois_records
after_commit :update_whois_records
def update_whois_records
return true unless changed? && (changes.keys & WHOIS_TRIGGERS).present?
whois_records.map(&:save) # slow currently
RegenerateRegistrarWhoisesJob.enqueue id
end
after_create :create_cash_account

View file

@ -1,5 +1,11 @@
class ReservedDomain < ActiveRecord::Base
include Versions # version/reserved_domain_version.rb
before_save :fill_empty_passwords
def fill_empty_passwords
return unless names
names.each { |k, v| names[k] = SecureRandom.hex if v.blank? }
end
class << self
def pw_for(domain_name)

View file

@ -1,3 +1,4 @@
require "erb"
class WhoisRecord < ActiveRecord::Base
belongs_to :domain
belongs_to :registrar
@ -5,14 +6,6 @@ class WhoisRecord < ActiveRecord::Base
validates :domain, :name, :body, :json, presence: true
before_validation :populate
def populate
return if domain_id.blank?
self.json = generate_json
self.body = generated_body
self.name = json['name']
self.registrar_id = domain.registrar_id # for faster registrar updates
end
after_save :update_whois_server
class << self
@ -29,6 +22,10 @@ class WhoisRecord < ActiveRecord::Base
end
end
def generated_json
@generated_json ||= generate_json
end
# rubocop:disable Metrics/MethodLength
# rubocop:disable Metrics/AbcSize
def generate_json
@ -36,116 +33,74 @@ class WhoisRecord < ActiveRecord::Base
return h if domain.blank?
status_map = {
'ok' => 'ok (paid and in zone)'
'ok' => 'ok (paid and in zone)'
}
@disclosed = []
h[:name] = domain.name
h[:registrant] = domain.registrant.name
h[:status] = domain.statuses.map { |x| status_map[x] || x }.join(', ')
h[:name] = domain.name
h[:status] = domain.statuses.map { |x| status_map[x] || x }
h[:registered] = domain.registered_at.try(:to_s, :iso8601)
h[:updated_at] = domain.updated_at.try(:to_s, :iso8601)
h[:valid_to] = domain.valid_to.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[:outzone] = domain.outzone_at.try(:to_date).try(:to_s)
h[:delete] = domain.delete_at.try(:to_date).try(:to_s)
# update registar triggers when adding new attributes
h[:registrar] = domain.registrar.name
h[:registrar_phone] = domain.registrar.phone
h[:registrar_address] = domain.registrar.address
h[:registrar_update_at] = domain.registrar.updated_at.try(:to_s, :iso8601)
h[:registrant] = domain.registrant.name
h[:registrant_email] = domain.registrant.email
h[:changed] = domain.registrant.updated_at.try(:to_s, :iso8601)
h[:admin_contacts] = []
domain.admin_contacts.each do |ac|
@disclosed << [:email, ac.email]
h[:admin_contacts] << {
name: ac.name,
email: ac.email,
registrar: ac.registrar.name,
created_at: ac.created_at.try(:to_s, :iso8601)
name: ac.name,
email: ac.email,
changed: ac.updated_at.try(:to_s, :iso8601)
}
end
h[:tech_contacts] = []
domain.tech_contacts.each do |tc|
@disclosed << [:email, tc.email]
h[:tech_contacts] << {
name: tc.name,
email: tc.email,
registrar: tc.registrar.name,
created_at: tc.created_at.try(:to_s, :iso8601)
}
end
h[:nameservers] = []
domain.nameservers.each do |ns|
h[:nameservers] << {
hostname: ns.hostname,
updated_at: ns.updated_at.try(:to_s, :iso8601)
name: tc.name,
email: tc.email,
changed: tc.updated_at.try(:to_s, :iso8601)
}
end
# update registar triggers when adding new attributes
h[:registrar] = domain.registrar.name
h[:registrar_url] = domain.registrar.url
h[:registrar_phone] = domain.registrar.phone
h[:registrar_address] = domain.registrar.address
h[:registrar_changed] = domain.registrar.updated_at.try(:to_s, :iso8601)
h[:nameservers] = domain.nameservers.pluck(:hostname).uniq.select(&:present?)
h[:nameservers_changed] = domain.nameservers.pluck(:updated_at).max.try(:to_s, :iso8601)
h[:dnssec_keys] = domain.dnskeys.map{|key| "#{key.flags} #{key.protocol} #{key.alg} #{key.public_key}" }
h[:dnssec_changed] = domain.dnskeys.pluck(:updated_at).max.try(:to_s, :iso8601) rescue nil
h[:disclosed] = @disclosed
h
end
def generated_body
<<-EOS
Estonia .ee Top Level Domain WHOIS server
Domain:
name: #{json['name']}
registrant: #{json['registrant']}
status: #{json['status']}
registered: #{Time.zone.parse(json['registered'])}
changed: #{Time.zone.parse(json['updated_at'])}
expire: #{Time.zone.parse(json['valid_to'])}
outzone:
delete:
#{contacts_body(json['admin_contacts'], json['tech_contacts'])}
Registrar:
name: #{json['registrar']}
phone: #{json['registrar_phone']}
address: #{json['registrar_address']}
changed: #{Time.zone.parse(json['registrar_update_at'])}
#{nameservers_body(json['nameservers'])}
Estonia .ee Top Level Domain WHOIS server
More information at http://internet.ee
EOS
template = Rails.root.join("app/views/for_models/whois.erb".freeze)
ERB.new(template.read, nil, "-").result(binding)
end
# rubocop:enable Metrics/MethodLength
# rubocop:enable Metrics/AbcSize
def contacts_body(admins, techs)
admins ||= []
techs ||= []
out = ''
out << (admins.size > 1 ? "\nAdministrative contacts" : "\nAdministrative contact")
admins.each do |c|
out << "\n name: #{c['name']}"
out << "\n email: Not Disclosed - Visit www.internet.ee for webbased WHOIS"
out << "\n registrar: #{c['registrar']}"
out << "\n created: #{Time.zone.parse(c['created_at'])}"
out << "\n"
end
out << (techs.size > 1 ? "\nTechnical contacts" : "\nTechnical contact:")
techs.each do |c|
out << "\n name: #{c['name']}"
out << "\n email: Not Disclosed - Visit www.internet.ee for webbased WHOIS"
out << "\n registrar: #{c['registrar']}"
out << "\n created: #{Time.zone.parse(c['created_at'])}"
out << "\n"
end
out
end
def nameservers_body(nservers)
nservers ||= []
out = "\nName servers:"
nservers.each do |ns|
out << "\n nserver: #{ns['hostname']}"
out << "\n changed: #{Time.zone.parse(ns['updated_at'])}"
out << "\n"
end
out
def populate
return if domain_id.blank?
self.json = generated_json
self.body = generated_body
self.name = json['name']
self.registrar_id = domain.registrar_id # for faster registrar updates
end
def update_whois_server

View file

@ -1,3 +1,7 @@
- content_for :actions do
= link_to('#', class: 'btn btn-default', "data-container": "body", "data-title": t('list_format_is_in_yaml'), "data-content": "domain.ee: authinfopw<br>seconddomain.ee:<br>thirddomain.ee: authinfo3<br><br>#{t('if_auth_info_is_left_empty_it_will_be_auto_generated')}<br>#{t('each_domain_name_must_end_with_colon_sign')}", "data-placement": "left", "data-toggle": "popover", "data-html" => "true") do
%span.glyphicon.glyphicon-info-sign{"aria-hidden" => "true"}
= render 'shared/title', name: t(:reserved_domains)
= form_tag([:admin, :reserved_domains]) do |f|

View file

@ -0,0 +1,60 @@
Estonia .ee Top Level Domain WHOIS server
Domain:
name: <%= json['name'] %>
<%- for st in Array(json['status']) -%>
status: <%= st %>
<%- end -%>
registered: <%= json['registered'].to_s.tr('T',' ').sub('+', ' +') %>
changed: <%= json['changed'].to_s.tr('T',' ').sub('+', ' +') %>
expire: <%= json['expire'].to_s.tr('T',' ').sub('+', ' +') %>
outzone: <%= json['outzone'].to_s.tr('T',' ').sub('+', ' +') %>
delete: <%= json['delete'].to_s.tr('T',' ').sub('+', ' +') %>
Registrant:
name: <%= json['registrant'] %>
email: Not Disclosed - Visit www.internet.ee for webbased WHOIS
changed: <%= json['changed'].to_s.tr('T',' ').sub('+', ' +') %>
<%- if json['admin_contacts'].present? -%>
Administrative contact
<%- for contact in json['admin_contacts'] -%>
name: <%= contact['name'] %>
email: Not Disclosed - Visit www.internet.ee for webbased WHOIS
changed: <%= contact['changed'].to_s.tr('T',' ').sub('+', ' +') %>
<%- end -%>
<%- end -%>
<% if json['tech_contacts'].present? %>
Technical contact:
<%- for contact in json['admin_contacts'] -%>
name: <%= contact['name'] %>
email: Not Disclosed - Visit www.internet.ee for webbased WHOIS
changed: <%= contact['changed'].to_s.tr('T',' ').sub('+', ' +') %>
<%- end -%>
<%- end -%>
Registrar:
name: <%= json['registrar'] %>
url: <%= json['registrar_url'] %>
phone: <%= json['registrar_phone'] %>
changed: <%= json['registrar_changed'].to_s.tr('T',' ').sub('+', ' +') %>
<%- if json['nameservers'].present? -%>
Name servers:
<%- for server in json['nameservers'] -%>
nserver: <%= server %>
<%- end -%>
changed: <%= json['nameservers_changed'].to_s.tr('T',' ').sub('+', ' +') %>
<%- end -%>
<%- if json['dnssec_keys'].present? -%>
DNSSEC:
<%- for key in json['dnssec_keys'] -%>
dnskey: <%= key %>
<%- end -%>
changed: <%= json['dnssec_changed'].to_s.tr('T',' ').sub('+', ' +') %>
<%- end -%>
Estonia .ee Top Level Domain WHOIS server
More information at http://internet.ee

View file

@ -1,6 +1,6 @@
<table width="600" cellspacing="0" cellpadding="0" border="0" align="center"><tbody>
<tr><td>
<p>Eesti Interneti Sihtasutus</p>
<p><img src="http://media.voog.com/0000/0037/4533/photos/eis_logo_rgb_block.png" width="150px" alt="Eesti Interneti Sihtasutus"></p>
</td></tr>
<tr><td>
<table cellspacing="0" cellpadding="0" border="0" align="center" style="text-align: justify; line-height: 16px; font-size: 12px;"><tbody>

View file

@ -8,5 +8,6 @@
.form-group
.col-md-3.control-label
= f.label :legal_document, t(:legal_document)
%p.help-block= t(:legal_document_max_size)
.col-md-7
= f.file_field :legal_document, :value => ''

View file

@ -16,6 +16,7 @@
.col-md-3.control-label
- c, fr = 'required', true if params[:domain_name].blank?
= label_tag 'domain[legal_document]', t(:legal_document), class: c
%p.help-block= t(:legal_document_max_size)
.col-md-7
= file_field_tag 'domain[legal_document]', required: fr
.col-md-4

View file

@ -9,6 +9,7 @@
.form-group
.col-md-4.control-label
= label_tag 'domain[legal_document]', t(:legal_document), class: 'required'
%p.help-block= t(:legal_document_max_size)
.col-md-6
= file_field_tag 'domain[legal_document]', required: true
= hidden_field_tag 'domain[name]', params[:domain_name]

View file

@ -18,9 +18,8 @@
.col-md-3.control-label
= label_tag "domain_contacts_attributes_#{k}_code", t(:id), class: 'required'
.col-md-7.has-feedback
= select_tag "domain[contacts_attributes][#{k}][code]",
options_for_select(@contacts_autocomplete_map, selected: v['code']),
include_blank: true, class: 'js-combobox js-contact-code', required: true
= text_field_tag "domain[contacts_attributes][#{k}][code]", v['code'], class: "hidden"
= text_field_tag "domain[contacts_attributes][#{k}][code_helper]", contacts.find_by(code: v['code']).try(:search_name), class: 'form-control', data: {autocomplete: search_contacts_registrar_domains_path}, required: true
:coffee
clone = $('.js-contact:first').clone()
@ -39,4 +38,5 @@
# remove link for temp
item.find('a.add-domain-contact').each (k, v) ->
$(v).hide()
new Autocomplete()
$clone: clone

View file

@ -20,9 +20,9 @@
.col-md-3.control-label
= label_tag :domain_registrant, t(:registrant), class: 'required'
.col-md-7
= select_tag "domain[registrant]",
options_for_select(@contacts_autocomplete_map, selected: @domain_params[:registrant]),
include_blank: true, class: 'js-combobox', required: true
= text_field_tag 'domain[registrant]', @domain_params[:registrant], class: "hidden"
= text_field_tag 'domain[registrant_helper]', contacts.find_by(code: @domain_params[:registrant]).try(:search_name),
class: 'form-control', data: {autocomplete: search_contacts_registrar_domains_path}, required: true
- unless params[:domain_name]
.form-group

View file

@ -21,7 +21,7 @@
</create>
<extension>
<eis:extdata xmlns:eis="https://epp.tld.ee/schema/eis-1.0.xsd">
<eis:ident type="bic" cc="EE">123</eis:ident>
<eis:ident type="org" cc="EE">123</eis:ident>
<eis:legalDocument type="pdf">
dGVzdCBmYWlsCg==
</eis:legalDocument>