mirror of
https://github.com/internetee/registry.git
synced 2025-07-03 17:53:35 +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
|
def index
|
||||||
@domain = Domain.find(params[:domain_id])
|
@domain = Domain.find(params[:domain_id])
|
||||||
@versions = @domain.versions
|
@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
|
end
|
||||||
|
|
||||||
# def index
|
# def index
|
||||||
|
|
|
@ -50,4 +50,9 @@ module ApplicationHelper
|
||||||
amount ||= 0
|
amount ||= 0
|
||||||
("%01.2f" % amount.round(2)).sub(/\./, ',')
|
("%01.2f" % amount.round(2)).sub(/\./, ',')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def plain_username(username)
|
||||||
|
username ||= ''
|
||||||
|
username.split(':').last.to_s.strip
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,16 +1,37 @@
|
||||||
- if version.present? && domain.present?
|
- version ||= false
|
||||||
|
- domain ||= false
|
||||||
|
- pending_user ||= false
|
||||||
|
|
||||||
|
- if domain.present?
|
||||||
|
- if version # normal history
|
||||||
- children = HashWithIndifferentAccess.new(version.children)
|
- children = HashWithIndifferentAccess.new(version.children)
|
||||||
- nameservers = children[:nameservers] || []
|
- nameservers = children[:nameservers] || []
|
||||||
- tech_contacts = children[:tech_contacts] || []
|
- tech_contacts = children[:tech_contacts] || []
|
||||||
- admin_contacts = children[:admin_contacts] || []
|
- admin_contacts = children[:admin_contacts] || []
|
||||||
- registrant = children[:registrant] || []
|
- 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
|
%td
|
||||||
%p.nowrap
|
%p.nowrap
|
||||||
= l(domain.updated_at, format: :short)
|
= l(domain.updated_at, format: :short)
|
||||||
= version.event
|
= event
|
||||||
%p.text-right
|
%p.text-right
|
||||||
= version.terminator
|
= creator
|
||||||
|
|
||||||
%td
|
%td
|
||||||
%p
|
%p
|
||||||
|
|
|
@ -17,6 +17,11 @@
|
||||||
%th{class: 'col-xs-2'}= t(:registrar)
|
%th{class: 'col-xs-2'}= t(:registrar)
|
||||||
|
|
||||||
%tbody
|
%tbody
|
||||||
|
- if @pending_domain.present?
|
||||||
|
%tr.small
|
||||||
|
= render 'admin/domain_versions/version',
|
||||||
|
domain: @pending_domain, pending_user: @pending_user
|
||||||
|
|
||||||
- if @domain.versions.present?
|
- if @domain.versions.present?
|
||||||
%tr.small
|
%tr.small
|
||||||
= render 'admin/domain_versions/version',
|
= render 'admin/domain_versions/version',
|
||||||
|
|
|
@ -8,7 +8,11 @@
|
||||||
%th{class: 'col-xs-6'}= t(:status)
|
%th{class: 'col-xs-6'}= t(:status)
|
||||||
%th{class: 'col-xs-6'}= t(:description)
|
%th{class: 'col-xs-6'}= t(:description)
|
||||||
%tbody
|
%tbody
|
||||||
- @domain.statuses.each do |x|
|
- @domain.statuses.each do |status|
|
||||||
%tr
|
%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
|
%td
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue