mirror of
https://github.com/internetee/registry.git
synced 2025-07-03 09:43:36 +02:00
Pending delete or update added to domain log view #2785
This commit is contained in:
parent
e9cf3d2fbe
commit
e988bb6a20
5 changed files with 51 additions and 10 deletions
|
@ -4,6 +4,12 @@ class Admin::DomainVersionsController < AdminController
|
|||
def index
|
||||
@domain = Domain.find(params[:domain_id])
|
||||
@versions = @domain.versions
|
||||
|
||||
if @domain.pending_json.present?
|
||||
frame = Nokogiri::XML(@domain.pending_json['frame'])
|
||||
@pending_user = User.find(@domain.pending_json['current_user_id'])
|
||||
@pending_domain = Epp::Domain.new_from_epp(frame, @pending_user)
|
||||
end
|
||||
end
|
||||
|
||||
# def index
|
||||
|
|
|
@ -50,4 +50,9 @@ module ApplicationHelper
|
|||
amount ||= 0
|
||||
("%01.2f" % amount.round(2)).sub(/\./, ',')
|
||||
end
|
||||
|
||||
def plain_username(username)
|
||||
username ||= ''
|
||||
username.split(':').last.to_s.strip
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,16 +1,37 @@
|
|||
- if version.present? && domain.present?
|
||||
- children = HashWithIndifferentAccess.new(version.children)
|
||||
- nameservers = children[:nameservers] || []
|
||||
- tech_contacts = children[:tech_contacts] || []
|
||||
- admin_contacts = children[:admin_contacts] || []
|
||||
- registrant = children[:registrant] || []
|
||||
- version ||= false
|
||||
- domain ||= false
|
||||
- pending_user ||= false
|
||||
|
||||
- if domain.present?
|
||||
- if version # normal history
|
||||
- children = HashWithIndifferentAccess.new(version.children)
|
||||
- nameservers = children[:nameservers] || []
|
||||
- tech_contacts = children[:tech_contacts] || []
|
||||
- admin_contacts = children[:admin_contacts] || []
|
||||
- registrant = children[:registrant] || []
|
||||
- event = version.event
|
||||
- creator = plain_username(version.terminator)
|
||||
- elsif pending_user # pending history
|
||||
- nameservers = domain.nameservers
|
||||
- tech_contacts = domain.tech_contacts
|
||||
- admin_contacts = domain.admin_contacts
|
||||
- registrant = [domain.registrant]
|
||||
- event = 'PENDING'
|
||||
- creator = pending_user.try(:username)
|
||||
- else # if legacy data not presentable
|
||||
- nameservers = []
|
||||
- tech_contacts = []
|
||||
- admin_contacts = []
|
||||
- registrant = []
|
||||
- event = 'Log data is not viewable'
|
||||
- creator = ''
|
||||
|
||||
%td
|
||||
%p.nowrap
|
||||
= l(domain.updated_at, format: :short)
|
||||
= version.event
|
||||
= event
|
||||
%p.text-right
|
||||
= version.terminator
|
||||
= creator
|
||||
|
||||
%td
|
||||
%p
|
||||
|
|
|
@ -17,6 +17,11 @@
|
|||
%th{class: 'col-xs-2'}= t(:registrar)
|
||||
|
||||
%tbody
|
||||
- if @pending_domain.present?
|
||||
%tr.small
|
||||
= render 'admin/domain_versions/version',
|
||||
domain: @pending_domain, pending_user: @pending_user
|
||||
|
||||
- if @domain.versions.present?
|
||||
%tr.small
|
||||
= render 'admin/domain_versions/version',
|
||||
|
|
|
@ -8,7 +8,11 @@
|
|||
%th{class: 'col-xs-6'}= t(:status)
|
||||
%th{class: 'col-xs-6'}= t(:description)
|
||||
%tbody
|
||||
- @domain.statuses.each do |x|
|
||||
- @domain.statuses.each do |status|
|
||||
%tr
|
||||
%td= x
|
||||
%td
|
||||
- if [DomainStatus::PENDING_UPDATE, DomainStatus::PENDING_DELETE].include? status
|
||||
= link_to status, admin_domain_domain_versions_path(@domain.id)
|
||||
- else
|
||||
= status
|
||||
%td
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue