mirror of
https://github.com/internetee/registry.git
synced 2025-07-25 20:18:22 +02:00
Merge branch 'master' of github.com:internetee/registry
This commit is contained in:
commit
38dc1c548b
45 changed files with 590 additions and 401 deletions
|
@ -1,3 +1,7 @@
|
|||
.error-tab > a {
|
||||
color: #a94442 !important;
|
||||
}
|
||||
|
||||
.edit-highlight {
|
||||
background-color: #E7E7E7;
|
||||
}
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
class Admin::ContactHistoriesController < AdminController
|
||||
def index
|
||||
@q = ContactVersion.deleted.search(params[:q])
|
||||
@contacts = @q.result.page(params[:page])
|
||||
end
|
||||
end
|
|
@ -1,18 +0,0 @@
|
|||
class Admin::ContactVersionsController < AdminController
|
||||
before_action :set_contact, only: [:show]
|
||||
|
||||
def index
|
||||
@q = Contact.search(params[:q])
|
||||
@contacts = @q.result.page(params[:page])
|
||||
end
|
||||
|
||||
def show
|
||||
@versions = @contact.versions
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def set_contact
|
||||
@contact = Contact.find(params[:id])
|
||||
end
|
||||
end
|
5
app/controllers/admin/delayed_jobs_controller.rb
Normal file
5
app/controllers/admin/delayed_jobs_controller.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
class Admin::DelayedJobsController < AdminController
|
||||
def index
|
||||
@jobs = Delayed::Job.all
|
||||
end
|
||||
end
|
|
@ -1,6 +0,0 @@
|
|||
class Admin::DomainHistoriesController < AdminController
|
||||
def index
|
||||
@q = DomainVersion.deleted.search(params[:q])
|
||||
@domains = @q.result.page(params[:page])
|
||||
end
|
||||
end
|
|
@ -1,18 +1,11 @@
|
|||
class Admin::DomainVersionsController < AdminController
|
||||
before_action :set_domain, only: [:show]
|
||||
|
||||
def index
|
||||
@q = Domain.search(params[:q])
|
||||
@q = DomainVersion.deleted.search(params[:q])
|
||||
@domains = @q.result.page(params[:page])
|
||||
end
|
||||
|
||||
def show
|
||||
@versions = @domain.versions
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def set_domain
|
||||
@domain = Domain.find(params[:id])
|
||||
@versions = DomainVersion.where(item_id: params[:id])
|
||||
@name = @versions.last.name
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
module Epp::ContactsHelper
|
||||
def create_contact
|
||||
@contact = Contact.new(contact_and_address_attributes)
|
||||
@contact.generate_code
|
||||
@contact.registrar = current_epp_user.registrar
|
||||
render '/epp/contacts/create' and return if stamp(@contact) && @contact.save
|
||||
|
||||
handle_errors(@contact)
|
||||
end
|
||||
|
||||
|
@ -16,7 +14,7 @@ module Epp::ContactsHelper
|
|||
render 'epp/contacts/update'
|
||||
else
|
||||
contact_exists?(code)
|
||||
handle_errors(@contact)
|
||||
handle_errors(@contact) and return
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -38,7 +36,7 @@ module Epp::ContactsHelper
|
|||
end
|
||||
|
||||
def info_contact
|
||||
handle_errors and return unless rights?
|
||||
# handle_errors and return unless rights?
|
||||
@contact = find_contact
|
||||
handle_errors(@contact) and return unless @contact
|
||||
render 'epp/contacts/info'
|
||||
|
@ -56,7 +54,7 @@ module Epp::ContactsHelper
|
|||
## CREATE
|
||||
def validate_contact_create_request
|
||||
@ph = params_hash['epp']['command']['create']['create']
|
||||
xml_attrs_present?(@ph, [%w(authInfo pw), %w(postalInfo)])
|
||||
xml_attrs_present?(@ph, [%w(postalInfo)])
|
||||
|
||||
return epp_errors.empty? unless @ph['postalInfo'].is_a?(Hash) || @ph['postalInfo'].is_a?(Array)
|
||||
|
||||
|
|
|
@ -17,18 +17,18 @@ class Address < ActiveRecord::Base
|
|||
# errors, used = [], []
|
||||
# parsed_frame.css('postalInfo').each do |pi|
|
||||
# attr = pi.attributes['type'].try(:value)
|
||||
# errors << {
|
||||
# code: 2003, msg: I18n.t('errors.messages.attr_missing', key: 'type')
|
||||
# errors << {
|
||||
# code: 2003, msg: I18n.t('errors.messages.attr_missing', key: 'type')
|
||||
# } and next unless attr
|
||||
# unless TYPES.include?(attr)
|
||||
# errors << {
|
||||
# code: 2005,
|
||||
# msg: I18n.t('errors.messages.invalid_type'), value: { obj: 'type', val: attr }
|
||||
# errors << {
|
||||
# code: 2005,
|
||||
# msg: I18n.t('errors.messages.invalid_type'), value: { obj: 'type', val: attr }
|
||||
# }
|
||||
# next
|
||||
# end
|
||||
# errors << {
|
||||
# code: 2005,
|
||||
# errors << {
|
||||
# code: 2005,
|
||||
# msg: I18n.t('errors.messages.repeating_postal_info')
|
||||
# } and next if used.include?(attr)
|
||||
# used << attr
|
||||
|
@ -54,11 +54,16 @@ class Address < ActiveRecord::Base
|
|||
return {} unless addr[:addr].is_a?(Hash)
|
||||
{ country_id: Country.find_by(iso: addr[:addr][:cc]).try(:id),
|
||||
city: addr[:addr][:city],
|
||||
street: addr[:addr][:street][0],
|
||||
street2: addr[:addr][:street][1],
|
||||
street3: addr[:addr][:street][2],
|
||||
street: pretty_street(addr[:addr][:street]), # [0],
|
||||
# street2: addr[:addr][:street][1],
|
||||
# street3: addr[:addr][:street][2],
|
||||
zip: addr[:addr][:pc]
|
||||
}.delete_if { |_k, v| v.nil? }
|
||||
end
|
||||
|
||||
def pretty_street(param_street)
|
||||
return param_street.join(',') if param_street.is_a?(Array)
|
||||
param_street
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
30
app/models/concerns/domain_version_observer.rb
Normal file
30
app/models/concerns/domain_version_observer.rb
Normal file
|
@ -0,0 +1,30 @@
|
|||
module DomainVersionObserver
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
included do
|
||||
after_save :delayed_whois_update
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def delayed_whois_update
|
||||
name = domain_name
|
||||
return unless name
|
||||
body = snapshot
|
||||
delay.update_whois(name, body)
|
||||
end
|
||||
|
||||
# not sure we need to pass in the params since i don't know if delayed job has access to
|
||||
# all the regular attributes and stuff
|
||||
def update_whois(domain_name, body)
|
||||
wd = WhoisDomain.find_or_initialize_by(name: domain_name)
|
||||
wd.body = body
|
||||
wd.save!
|
||||
end
|
||||
|
||||
def domain_name
|
||||
name = reify.try(:name)
|
||||
name = load_snapshot[:domain][:name] if event == 'create'
|
||||
return name if name
|
||||
end
|
||||
end
|
|
@ -18,10 +18,9 @@ class Contact < ActiveRecord::Base
|
|||
|
||||
accepts_nested_attributes_for :address, :disclosure
|
||||
|
||||
validates :code, :phone, :email, :ident, :address, :registrar, presence: true
|
||||
validates :phone, :email, :ident, :address, :registrar, presence: true
|
||||
|
||||
validate :ident_must_be_valid
|
||||
# validate :presence_of_one_address
|
||||
|
||||
validates :phone, format: /\+[0-9]{1,3}\.[0-9]{1,14}?/ # /\+\d{3}\.\d+/
|
||||
validates :email, format: /@/
|
||||
|
@ -37,6 +36,8 @@ class Contact < ActiveRecord::Base
|
|||
# after_commit :domains_snapshot
|
||||
after_update :domains_snapshot
|
||||
after_destroy :domains_snapshot
|
||||
before_create :generate_code
|
||||
before_create :generate_auth_info
|
||||
|
||||
# scopes
|
||||
scope :current_registrars, ->(id) { where(registrar_id: id) }
|
||||
|
@ -96,6 +97,10 @@ class Contact < ActiveRecord::Base
|
|||
self.code = SecureRandom.hex(4)
|
||||
end
|
||||
|
||||
def generate_auth_info
|
||||
self.auth_info = SecureRandom.hex(16)
|
||||
end
|
||||
|
||||
# Find a way to use self.domains with contact
|
||||
def domains_owned
|
||||
Domain.where(owner_contact_id: id)
|
||||
|
@ -149,16 +154,17 @@ class Contact < ActiveRecord::Base
|
|||
# non-EPP
|
||||
|
||||
# EPP
|
||||
def extract_attributes(ph, type = :create)
|
||||
def extract_attributes(ph, _type = :create)
|
||||
ph[:postalInfo] = ph[:postalInfo].first if ph[:postalInfo].is_a?(Array)
|
||||
contact_hash = {
|
||||
phone: ph[:voice],
|
||||
ident: ph[:ident],
|
||||
email: ph[:email],
|
||||
fax: ph[:fax],
|
||||
name: ph[:postalInfo].try(:[], :name),
|
||||
org_name: ph[:postalInfo].try(:[], :org)
|
||||
}
|
||||
contact_hash[:auth_info] = ph[:authInfo][:pw] if type == :create
|
||||
# contact_hash[:auth_info] = ph[:authInfo][:pw] if type == :create
|
||||
contact_hash.delete_if { |_k, v| v.nil? }
|
||||
end
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
class DomainVersion < PaperTrail::Version
|
||||
include UserEvents
|
||||
include DomainVersionObserver if Setting.whois_enabled # unless Setting.whois_enabled
|
||||
|
||||
scope :deleted, -> { where(event: 'destroy') }
|
||||
|
||||
|
@ -7,6 +8,29 @@ class DomainVersion < PaperTrail::Version
|
|||
self.sequence_name = :domain_version_id_seq
|
||||
|
||||
def load_snapshot
|
||||
YAML.load(snapshot)
|
||||
snapshot ? YAML.load(snapshot) : {}
|
||||
end
|
||||
|
||||
def previous?
|
||||
return true if previous
|
||||
false
|
||||
end
|
||||
|
||||
def name
|
||||
name = reify.try(:name)
|
||||
name = load_snapshot[:domain].try(:[], :name) unless name
|
||||
name
|
||||
end
|
||||
|
||||
def changed_elements
|
||||
return [] unless previous?
|
||||
@changes = []
|
||||
@previous_snap = previous.load_snapshot
|
||||
@snap = load_snapshot
|
||||
[:owner_contact, :tech_contacts, :admin_contacts, :nameservers, :domain].each do |key|
|
||||
@changes << key unless @snap[key] == @previous_snap[key]
|
||||
end
|
||||
|
||||
@changes
|
||||
end
|
||||
end
|
||||
|
|
3
app/models/whois_domain.rb
Normal file
3
app/models/whois_domain.rb
Normal file
|
@ -0,0 +1,3 @@
|
|||
class WhoisDomain < WhoisServer
|
||||
self.table_name = 'domains'
|
||||
end
|
4
app/models/whois_server.rb
Normal file
4
app/models/whois_server.rb
Normal file
|
@ -0,0 +1,4 @@
|
|||
class WhoisServer < ActiveRecord::Base
|
||||
self.abstract_class = true
|
||||
establish_connection :"#{Rails.env}_whois"
|
||||
end
|
|
@ -1,30 +0,0 @@
|
|||
.row
|
||||
.col-md-12
|
||||
%h2= t('shared.contacts')
|
||||
%hr
|
||||
.row
|
||||
.col-md-12
|
||||
.table-responsive
|
||||
%table.table.table-hover.table-bordered.table-condensed
|
||||
%thead
|
||||
%tr
|
||||
%th{class: 'col-xs-2'}
|
||||
= t('shared.name')
|
||||
%th{class: 'col-xs-1'}
|
||||
= t('shared.code')
|
||||
%th{class: 'col-xs-1'}
|
||||
= sort_link(@q, 'whodunnit', t('shared.whodunnit'))
|
||||
%th{class: 'col-xs-2'}
|
||||
= sort_link(@q, 'created_at', t('shared.created_at'))
|
||||
%tbody
|
||||
- @contacts.each do |version|
|
||||
- contact = version.reify
|
||||
- next unless contact
|
||||
%tr
|
||||
%td= contact.name #link_to(x, admin_contact_path(x))
|
||||
%td= contact.code #link_to(x, admin_contact_path(x))
|
||||
%td= link_to_whodunnit(version.whodunnit) if version
|
||||
%td= l(version.created_at, format: :short) if version
|
||||
.row
|
||||
.col-md-12
|
||||
= paginate @contacts
|
|
@ -1,23 +0,0 @@
|
|||
.row
|
||||
.col-md-6
|
||||
%dl.dl-horizontal
|
||||
%dt= t('shared.name')
|
||||
%dd= contact.name
|
||||
%dt= t('shared.ident')
|
||||
%dd= contact.ident
|
||||
%dt= t('shared.phone')
|
||||
%dd= contact.phone
|
||||
%dt= t('shared.email')
|
||||
%dd= contact.email
|
||||
%dt= t('shared.fax')
|
||||
%dd= contact.fax
|
||||
%dt= t('shared.org_name')
|
||||
%dd= contact.org_name
|
||||
.col-md-6
|
||||
%dl.dl-horizontal
|
||||
- if contact.address
|
||||
%dt= t('shared.city')
|
||||
%dd= contact.address.city
|
||||
%dt= t('shared.street')
|
||||
%dd= contact.address.street
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
.row
|
||||
.col-sm-6
|
||||
%h2.text-center-xs= t('shared.contacts_history')
|
||||
=# render 'search'
|
||||
.col-sm-6
|
||||
%h2.text-right.text-center-xs
|
||||
= link_to(t('shared.deleted'), admin_contact_versions_path(deleted: true), class: 'btn btn-primary')
|
||||
%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('shared.name'))
|
||||
%th{class: 'col-xs-1'}
|
||||
= sort_link(@q, 'code', t('shared.code'))
|
||||
%th{class: 'col-xs-1'}
|
||||
whodunnit
|
||||
= #sort_link(@q, 'ident', t('shared.identity_code'))
|
||||
%th{class: 'col-xs-1'}
|
||||
event
|
||||
= #sort_link(@q, 'email', t('shared.email'))
|
||||
%th{class: 'col-xs-2'}
|
||||
created_at
|
||||
%th{class: 'col-xs-1'}
|
||||
= t('shared.action')
|
||||
%tbody
|
||||
- @contacts.each do |x|
|
||||
%tr
|
||||
%td= x.name #link_to(x, admin_contact_path(x))
|
||||
%td= x.code #link_to(x, admin_contact_path(x))
|
||||
%td= link_to_whodunnit(x.versions.last.whodunnit) if x.versions.last
|
||||
%td= x.versions.last.event if x.versions.last
|
||||
%td= l(x.versions.last.created_at, format: :short) if x.versions.last
|
||||
%td= link_to(t('shared.history'), admin_contact_version_path(x), class: 'btn btn-primary btn-xs')
|
||||
.row
|
||||
.col-md-12
|
||||
= paginate @contacts
|
|
@ -1,40 +0,0 @@
|
|||
.row
|
||||
.col-sm-6
|
||||
%h2.text-center-xs
|
||||
= "#{t('shared.contact_details')}"
|
||||
.col-sm-6
|
||||
%h2.text-right.text-center-xs
|
||||
|
||||
%hr
|
||||
.row
|
||||
.col-md-12
|
||||
.table-responsive
|
||||
%table.table.table-hover.table-bordered.table-condensed
|
||||
%thead
|
||||
%tr
|
||||
%th
|
||||
whodunnit
|
||||
%th
|
||||
event
|
||||
%th
|
||||
created_at
|
||||
|
||||
%tbody
|
||||
- @versions.each_with_index do |version, index|
|
||||
- contact = version.reify(has_one: true)
|
||||
- if contact
|
||||
%tr.clickable{"data-target" => "#accordion-#{index}", "data-toggle" => "collapse"}
|
||||
%td=version.whodunnit #contact.name if contact
|
||||
%td=version.event #contact.ident if contact
|
||||
%td=version.created_at #contact.email if contact
|
||||
|
||||
%tr
|
||||
%td
|
||||
.collapse{ id: "accordion-#{index}" }
|
||||
= render 'admin/contact_versions/history', contact: contact
|
||||
- else
|
||||
%tr
|
||||
%td=version.whodunnit #contact.name if contact
|
||||
%td=version.event #contact.ident if contact
|
||||
%td=version.created_at #contact.email if contact
|
||||
|
|
@ -2,26 +2,27 @@
|
|||
.panel-heading
|
||||
%h3.panel-title= t('shared.address')
|
||||
.panel-body
|
||||
%dl.dl-horizontal
|
||||
%dt= t('shared.country')
|
||||
%dd= @contact.address.country
|
||||
- unless @contact.address.nil?
|
||||
%dl.dl-horizontal
|
||||
%dt= t('shared.country')
|
||||
%dd= @contact.address.country
|
||||
|
||||
%dt= t('shared.city')
|
||||
%dd= @contact.address.city
|
||||
%dt= t('shared.city')
|
||||
%dd= @contact.address.city
|
||||
|
||||
%dt= t('shared.street')
|
||||
%dd= @contact.address.street
|
||||
|
||||
- if @contact.address.street2
|
||||
%dt= t('shared.street')
|
||||
%dd= @contact.address.street2
|
||||
%dd= @contact.address.street
|
||||
|
||||
- if @contact.address.street3
|
||||
%dt= t('shared.street')
|
||||
%dd= @contact.address.street3
|
||||
- if @contact.address.street2
|
||||
%dt= t('shared.street')
|
||||
%dd= @contact.address.street2
|
||||
|
||||
- if @contact.address.street3
|
||||
%dt= t('shared.street')
|
||||
%dd= @contact.address.street3
|
||||
|
||||
|
||||
|
||||
%dt= t('shared.zip')
|
||||
%dd= @contact.address.zip
|
||||
%dt= t('shared.zip')
|
||||
%dd= @contact.address.zip
|
||||
|
||||
|
|
24
app/views/admin/delayed_jobs/index.haml
Normal file
24
app/views/admin/delayed_jobs/index.haml
Normal file
|
@ -0,0 +1,24 @@
|
|||
.row
|
||||
.col-sm-12
|
||||
%h2.text-center-xs= t('shared.jobs')
|
||||
|
||||
%hr
|
||||
.row
|
||||
.col-md-12
|
||||
.table-responsive
|
||||
%table.table.table-hover.table-bordered.table-condensed
|
||||
%thead
|
||||
%tr
|
||||
%th{class: 'col-xs-2'}= t('shared.priority')
|
||||
%th{class: 'col-xs-2'}= t('shared.attempts')
|
||||
%th{class: 'col-xs-2'}= t('shared.last_error')
|
||||
%th{class: 'col-xs-1'}= t('shared.run_at')
|
||||
%th{class: 'col-xs-1'}= t('shared.created_at')
|
||||
%tbody
|
||||
- @jobs.each do |job|
|
||||
%tr
|
||||
%td= job.priority
|
||||
%td= job.attempts
|
||||
%td= job.last_error
|
||||
%td= job.run_at
|
||||
%td= job.created_at
|
|
@ -1,30 +0,0 @@
|
|||
.row
|
||||
.col-md-12
|
||||
%h2= t('shared.domains')
|
||||
%hr
|
||||
.row
|
||||
.col-md-12
|
||||
.table-responsive
|
||||
%table.table.table-hover.table-bordered.table-condensed
|
||||
%thead
|
||||
%tr
|
||||
%th{class: 'col-xs-2'}
|
||||
= t('shared.name')
|
||||
%th{class: 'col-xs-2'}
|
||||
= t('shared.status')
|
||||
%th{class: 'col-xs-1'}
|
||||
= sort_link(@q, 'whodunnit', t('shared.whodunnit'))
|
||||
%th{class: 'col-xs-2'}
|
||||
= sort_link(@q, 'created_at', t('shared.created_at'))
|
||||
%tbody
|
||||
- @domains.each do |version|
|
||||
- domain = version.reify
|
||||
- next unless domain
|
||||
%tr
|
||||
%td= domain.name #link_to(x, admin_contact_path(x))
|
||||
%td= domain.status #link_to(x, admin_contact_path(x))
|
||||
%td= link_to_whodunnit(version.whodunnit) if version
|
||||
%td= l(version.created_at, format: :short) if version
|
||||
.row
|
||||
.col-md-12
|
||||
= paginate @domains
|
48
app/views/admin/domain_versions/_version.haml
Normal file
48
app/views/admin/domain_versions/_version.haml
Normal file
|
@ -0,0 +1,48 @@
|
|||
%td{ class: changes.include?(:owner_contact) ? 'edit-highlight' : 'no-highlight' }
|
||||
- if children[:owner_contact]
|
||||
%p{:style => "font-size:x-small;"}
|
||||
= children[:owner_contact][:name]
|
||||
= ","
|
||||
= children[:owner_contact][:phone]
|
||||
= ","
|
||||
= children[:owner_contact][:email]
|
||||
= ","
|
||||
= children[:owner_contact][:code]
|
||||
|
||||
%td{ class: changes.include?(:admin_contacts) ? 'edit-highlight' : 'no-highlight' }
|
||||
- if children[:admin_contacts]
|
||||
- children[:admin_contacts].each do |ac|
|
||||
%p{:style => "font-size:x-small;"}
|
||||
= ac[:name]
|
||||
= ","
|
||||
= ac[:phone]
|
||||
= ","
|
||||
= ac[:email]
|
||||
= ","
|
||||
= ac[:code]
|
||||
|
||||
%td{ class: changes.include?(:tech_contacts) ? 'edit-highlight' : 'no-highlight' }
|
||||
- if children[:tech_contacts]
|
||||
- children[:tech_contacts].each do |tc|
|
||||
%p{:style => "font-size:x-small;"}
|
||||
= tc[:name]
|
||||
= ","
|
||||
= tc[:phone]
|
||||
= ","
|
||||
= tc[:email]
|
||||
= ","
|
||||
= tc[:code]
|
||||
|
||||
%td{ class: changes.include?(:nameservers) ? 'edit-highlight' : 'no-highlight' }
|
||||
- if children[:nameservers]
|
||||
- children[:nameservers].each do |ns|
|
||||
%p{:style => "font-size:x-small;"}
|
||||
= ns[:hostname]
|
||||
= ","
|
||||
= ns[:ipv4] || ns[:ipv6]
|
||||
|
||||
%td
|
||||
%p{ :style => 'font-size:x-small;' }
|
||||
= l(version.created_at, format: :short)
|
||||
= whodunnit_with_protocol(version.whodunnit)
|
||||
= version.event
|
|
@ -8,31 +8,20 @@
|
|||
%table.table.table-hover.table-bordered.table-condensed
|
||||
%thead
|
||||
%tr
|
||||
%th{class: 'col-xs-2'}
|
||||
= sort_link(@q, 'name')
|
||||
%th{class: 'col-xs-2'}
|
||||
= sort_link(@q, 'registrar_name', t('shared.registrar'))
|
||||
%th{class: 'col-xs-2'}
|
||||
= sort_link(@q, 'owner_contact_name', t('shared.owner'))
|
||||
%th{class: 'col-xs-1'}
|
||||
= t('shared.whodunnit')
|
||||
%th{class: 'col-xs1'}
|
||||
= t('shared.event')
|
||||
%th{class: 'col-xs1'}
|
||||
= t('shared.created_at')
|
||||
%th{class: 'col-xs1'}
|
||||
= t('shared.action')
|
||||
= t('shared.name')
|
||||
%th{class: 'col-xs-1'}
|
||||
= sort_link(@q, 'whodunnit')
|
||||
%th{class: 'col-xs-1'}
|
||||
= sort_link(@q, 'created_at')
|
||||
|
||||
%tbody
|
||||
- @domains.each do |domain|
|
||||
- obj = domain.reify
|
||||
%tr
|
||||
%td= domain.name
|
||||
%td= domain.registrar.name if domain.registrar
|
||||
%td= domain.owner_contact.name if domain.owner_contact
|
||||
%td= link_to_whodunnit(domain.versions.last.whodunnit) if domain.versions.last
|
||||
%td= domain.versions.last.event if domain.versions.last
|
||||
%td= l(domain.versions.last.created_at, format: :short) if domain.versions.last
|
||||
%td= link_to(t('shared.history'), admin_domain_version_path(domain), class: 'btn btn-primary btn-xs')
|
||||
%td= link_to(obj.name, admin_domain_version_path(obj))
|
||||
%td= whodunnit_with_protocol(domain.whodunnit) unless domain.whodunnit.nil?
|
||||
%td= l(obj.created_at, format: :short)
|
||||
|
||||
.row
|
||||
.col-md-12
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
.row
|
||||
.col-sm-6
|
||||
%h2.text-center-xs
|
||||
= "#{t('shared.contact_details')}"
|
||||
= "#{t('shared.domain_history')} for " + @name.to_s
|
||||
.col-sm-6
|
||||
%h2.text-right.text-center-xs
|
||||
|
||||
|
@ -9,24 +9,20 @@
|
|||
.row
|
||||
.col-md-12
|
||||
.table-responsive
|
||||
%table.table.table-hover.table-bordered.table-condensed
|
||||
%table.table-hover.table-bordered.table-condensed
|
||||
%thead
|
||||
%tr
|
||||
%th
|
||||
whodunnit
|
||||
%th
|
||||
event
|
||||
%th
|
||||
created_at
|
||||
%th{class: 'col-xs-2'}= t(:'shared.owner_contact')
|
||||
%th{class: 'col-xs-2'}= t(:'shared.admin_contacts')
|
||||
%th{class: 'col-xs-2'}= t(:'shared.tech_contacts')
|
||||
%th{class: 'col-xs-2'}= t(:'shared.nameservers')
|
||||
%th{class: 'col-xs-1'}= t(:'shared.changes_info')
|
||||
|
||||
%tbody
|
||||
- @versions.each_with_index do |version, index|
|
||||
- domain = version.reify(has_multiple: true)
|
||||
- if domain
|
||||
= render 'admin/domain_versions/history', version: version, index: index, domain: domain
|
||||
- else
|
||||
%tr
|
||||
%td=version.whodunnit #contact.name if contact
|
||||
%td=version.event #contact.ident if contact
|
||||
%td=version.created_at #contact.email if contact
|
||||
|
||||
- @versions.each do |version|
|
||||
%tr
|
||||
- children = version.load_snapshot
|
||||
- next unless children.is_a?(Hash)
|
||||
- children = HashWithIndifferentAccess.new(children)
|
||||
- changes = version.changed_elements
|
||||
= render 'admin/domain_versions/version', children: children, version: version, changes: changes
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
= sort_link(@q, 'owner_contact_name', t('shared.owner'))
|
||||
%th{class: 'col-xs-2'}
|
||||
= sort_link(@q, 'valid_to', t('shared.valid_to'))
|
||||
%th{class: 'col-xs-1'}= t('shared.history')
|
||||
%tbody
|
||||
- @domains.each do |x|
|
||||
%tr
|
||||
|
@ -36,6 +37,7 @@
|
|||
%td= link_to(x.registrar, root_path) if x.registrar
|
||||
%td= link_to(x.owner_contact, [:admin, x.owner_contact])
|
||||
%td= l(x.valid_to, format: :short)
|
||||
%td= button_to(t(:'shared.history'), admin_domain_version_path(x.id), method: :get)
|
||||
.row
|
||||
.col-md-12
|
||||
= paginate @domains
|
||||
|
|
|
@ -1,14 +1,15 @@
|
|||
address = @contact.address
|
||||
xml.tag!('contact:postalInfo', type: 'int') do # TODO instance method of defining type
|
||||
xml.tag!('contact:name', @contact.name) if @contact.disclosure.int_name
|
||||
xml.tag!('contact:org', @contact.org_name) if @contact.disclosure.int_org_name
|
||||
if @contact.disclosure.int_addr
|
||||
xml.tag!('contact:addr') do
|
||||
xml.tag!('contact:street', address.street) if address.street
|
||||
xml.tag!('contact:street', address.street2) if address.street2
|
||||
xml.tag!('contact:street', address.street3) if address.street3
|
||||
xml.tag!('contact:cc', address.try(:country).try(:iso)) unless address.try(:country).nil?
|
||||
end
|
||||
xml.tag!('contact:postalInfo', type: 'int') do
|
||||
xml.tag!('contact:name', @contact.name)# if @contact.disclosure.try(:int_name)
|
||||
xml.tag!('contact:org', @contact.org_name)# if @contact.disclosure.try(:int_org_name)
|
||||
#if @contact.disclosure.try(:int_addr)
|
||||
xml.tag!('contact:addr') do
|
||||
xml.tag!('contact:street', address.street) if address.street
|
||||
#xml.tag!('contact:street', address.street2) if address.street2
|
||||
#xml.tag!('contact:street', address.street3) if address.street3
|
||||
xml.tag!('contact:cc', address.try(:country).try(:iso)) unless address.try(:country).nil?
|
||||
xml.tag!('contact:city', address.city)
|
||||
end
|
||||
#end
|
||||
end
|
||||
|
||||
|
|
|
@ -7,9 +7,10 @@ xml.epp_head do
|
|||
xml.resData do
|
||||
xml.tag!('contact:chkData', 'xmlns:contact' => 'urn:ietf:params:xml:ns:contact-1.0') do
|
||||
xml << render('/epp/contacts/postal_info')
|
||||
xml.tag!('contact:voice', @contact.phone) if @contact.disclosure.phone
|
||||
xml.tag!('contact:fax', @contact.fax) if @contact.disclosure.fax
|
||||
xml.tag!('contact:email', @contact.email) if @contact.disclosure.email
|
||||
xml.tag!('contact:id', @contact.code)
|
||||
xml.tag!('contact:voice', @contact.phone) #if @contact.disclosure.try(:phone)
|
||||
xml.tag!('contact:fax', @contact.fax) #if @contact.disclosure.try(:fax)
|
||||
xml.tag!('contact:email', @contact.email) #if @contact.disclosure..try(:email)
|
||||
xml.tag!('contact:clID', @current_epp_user.username) if @current_epp_user
|
||||
xml.tag!('contact:crID', @contact.cr_id ) if @contact.cr_id
|
||||
xml.tag!('contact:crDate', @contact.created_at)
|
||||
|
|
|
@ -46,22 +46,12 @@
|
|||
%li
|
||||
= link_to t('shared.users'), admin_users_path
|
||||
|
||||
%li.dropdown
|
||||
%a.dropdown-toggle{"data-toggle" => "dropdown", href: "#"}
|
||||
= t('shared.archives')
|
||||
%span.caret
|
||||
%ul.dropdown-menu{role: "menu"}
|
||||
%li.dropdown-header= t('shared.domain')
|
||||
%li
|
||||
= link_to t('shared.versions'), admin_domain_versions_path
|
||||
%li
|
||||
= link_to t('shared.deleted'), admin_domain_histories_path
|
||||
%li
|
||||
= link_to t('shared.domains_history'), admin_domain_versions_path
|
||||
|
||||
%li
|
||||
= link_to t('shared.jobs'), admin_delayed_jobs_path
|
||||
|
||||
%li.dropdown-header= t('shared.contact')
|
||||
%li
|
||||
= link_to t('shared.versions'), admin_contact_versions_path
|
||||
%li
|
||||
= link_to t('shared.deleted'), admin_contact_histories_path
|
||||
|
||||
%ul.nav.navbar-nav.navbar-right
|
||||
%li= link_to t('shared.log_out', user: current_user), '/logout'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue