mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 17:59:47 +02:00
Domain history to admin, added deleted domains info
This commit is contained in:
parent
c64fa8c132
commit
c49ec2b1c6
13 changed files with 80 additions and 245 deletions
|
@ -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
|
|
|
@ -1,18 +1,12 @@
|
||||||
class Admin::DomainVersionsController < AdminController
|
class Admin::DomainVersionsController < AdminController
|
||||||
before_action :set_domain, only: [:show]
|
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@q = Domain.search(params[:q])
|
@q = DomainVersion.deleted.search(params[:q])
|
||||||
@domains = @q.result.page(params[:page])
|
@domains = @q.result.page(params[:page])
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@versions = @domain.versions
|
# @q = DomainVersion.search(item_id_eq: params[:id])
|
||||||
end
|
@versions = DomainVersion.where(item_id: params[:id])
|
||||||
|
@name = @versions.last.reify.try(:name) if @versions
|
||||||
private
|
|
||||||
|
|
||||||
def set_domain
|
|
||||||
@domain = Domain.find(params[:id])
|
|
||||||
end
|
end
|
||||||
end
|
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
|
|
||||||
|
|
|
@ -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
|
%table.table.table-hover.table-bordered.table-condensed
|
||||||
%thead
|
%thead
|
||||||
%tr
|
%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'}
|
%th{class: 'col-xs-1'}
|
||||||
= t('shared.whodunnit')
|
= t('shared.name')
|
||||||
%th{class: 'col-xs1'}
|
%th{class: 'col-xs-1'}
|
||||||
= t('shared.event')
|
= sort_link(@q, 'whodunnit')
|
||||||
%th{class: 'col-xs1'}
|
%th{class: 'col-xs-1'}
|
||||||
= t('shared.created_at')
|
= sort_link(@q, 'created_at')
|
||||||
%th{class: 'col-xs1'}
|
|
||||||
= t('shared.action')
|
|
||||||
|
|
||||||
%tbody
|
%tbody
|
||||||
- @domains.each do |domain|
|
- @domains.each do |domain|
|
||||||
|
- obj = domain.reify
|
||||||
%tr
|
%tr
|
||||||
%td= domain.name
|
%td= link_to(obj.name, admin_domain_version_path(obj))
|
||||||
%td= domain.registrar.name if domain.registrar
|
%td= whodunnit_with_protocol(domain.whodunnit) unless domain.whodunnit.nil?
|
||||||
%td= domain.owner_contact.name if domain.owner_contact
|
%td= l(obj.created_at, format: :short)
|
||||||
%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')
|
|
||||||
|
|
||||||
.row
|
.row
|
||||||
.col-md-12
|
.col-md-12
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
.row
|
.row
|
||||||
.col-sm-6
|
.col-sm-6
|
||||||
%h2.text-center-xs
|
%h2.text-center-xs
|
||||||
= "#{t('shared.contact_details')}"
|
= "#{t('shared.domain_history')} for " + @name.to_s
|
||||||
.col-sm-6
|
.col-sm-6
|
||||||
%h2.text-right.text-center-xs
|
%h2.text-right.text-center-xs
|
||||||
|
|
||||||
|
@ -9,24 +9,20 @@
|
||||||
.row
|
.row
|
||||||
.col-md-12
|
.col-md-12
|
||||||
.table-responsive
|
.table-responsive
|
||||||
%table.table.table-hover.table-bordered.table-condensed
|
%table.table-hover.table-bordered.table-condensed
|
||||||
%thead
|
%thead
|
||||||
%tr
|
%tr
|
||||||
%th
|
%th{class: 'col-xs-2'}= t(:'shared.owner_contact')
|
||||||
whodunnit
|
%th{class: 'col-xs-2'}= t(:'shared.admin_contacts')
|
||||||
%th
|
%th{class: 'col-xs-2'}= t(:'shared.tech_contacts')
|
||||||
event
|
%th{class: 'col-xs-2'}= t(:'shared.nameservers')
|
||||||
%th
|
%th{class: 'col-xs-1'}= t(:'shared.changes_info')
|
||||||
created_at
|
|
||||||
|
|
||||||
%tbody
|
%tbody
|
||||||
- @versions.each_with_index do |version, index|
|
- @versions.each do |version|
|
||||||
- domain = version.reify(has_multiple: true)
|
|
||||||
- if domain
|
|
||||||
= render 'admin/domain_versions/history', version: version, index: index, domain: domain
|
|
||||||
- else
|
|
||||||
%tr
|
%tr
|
||||||
%td=version.whodunnit #contact.name if contact
|
- children = YAML.load(version.snapshot)
|
||||||
%td=version.event #contact.ident if contact
|
- next unless children.is_a?(Hash)
|
||||||
%td=version.created_at #contact.email if contact
|
- 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'))
|
= sort_link(@q, 'owner_contact_name', t('shared.owner'))
|
||||||
%th{class: 'col-xs-2'}
|
%th{class: 'col-xs-2'}
|
||||||
= sort_link(@q, 'valid_to', t('shared.valid_to'))
|
= sort_link(@q, 'valid_to', t('shared.valid_to'))
|
||||||
|
%th{class: 'col-xs-1'}= t('shared.history')
|
||||||
%tbody
|
%tbody
|
||||||
- @domains.each do |x|
|
- @domains.each do |x|
|
||||||
%tr
|
%tr
|
||||||
|
@ -36,6 +37,7 @@
|
||||||
%td= link_to(x.registrar, root_path) if x.registrar
|
%td= link_to(x.registrar, root_path) if x.registrar
|
||||||
%td= link_to(x.owner_contact, [:admin, x.owner_contact])
|
%td= link_to(x.owner_contact, [:admin, x.owner_contact])
|
||||||
%td= l(x.valid_to, format: :short)
|
%td= l(x.valid_to, format: :short)
|
||||||
|
%td= button_to(t(:'shared.history'), admin_domain_version_path(x.id), method: :get)
|
||||||
.row
|
.row
|
||||||
.col-md-12
|
.col-md-12
|
||||||
= paginate @domains
|
= paginate @domains
|
||||||
|
|
|
@ -44,22 +44,8 @@
|
||||||
%li
|
%li
|
||||||
= link_to t('shared.users'), admin_users_path
|
= 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
|
%li
|
||||||
= link_to t('shared.versions'), admin_domain_versions_path
|
= link_to t('shared.domains_history'), admin_domain_versions_path
|
||||||
%li
|
|
||||||
= link_to t('shared.deleted'), admin_domain_histories_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
|
%ul.nav.navbar-nav.navbar-right
|
||||||
%li= link_to t('shared.log_out', user: current_user), '/logout'
|
%li= link_to t('shared.log_out', user: current_user), '/logout'
|
||||||
|
|
|
@ -263,6 +263,7 @@ en:
|
||||||
registrar: 'Registrar'
|
registrar: 'Registrar'
|
||||||
owner: 'Owner'
|
owner: 'Owner'
|
||||||
domain_details: 'Domain details'
|
domain_details: 'Domain details'
|
||||||
|
domain_history: 'Domain history'
|
||||||
registered_at: 'Registered at'
|
registered_at: 'Registered at'
|
||||||
password: 'Password'
|
password: 'Password'
|
||||||
valid_from: 'Valid from'
|
valid_from: 'Valid from'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue