mirror of
https://github.com/internetee/registry.git
synced 2025-05-29 17:10:08 +02:00
18869472-archive_changes
This commit is contained in:
parent
f77e599e2f
commit
d3ad01f1a2
4 changed files with 85 additions and 4 deletions
|
@ -22,7 +22,12 @@ class Admin::DomainVersionsController < AdminController
|
||||||
|
|
||||||
search_params.each do |key, value|
|
search_params.each do |key, value|
|
||||||
next if value.empty?
|
next if value.empty?
|
||||||
whereS += create_where_string(key, value)
|
case key
|
||||||
|
when 'event'
|
||||||
|
whereS += " AND event = '#{value}'"
|
||||||
|
else
|
||||||
|
whereS += create_where_string(key, value)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
whereS += " AND object->>'registrant_id' ~ '#{registrant.id}'" if registrant
|
whereS += " AND object->>'registrant_id' ~ '#{registrant.id}'" if registrant
|
||||||
|
@ -36,6 +41,10 @@ class Admin::DomainVersionsController < AdminController
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def show
|
||||||
|
@version = DomainVersion.find(params[:id])
|
||||||
|
end
|
||||||
|
|
||||||
def search
|
def search
|
||||||
render json: DomainVersion.search_by_query(params[:q])
|
render json: DomainVersion.search_by_query(params[:q])
|
||||||
end
|
end
|
||||||
|
|
|
@ -53,6 +53,8 @@
|
||||||
= t(:phone)
|
= t(:phone)
|
||||||
%th{class: 'col-xs-2'}
|
%th{class: 'col-xs-2'}
|
||||||
= t(:registrar)
|
= t(:registrar)
|
||||||
|
%th{class: 'col-xs-2'}
|
||||||
|
= t(:action_date)
|
||||||
%th{class: 'col-xs-2'}
|
%th{class: 'col-xs-2'}
|
||||||
= t(:action)
|
= t(:action)
|
||||||
%tbody
|
%tbody
|
||||||
|
@ -65,6 +67,7 @@
|
||||||
%td
|
%td
|
||||||
- if version.reify.registrar
|
- if version.reify.registrar
|
||||||
= link_to(version.reify.registrar, admin_registrar_path(version.reify.registrar))
|
= link_to(version.reify.registrar, admin_registrar_path(version.reify.registrar))
|
||||||
|
%td= l(version.created_at, format: :short)
|
||||||
%td= version.event
|
%td= version.event
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -18,12 +18,15 @@
|
||||||
= f.search_field :registrar, value: params[:q][:registrar], class: 'form-control', placeholder: t(:registrant)
|
= f.search_field :registrar, value: params[:q][:registrar], class: 'form-control', placeholder: t(:registrant)
|
||||||
.col-md-3
|
.col-md-3
|
||||||
.form-group
|
.form-group
|
||||||
= label_tag t(:results_per_page)
|
= label_tag :action
|
||||||
= text_field_tag :results_per_page, params[:results_per_page], class: 'form-control', placeholder: t(:results_per_page)
|
= select_tag '[q][event]', options_for_select([['Update', 'update'], ['Destroy', 'destroy']], params[:q][:event]), { multiple: false, placeholder: t(:choose), class: 'form-control js-combobox' }
|
||||||
.row
|
.row
|
||||||
.col-md-3
|
.col-md-3
|
||||||
.col-md-3
|
.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;'}
|
.col-md-3{style: 'padding-top: 25px;'}
|
||||||
%button.btn.btn-primary
|
%button.btn.btn-primary
|
||||||
|
|
||||||
|
@ -46,18 +49,21 @@
|
||||||
= t(:registrant)
|
= t(:registrant)
|
||||||
%th{class: 'col-xs-2'}
|
%th{class: 'col-xs-2'}
|
||||||
= t(:registrar)
|
= t(:registrar)
|
||||||
|
%th{class: 'col-xs-2'}
|
||||||
|
= t(:action_date)
|
||||||
%th{class: 'col-xs-2'}
|
%th{class: 'col-xs-2'}
|
||||||
= t(:action)
|
= t(:action)
|
||||||
%tbody
|
%tbody
|
||||||
- @versions.each do |version|
|
- @versions.each do |version|
|
||||||
%tr
|
%tr
|
||||||
%td= version.reify.name
|
%td= link_to(version.reify.name, admin_domain_version_path(version.id))
|
||||||
%td
|
%td
|
||||||
- if version.reify.registrant
|
- if version.reify.registrant
|
||||||
= link_to(version.reify.registrant, admin_registrant_path(version.reify.registrant))
|
= link_to(version.reify.registrant, admin_registrant_path(version.reify.registrant))
|
||||||
%td
|
%td
|
||||||
- if version.reify.registrar
|
- if version.reify.registrar
|
||||||
= link_to(version.reify.registrar, admin_registrar_path(version.reify.registrar))
|
= link_to(version.reify.registrar, admin_registrar_path(version.reify.registrar))
|
||||||
|
%td= l(version.created_at, format: :short)
|
||||||
%td= version.event
|
%td= version.event
|
||||||
|
|
||||||
|
|
||||||
|
|
63
app/views/admin/domain_versions/show.haml
Normal file
63
app/views/admin/domain_versions/show.haml
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
= 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-12
|
||||||
|
.panel.panel-default
|
||||||
|
.panel-heading
|
||||||
|
%h3.panel-title
|
||||||
|
= l(@version.reify.updated_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
|
Loading…
Add table
Add a link
Reference in a new issue