mirror of
https://github.com/internetee/registry.git
synced 2025-08-05 01:11:43 +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
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 = YAML.load(version.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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue