mirror of
https://github.com/internetee/registry.git
synced 2025-07-22 18:56:05 +02:00
Merge remote-tracking branch 'origin/108869472-objects_archive' into story/115762063--show-historical-nested
# Conflicts: # app/controllers/admin/domain_versions_controller.rb # config/locales/en.yml
This commit is contained in:
commit
5cce1ed2c8
13 changed files with 632 additions and 3 deletions
46
app/controllers/admin/contact_versions_controller.rb
Normal file
46
app/controllers/admin/contact_versions_controller.rb
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
class Admin::ContactVersionsController < AdminController
|
||||||
|
load_and_authorize_resource
|
||||||
|
|
||||||
|
def index
|
||||||
|
params[:q] ||= {}
|
||||||
|
|
||||||
|
@q = ContactVersion.search(params[:q])
|
||||||
|
@versions = @q.result.page(params[:page])
|
||||||
|
search_params = params[:q].deep_dup
|
||||||
|
|
||||||
|
whereS = "1=1"
|
||||||
|
|
||||||
|
search_params.each do |key, value|
|
||||||
|
next if value.empty?
|
||||||
|
case key
|
||||||
|
when 'event'
|
||||||
|
whereS += " AND event = '#{value}'"
|
||||||
|
else
|
||||||
|
whereS += create_where_string(key, value)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
versions = ContactVersion.includes(:item).where(whereS)
|
||||||
|
@q = versions.search(params[:q])
|
||||||
|
@versions = @q.result.page(params[:page])
|
||||||
|
@versions = @versions.per(params[:results_per_page]) if params[:results_per_page].to_i > 0
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
def show
|
||||||
|
per_page = 7
|
||||||
|
@version = ContactVersion.find(params[:id])
|
||||||
|
@q = ContactVersion.where(item_id: @version.item_id).order(created_at: :asc).search
|
||||||
|
@versions = @q.result.page(params[:page])
|
||||||
|
@versions = @versions.per(per_page)
|
||||||
|
end
|
||||||
|
|
||||||
|
def search
|
||||||
|
render json: ContactVersion.search_by_query(params[:q])
|
||||||
|
end
|
||||||
|
|
||||||
|
def create_where_string(key, value)
|
||||||
|
" AND object->>'#{key}' ~ '#{value}'"
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
|
@ -2,7 +2,60 @@ class Admin::DomainVersionsController < AdminController
|
||||||
load_and_authorize_resource
|
load_and_authorize_resource
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@domain = Domain.where(id: params[:domain_id]).includes(versions: :item).first
|
params[:q] ||= {}
|
||||||
@versions = @domain.versions
|
|
||||||
|
@q = DomainVersion.includes(:item).search(params[:q])
|
||||||
|
@versions = @q.result.page(params[:page])
|
||||||
|
search_params = params[:q].deep_dup
|
||||||
|
|
||||||
|
if search_params[:registrant]
|
||||||
|
registrant = Contact.find_by(name: search_params[:registrant])
|
||||||
|
search_params.delete(:registrant)
|
||||||
|
end
|
||||||
|
|
||||||
|
if search_params[:registrar]
|
||||||
|
registrar = Registrar.find_by(name: search_params[:registrar])
|
||||||
|
search_params.delete(:registrar)
|
||||||
|
end
|
||||||
|
|
||||||
|
whereS = "1=1"
|
||||||
|
|
||||||
|
search_params.each do |key, value|
|
||||||
|
next if value.empty?
|
||||||
|
case key
|
||||||
|
when 'event'
|
||||||
|
whereS += " AND event = '#{value}'"
|
||||||
|
else
|
||||||
|
whereS += create_where_string(key, value)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
whereS += " AND object->>'registrant_id' = '#{registrant.id}'" if registrant
|
||||||
|
whereS += " AND object->>'registrar_id' = '#{registrar.id}'" if registrar
|
||||||
|
|
||||||
|
versions = DomainVersion.includes(:item).where(whereS)
|
||||||
|
@q = versions.search(params[:q])
|
||||||
|
@versions = @q.result.page(params[:page])
|
||||||
|
@versions = @versions.per(params[:results_per_page]) if params[:results_per_page].to_i > 0
|
||||||
|
render "admin/domain_versions/archive"
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def show
|
||||||
|
per_page = 7
|
||||||
|
@version = DomainVersion.find(params[:id])
|
||||||
|
@q = DomainVersion.where(item_id: @version.item_id).order(created_at: :desc).search
|
||||||
|
@versions = @q.result.page(params[:page])
|
||||||
|
@versions = @versions.per(per_page)
|
||||||
|
end
|
||||||
|
|
||||||
|
def search
|
||||||
|
render json: DomainVersion.search_by_query(params[:q])
|
||||||
|
end
|
||||||
|
|
||||||
|
def create_where_string(key, value)
|
||||||
|
" AND object->>'#{key}' ~ '#{value}'"
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -77,6 +77,11 @@ class Admin::DomainsController < AdminController
|
||||||
redirect_to [:admin, @domain]
|
redirect_to [:admin, @domain]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def versions
|
||||||
|
@domain = Domain.where(id: params[:domain_id]).includes({versions: :item}).first
|
||||||
|
@versions = @domain.versions
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def set_domain
|
def set_domain
|
||||||
|
|
|
@ -95,6 +95,7 @@ class Ability
|
||||||
can :manage, ReservedDomain
|
can :manage, ReservedDomain
|
||||||
can :manage, ZonefileSetting
|
can :manage, ZonefileSetting
|
||||||
can :manage, DomainVersion
|
can :manage, DomainVersion
|
||||||
|
can :manage, ContactVersion
|
||||||
can :manage, Pricelist
|
can :manage, Pricelist
|
||||||
can :manage, User
|
can :manage, User
|
||||||
can :manage, ApiUser
|
can :manage, ApiUser
|
||||||
|
|
87
app/views/admin/contact_versions/index.haml
Normal file
87
app/views/admin/contact_versions/index.haml
Normal file
|
@ -0,0 +1,87 @@
|
||||||
|
= render 'shared/title', name: t(:contacts)
|
||||||
|
|
||||||
|
.row
|
||||||
|
.col-md-12
|
||||||
|
= search_form_for [:admin, @q], html: { style: 'margin-bottom: 0;', class: 'js-form', autocomplete: 'off' } do |f|
|
||||||
|
.row
|
||||||
|
.col-md-3
|
||||||
|
.form-group
|
||||||
|
= f.label :name
|
||||||
|
= f.search_field :name, value: params[:q][:name], class: 'form-control', placeholder: t(:name)
|
||||||
|
.col-md-3
|
||||||
|
.form-group
|
||||||
|
= f.label :id
|
||||||
|
= f.search_field :id, value: params[:q][:id], class: 'form-control', placeholder: t(:id)
|
||||||
|
.col-md-3
|
||||||
|
.form-group
|
||||||
|
= f.label :ident
|
||||||
|
= f.search_field :ident, value: params[:q][:ident], class: 'form-control', placeholder: t(:ident)
|
||||||
|
.col-md-3
|
||||||
|
.form-group
|
||||||
|
= f.label :phone
|
||||||
|
= f.search_field :phone, value: params[:q][:phone], class: 'form-control', placeholder: t(:phone)
|
||||||
|
.row
|
||||||
|
.col-md-3
|
||||||
|
.col-md-3
|
||||||
|
.form-group
|
||||||
|
= label_tag :action
|
||||||
|
= select_tag '[q][event]', options_for_select([['Update', 'update'], ['Destroy', 'destroy']], params[:q][:event]), { include_blank:true, multiple: false, placeholder: t(:choose), class: 'form-control js-combobox' }
|
||||||
|
.col-md-3
|
||||||
|
.form-group
|
||||||
|
= label_tag t(:results_per_page)
|
||||||
|
= text_field_tag :results_per_page, params[:results_per_page], class: 'form-control', placeholder: t(:results_per_page)
|
||||||
|
.col-md-3{style: 'padding-top: 25px;'}
|
||||||
|
%button.btn.btn-primary
|
||||||
|
|
||||||
|
%span.glyphicon.glyphicon-search
|
||||||
|
|
||||||
|
%button.btn.btn-default.js-reset-form
|
||||||
|
= t(:clear_fields)
|
||||||
|
%hr
|
||||||
|
|
||||||
|
|
||||||
|
.row
|
||||||
|
.col-md-12
|
||||||
|
.table-responsive
|
||||||
|
%table.table.table-hover.table-bordered.table-condensed
|
||||||
|
%thead
|
||||||
|
%tr
|
||||||
|
%th{class: 'col-xs-2'}
|
||||||
|
= t(:name)
|
||||||
|
%th{class: 'col-xs-2'}
|
||||||
|
= t(:id)
|
||||||
|
%th{class: 'col-xs-2'}
|
||||||
|
= t(:ident)
|
||||||
|
%th{class: 'col-xs-2'}
|
||||||
|
= t(:phone)
|
||||||
|
%th{class: 'col-xs-2'}
|
||||||
|
= t(:registrar)
|
||||||
|
%th{class: 'col-xs-2'}
|
||||||
|
= t(:action_date)
|
||||||
|
%th{class: 'col-xs-2'}
|
||||||
|
= t(:action)
|
||||||
|
%tbody
|
||||||
|
- @versions.each do |version|
|
||||||
|
- if version.reify
|
||||||
|
%tr
|
||||||
|
%td= link_to(version.reify.name, admin_contact_version_path(version.id))
|
||||||
|
%td= version.reify.code
|
||||||
|
%td= ident_for(version.reify)
|
||||||
|
%td= version.reify.phone
|
||||||
|
%td
|
||||||
|
- if version.reify.registrar
|
||||||
|
= link_to(version.reify.registrar, admin_registrar_path(version.reify.registrar))
|
||||||
|
%td= l(version.created_at, format: :short)
|
||||||
|
%td= version.event
|
||||||
|
|
||||||
|
|
||||||
|
.row
|
||||||
|
.col-md-6
|
||||||
|
= paginate @versions
|
||||||
|
.col-md-6.text-right
|
||||||
|
|
||||||
|
|
||||||
|
:coffee
|
||||||
|
$(".js-reset-form").on "click", (e) ->
|
||||||
|
e.preventDefault();
|
||||||
|
window.location = "#{admin_contact_versions_path}"
|
96
app/views/admin/contact_versions/show.haml
Normal file
96
app/views/admin/contact_versions/show.haml
Normal file
|
@ -0,0 +1,96 @@
|
||||||
|
= render 'shared/title', name: @version.reify.name
|
||||||
|
|
||||||
|
.row
|
||||||
|
.col-md-8
|
||||||
|
.panel.panel-default{:style => "min-height:420px;"}
|
||||||
|
.panel-heading
|
||||||
|
%h3.panel-title
|
||||||
|
= l(@version.created_at, format: :short)
|
||||||
|
= @version.event
|
||||||
|
= plain_username(@version.terminator)
|
||||||
|
.panel-body
|
||||||
|
%dl.dl-horizontal
|
||||||
|
%dt= t(:id)
|
||||||
|
%dd= @version.reify.code
|
||||||
|
|
||||||
|
%dt= t(:ident)
|
||||||
|
%dd= ident_for(@version.reify)
|
||||||
|
|
||||||
|
%dt= t(:email)
|
||||||
|
%dd= @version.reify.email
|
||||||
|
|
||||||
|
%dt= t(:phone)
|
||||||
|
%dd= @version.reify.phone
|
||||||
|
|
||||||
|
- if @version.reify.fax
|
||||||
|
%dt= t(:fax)
|
||||||
|
%dd= @version.reify.fax
|
||||||
|
|
||||||
|
%br
|
||||||
|
|
||||||
|
%dt= t(:created)
|
||||||
|
%dd
|
||||||
|
= l(@version.reify.created_at, format: :short)
|
||||||
|
|
||||||
|
%dt= t(:updated)
|
||||||
|
%dd
|
||||||
|
= l(@version.reify.updated_at, format: :short)
|
||||||
|
|
||||||
|
%dt= t(:registrar)
|
||||||
|
%dd
|
||||||
|
- if @version.reify.registrar.present?
|
||||||
|
= link_to(@version.reify.registrar, admin_registrar_path(@version.reify.registrar))
|
||||||
|
|
||||||
|
%dl.dl-horizontal
|
||||||
|
- if @version.reify.org_name.present?
|
||||||
|
%dt= t(:org_name)
|
||||||
|
%dd= @version.reify.org_name
|
||||||
|
|
||||||
|
%dt= t(:street)
|
||||||
|
%dd= @version.reify.street.to_s.gsub("\n", '<br>').html_safe
|
||||||
|
|
||||||
|
%dt= t(:city)
|
||||||
|
%dd= @version.reify.city
|
||||||
|
|
||||||
|
%dt= t(:zip)
|
||||||
|
%dd= @version.reify.zip
|
||||||
|
|
||||||
|
%dt= t(:state)
|
||||||
|
%dd= @version.reify.state
|
||||||
|
|
||||||
|
%dt= t(:country)
|
||||||
|
%dd= @version.reify.country
|
||||||
|
|
||||||
|
|
||||||
|
%span{:style => "padding-right:10px; float: right;"}
|
||||||
|
- if @version.previous
|
||||||
|
= link_to(t(:previous),
|
||||||
|
admin_contact_version_path(@version.previous.id),
|
||||||
|
class: 'btn btn-primary')
|
||||||
|
- else
|
||||||
|
%a.btn.btn-primary.disabled{:href => "#"}
|
||||||
|
%span= t(:previous)
|
||||||
|
- if @version.next
|
||||||
|
= link_to(t(:next),
|
||||||
|
admin_contact_version_path(@version.next.id),
|
||||||
|
class: 'btn btn-default')
|
||||||
|
- else
|
||||||
|
%a.btn.btn-default.disabled{:href => "#"}
|
||||||
|
%span= t(:next)
|
||||||
|
|
||||||
|
.col-md-4
|
||||||
|
.panel.panel-default{:style => "min-height:420px;"}
|
||||||
|
%ul.nav.nav-pills.nav-stacked
|
||||||
|
- @versions.each do |vs|
|
||||||
|
- if vs.id == @version.id
|
||||||
|
%li.active
|
||||||
|
= link_to admin_contact_version_path(vs.id) do
|
||||||
|
= l(vs.created_at, format: :short)
|
||||||
|
= vs.event
|
||||||
|
- else
|
||||||
|
%li
|
||||||
|
= link_to admin_contact_version_path(vs.id) do
|
||||||
|
= l(vs.created_at, format: :short)
|
||||||
|
= vs.event
|
||||||
|
%span{:style => "padding-left:10px; position: absolute; bottom: 10px;"}
|
||||||
|
= paginate @versions
|
80
app/views/admin/domain_versions/archive.haml
Normal file
80
app/views/admin/domain_versions/archive.haml
Normal file
|
@ -0,0 +1,80 @@
|
||||||
|
= render 'shared/title', name: t(:domains)
|
||||||
|
|
||||||
|
.row
|
||||||
|
.col-md-12
|
||||||
|
= search_form_for [:admin, @q], html: { style: 'margin-bottom: 0;', class: 'js-form', autocomplete: 'off' } do |f|
|
||||||
|
.row
|
||||||
|
.col-md-3
|
||||||
|
.form-group
|
||||||
|
= label_tag :name
|
||||||
|
= f.search_field :name, value: params[:q][:name], class: 'form-control', placeholder: t(:name)
|
||||||
|
.col-md-3
|
||||||
|
.form-group
|
||||||
|
= label_tag :registrant
|
||||||
|
= f.search_field :registrant, value: params[:q][:registrant], class: 'form-control', placeholder: t(:registrant)
|
||||||
|
.col-md-3
|
||||||
|
.form-group
|
||||||
|
= label_tag t(:registrar)
|
||||||
|
= f.search_field :registrar, value: params[:q][:registrar], class: 'form-control', placeholder: t(:registrant)
|
||||||
|
.col-md-3
|
||||||
|
.form-group
|
||||||
|
= label_tag :action
|
||||||
|
= select_tag '[q][event]', options_for_select([['Update', 'update'], ['Destroy', 'destroy']], params[:q][:event]), { include_blank:true, multiple: false, placeholder: t(:choose), class: 'form-control js-combobox' }
|
||||||
|
.row
|
||||||
|
.col-md-3
|
||||||
|
.col-md-3
|
||||||
|
.col-md-3
|
||||||
|
.form-group
|
||||||
|
= label_tag t(:results_per_page)
|
||||||
|
= text_field_tag :results_per_page, params[:results_per_page], class: 'form-control', placeholder: t(:results_per_page)
|
||||||
|
.col-md-3{style: 'padding-top: 25px;'}
|
||||||
|
%button.btn.btn-primary
|
||||||
|
|
||||||
|
%span.glyphicon.glyphicon-search
|
||||||
|
|
||||||
|
%button.btn.btn-default.js-reset-form
|
||||||
|
= t(:clear_fields)
|
||||||
|
%hr
|
||||||
|
|
||||||
|
|
||||||
|
.row
|
||||||
|
.col-md-12
|
||||||
|
.table-responsive
|
||||||
|
%table.table.table-hover.table-bordered.table-condensed
|
||||||
|
%thead
|
||||||
|
%tr
|
||||||
|
%th{class: 'col-xs-2'}
|
||||||
|
= t(:name)
|
||||||
|
%th{class: 'col-xs-2'}
|
||||||
|
= t(:registrant)
|
||||||
|
%th{class: 'col-xs-2'}
|
||||||
|
= t(:registrar)
|
||||||
|
%th{class: 'col-xs-2'}
|
||||||
|
= t(:action_date)
|
||||||
|
%th{class: 'col-xs-2'}
|
||||||
|
= t(:action)
|
||||||
|
%tbody
|
||||||
|
- @versions.each do |version|
|
||||||
|
- if version.reify
|
||||||
|
%tr
|
||||||
|
%td= link_to(version.reify.name, admin_domain_version_path(version.id))
|
||||||
|
%td
|
||||||
|
- if version.reify.registrant
|
||||||
|
= link_to(version.reify.registrant, admin_registrant_path(version.reify.registrant))
|
||||||
|
%td
|
||||||
|
- if version.reify.registrar
|
||||||
|
= link_to(version.reify.registrar, admin_registrar_path(version.reify.registrar))
|
||||||
|
%td= l(version.created_at, format: :short)
|
||||||
|
%td= version.event
|
||||||
|
|
||||||
|
|
||||||
|
.row
|
||||||
|
.col-md-6
|
||||||
|
= paginate @versions
|
||||||
|
.col-md-6.text-right
|
||||||
|
|
||||||
|
|
||||||
|
:coffee
|
||||||
|
$(".js-reset-form").on "click", (e) ->
|
||||||
|
e.preventDefault();
|
||||||
|
window.location = "#{admin_domain_versions_path}"
|
94
app/views/admin/domain_versions/show.haml
Normal file
94
app/views/admin/domain_versions/show.haml
Normal file
|
@ -0,0 +1,94 @@
|
||||||
|
= render 'shared/title', name: @version.reify.name
|
||||||
|
|
||||||
|
- if @version
|
||||||
|
- children = HashWithIndifferentAccess.new(@version.children)
|
||||||
|
- nameservers = Nameserver.where(id: children[:nameservers])
|
||||||
|
- tech_contacts = Contact.where(id: children[:tech_contacts])
|
||||||
|
- admin_contacts = Contact.where(id: children[:admin_contacts])
|
||||||
|
- registrant = Contact.where(id: children[:registrant])
|
||||||
|
- event = @version.event
|
||||||
|
- creator = plain_username(@version.terminator)
|
||||||
|
|
||||||
|
|
||||||
|
.row
|
||||||
|
.col-md-8
|
||||||
|
.panel.panel-default{:style => "min-height:400px;"}
|
||||||
|
.panel-heading
|
||||||
|
%h3.panel-title
|
||||||
|
= l(@version.created_at, format: :short)
|
||||||
|
= event
|
||||||
|
= creator
|
||||||
|
.panel-body
|
||||||
|
%dl.dl-horizontal
|
||||||
|
%dt= t(:name)
|
||||||
|
%dd= link_to(@version.reify.name, admin_domain_path(@version.item_id))
|
||||||
|
%dt= t(:statuses)
|
||||||
|
%dd
|
||||||
|
- if @version.reify.statuses.present?
|
||||||
|
- @version.reify.statuses.each do |s|
|
||||||
|
= s
|
||||||
|
%dt= t(:registrant)
|
||||||
|
%dd
|
||||||
|
- registrant.each do |r|
|
||||||
|
= r[:name]
|
||||||
|
= r[:phone]
|
||||||
|
= r[:email]
|
||||||
|
= r[:code]
|
||||||
|
%br
|
||||||
|
%dt= t(:admin_contacts)
|
||||||
|
%dd
|
||||||
|
- admin_contacts.each do |r|
|
||||||
|
= r[:name]
|
||||||
|
= r[:phone]
|
||||||
|
= r[:email]
|
||||||
|
= r[:code]
|
||||||
|
%br
|
||||||
|
%dt= t(:tech_contacts)
|
||||||
|
%dd
|
||||||
|
- tech_contacts.each do |r|
|
||||||
|
= r[:name]
|
||||||
|
= r[:phone]
|
||||||
|
= r[:email]
|
||||||
|
= r[:code]
|
||||||
|
%br
|
||||||
|
%dt= t(:nameservers)
|
||||||
|
%dd
|
||||||
|
- nameservers.each do |ns|
|
||||||
|
= ns[:hostname]
|
||||||
|
= ns[:ipv4]
|
||||||
|
= ns[:ipv6]
|
||||||
|
%br
|
||||||
|
%dt= t(:registrar)
|
||||||
|
%dd= @version.reify.registrar.name
|
||||||
|
%span{:style => "padding-right:10px; padding-top:40px; float: right; bottom: 10px;"}
|
||||||
|
- if @version.previous
|
||||||
|
= link_to(t(:previous),
|
||||||
|
admin_domain_version_path(@version.previous.id),
|
||||||
|
class: 'btn btn-primary')
|
||||||
|
- else
|
||||||
|
%a.btn.btn-primary.disabled{:href => "#"}
|
||||||
|
%span= t(:previous)
|
||||||
|
- if @version.next
|
||||||
|
= link_to(t(:next),
|
||||||
|
admin_domain_version_path(@version.next.id),
|
||||||
|
class: 'btn btn-default')
|
||||||
|
- else
|
||||||
|
%a.btn.btn-default.disabled{:href => "#"}
|
||||||
|
%span= t(:next)
|
||||||
|
|
||||||
|
.col-md-4
|
||||||
|
.panel.panel-default{:style => "min-height:400px;"}
|
||||||
|
%ul.nav.nav-pills.nav-stacked
|
||||||
|
- @versions.each do |vs|
|
||||||
|
- if vs.id == @version.id and vs.reify
|
||||||
|
%li.active
|
||||||
|
= link_to admin_domain_version_path(vs.id) do
|
||||||
|
= l(vs.created_at, format: :short)
|
||||||
|
= vs.event
|
||||||
|
- else
|
||||||
|
%li
|
||||||
|
= link_to admin_domain_version_path(vs.id) do
|
||||||
|
= l(vs.created_at, format: :short)
|
||||||
|
= vs.event
|
||||||
|
%span{:style => "padding-left:10px; position: absolute; bottom: 10px;"}
|
||||||
|
= paginate @versions
|
105
app/views/admin/domains/partials/_version.haml
Normal file
105
app/views/admin/domains/partials/_version.haml
Normal file
|
@ -0,0 +1,105 @@
|
||||||
|
- statuses_link ||= false
|
||||||
|
- version ||= false
|
||||||
|
- domain ||= false
|
||||||
|
- pending_user ||= false
|
||||||
|
|
||||||
|
- if domain.present?
|
||||||
|
- if version # normal history
|
||||||
|
- children = HashWithIndifferentAccess.new(version.children)
|
||||||
|
- nameservers = Nameserver.where(id: children[:nameservers])
|
||||||
|
- tech_contacts = Contact.where(id: children[:tech_contacts])
|
||||||
|
- admin_contacts = Contact.where(id: children[:admin_contacts])
|
||||||
|
- registrant = Contact.where(id: children[:registrant])
|
||||||
|
- event = version.event
|
||||||
|
- creator = plain_username(version.terminator)
|
||||||
|
- else # pending history
|
||||||
|
- nameservers = domain.nameservers
|
||||||
|
- tech_contacts = domain.tech_contacts
|
||||||
|
- admin_contacts = domain.admin_contacts
|
||||||
|
- registrant = [domain.registrant]
|
||||||
|
- creator = pending_user.try(:username)
|
||||||
|
- event = 'pending'
|
||||||
|
|
||||||
|
%td
|
||||||
|
%p.nowrap
|
||||||
|
= l(domain.updated_at, format: :shorts)
|
||||||
|
- if statuses_link
|
||||||
|
%br= link_to t(:edit_statuses), edit_admin_domain_path(params[:domain_id])
|
||||||
|
|
||||||
|
%p.text-right
|
||||||
|
= event
|
||||||
|
%br
|
||||||
|
= creator
|
||||||
|
|
||||||
|
%td
|
||||||
|
%p
|
||||||
|
- if domain.statuses.present?
|
||||||
|
- domain.statuses.each do |s|
|
||||||
|
= s
|
||||||
|
- if domain.status_notes.present?
|
||||||
|
- notes = domain.status_notes[s]
|
||||||
|
- if notes
|
||||||
|
%br
|
||||||
|
%i= notes
|
||||||
|
%br
|
||||||
|
- if domain.pending_json.present?
|
||||||
|
%p
|
||||||
|
= link_to t(:pending_epp), '#', class: 'js-pending-toggle'
|
||||||
|
|
||||||
|
%td
|
||||||
|
%p
|
||||||
|
= "#{domain.period}#{domain.period_unit}"
|
||||||
|
%br
|
||||||
|
= "#{l(domain.valid_from, format: :date)}"
|
||||||
|
%br
|
||||||
|
= "#{l(domain.valid_to, format: :date)}"
|
||||||
|
|
||||||
|
%td
|
||||||
|
- registrant.each do |r|
|
||||||
|
%p
|
||||||
|
= r[:name]
|
||||||
|
= r[:phone]
|
||||||
|
= r[:email]
|
||||||
|
%p
|
||||||
|
= r[:code]
|
||||||
|
|
||||||
|
%td
|
||||||
|
- admin_contacts.each do |ac|
|
||||||
|
%p
|
||||||
|
= ac[:name]
|
||||||
|
= ac[:phone]
|
||||||
|
= ac[:email]
|
||||||
|
%p
|
||||||
|
= ac[:code]
|
||||||
|
|
||||||
|
%td
|
||||||
|
- tech_contacts.each do |tc|
|
||||||
|
%p
|
||||||
|
= tc[:name]
|
||||||
|
= tc[:phone]
|
||||||
|
= tc[:email]
|
||||||
|
%p
|
||||||
|
= tc[:code]
|
||||||
|
|
||||||
|
%td
|
||||||
|
%p
|
||||||
|
- nameservers.each do |ns|
|
||||||
|
= ns[:hostname]
|
||||||
|
%br
|
||||||
|
= ns[:ipv4]
|
||||||
|
= ns[:ipv6]
|
||||||
|
|
||||||
|
%td
|
||||||
|
%p
|
||||||
|
= domain.registrar.name
|
||||||
|
|
||||||
|
- if domain.pending_json.present?
|
||||||
|
%tr.js-pending{ style: 'display: none;' }
|
||||||
|
%td{colspan: 8}
|
||||||
|
= preserve do
|
||||||
|
%pre
|
||||||
|
- formatted_req = Nokogiri::XML(domain.pending_json['frame'])
|
||||||
|
- if formatted_req.errors.none?
|
||||||
|
= formatted_req
|
||||||
|
- else
|
||||||
|
= domain.pending_json['frame']
|
44
app/views/admin/domains/versions.haml
Normal file
44
app/views/admin/domains/versions.haml
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
- content_for :actions do
|
||||||
|
= link_to(t(:back_to_domain), [:admin, @domain], class: 'btn btn-default')
|
||||||
|
= render 'shared/title', name: "#{t(:history)}: #{@domain.name}"
|
||||||
|
|
||||||
|
.row
|
||||||
|
.col-md-12
|
||||||
|
.table-responsive
|
||||||
|
%table.table-hover.table-bordered.table-condensed
|
||||||
|
%thead
|
||||||
|
%tr
|
||||||
|
%th{class: 'col-xs-1'}= t(:timestap)
|
||||||
|
%th{class: 'col-xs-2'}= t(:statuses)
|
||||||
|
%th{class: 'col-xs-1'}= t(:period)
|
||||||
|
%th{class: 'col-xs-2'}= t(:registrant)
|
||||||
|
%th{class: 'col-xs-2'}= t(:admin)
|
||||||
|
%th{class: 'col-xs-2'}= t(:tech)
|
||||||
|
%th{class: 'col-xs-2'}= t(:nameservers)
|
||||||
|
%th{class: 'col-xs-2'}= t(:registrar)
|
||||||
|
|
||||||
|
%tbody
|
||||||
|
- if @pending_domain.present?
|
||||||
|
%tr.small
|
||||||
|
= render 'admin/domains/partials/version',
|
||||||
|
domain: @pending_domain, pending_user: @pending_user, statuses_link: true
|
||||||
|
|
||||||
|
-# current version
|
||||||
|
- if @domain.versions.present?
|
||||||
|
%tr.small
|
||||||
|
= render 'admin/domains/partials/version',
|
||||||
|
domain: @domain, version: @domain.versions.last
|
||||||
|
|
||||||
|
-# all other older versions
|
||||||
|
- @domain.versions.not_creates.reverse.each do |version|
|
||||||
|
%tr.small
|
||||||
|
= render 'admin/domains/partials/version',
|
||||||
|
domain: version.reify, version: version.previous
|
||||||
|
|
||||||
|
:coffee
|
||||||
|
$(document).on 'click', '.js-pending-toggle', (e) ->
|
||||||
|
e.preventDefault()
|
||||||
|
|
||||||
|
$(document).on 'mousedown', '.js-pending-toggle', (e) ->
|
||||||
|
target = $(e.target)
|
||||||
|
target.parents('tr').next('tr.js-pending').toggle()
|
|
@ -57,6 +57,10 @@
|
||||||
%li= link_to t(:invoices), admin_invoices_path
|
%li= link_to t(:invoices), admin_invoices_path
|
||||||
%li= link_to t(:account_activities), admin_account_activities_path
|
%li= link_to t(:account_activities), admin_account_activities_path
|
||||||
%li.divider
|
%li.divider
|
||||||
|
%li.dropdown-header= t(:archive)
|
||||||
|
%li= link_to t(:domains_history), admin_domain_versions_path
|
||||||
|
%li= link_to t(:contacts_history), admin_contact_versions_path
|
||||||
|
%li.divider
|
||||||
%li.dropdown-header= t(:system)
|
%li.dropdown-header= t(:system)
|
||||||
%li= link_to t(:settings), admin_settings_path
|
%li= link_to t(:settings), admin_settings_path
|
||||||
%li= link_to t(:zonefile), admin_zonefile_settings_path
|
%li= link_to t(:zonefile), admin_zonefile_settings_path
|
||||||
|
|
|
@ -932,6 +932,8 @@ en:
|
||||||
if_auth_info_is_left_empty_it_will_be_auto_generated: 'If auth info is left empty, it will be auto generated.'
|
if_auth_info_is_left_empty_it_will_be_auto_generated: 'If auth info is left empty, it will be auto generated.'
|
||||||
each_domain_name_must_end_with_colon_sign: 'Each domain name must end with colon (:) sign.'
|
each_domain_name_must_end_with_colon_sign: 'Each domain name must end with colon (:) sign.'
|
||||||
expiration_remind_subject: 'The %{name} domain has expired'
|
expiration_remind_subject: 'The %{name} domain has expired'
|
||||||
|
next: 'Next'
|
||||||
|
previous: 'Previous'
|
||||||
personal_domain_verification_url: 'Personal domain verification url'
|
personal_domain_verification_url: 'Personal domain verification url'
|
||||||
available_verification_url_not_found: 'Available verification url not found, for domain.'
|
available_verification_url_not_found: 'Available verification url not found, for domain.'
|
||||||
contact_already_associated_with_the_domain: 'Object association prohibits operation, contact already associated with the domain'
|
contact_already_associated_with_the_domain: 'Object association prohibits operation, contact already associated with the domain'
|
||||||
|
|
|
@ -198,7 +198,7 @@ Rails.application.routes.draw do
|
||||||
end
|
end
|
||||||
|
|
||||||
resources :domains do
|
resources :domains do
|
||||||
resources :domain_versions
|
resources :domain_versions, controller: 'domains', action: 'versions'
|
||||||
resources :pending_updates
|
resources :pending_updates
|
||||||
resources :pending_deletes
|
resources :pending_deletes
|
||||||
member do
|
member do
|
||||||
|
@ -207,6 +207,18 @@ Rails.application.routes.draw do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
resources :domain_versions do
|
||||||
|
collection do
|
||||||
|
get 'search'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
resources :contact_versions do
|
||||||
|
collection do
|
||||||
|
get 'search'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
resources :settings
|
resources :settings
|
||||||
|
|
||||||
resources :blocked_domains do
|
resources :blocked_domains do
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue