mirror of
https://github.com/internetee/registry.git
synced 2025-07-21 10:16:01 +02:00
Merge branch '108869472-objects_archive' into staging
This commit is contained in:
commit
0a73085ac2
5 changed files with 51 additions and 30 deletions
|
@ -30,7 +30,7 @@ class Admin::ContactVersionsController < AdminController
|
||||||
def show
|
def show
|
||||||
per_page = 7
|
per_page = 7
|
||||||
@version = ContactVersion.find(params[:id])
|
@version = ContactVersion.find(params[:id])
|
||||||
@q = ContactVersion.where(item_id: @version.item_id).order(created_at: :asc).search
|
@q = ContactVersion.where(item_id: @version.item_id).order(created_at: :desc).search
|
||||||
@versions = @q.result.page(params[:page])
|
@versions = @q.result.page(params[:page])
|
||||||
@versions = @versions.per(per_page)
|
@versions = @versions.per(per_page)
|
||||||
end
|
end
|
||||||
|
@ -40,7 +40,7 @@ class Admin::ContactVersionsController < AdminController
|
||||||
end
|
end
|
||||||
|
|
||||||
def create_where_string(key, value)
|
def create_where_string(key, value)
|
||||||
" AND object->>'#{key}' ~ '#{value}'"
|
" AND object->>'#{key}' LIKE '%#{value}%'"
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -8,13 +8,13 @@ class Admin::DomainVersionsController < AdminController
|
||||||
@versions = @q.result.page(params[:page])
|
@versions = @q.result.page(params[:page])
|
||||||
search_params = params[:q].deep_dup
|
search_params = params[:q].deep_dup
|
||||||
|
|
||||||
if search_params[:registrant]
|
if search_params[:registrant].present?
|
||||||
registrant = Contact.find_by(name: search_params[:registrant].strip)
|
registrants = Contact.where("name like ?", "%#{search_params[:registrant].strip}%")
|
||||||
search_params.delete(:registrant)
|
search_params.delete(:registrant)
|
||||||
end
|
end
|
||||||
|
|
||||||
if search_params[:registrar]
|
if search_params[:registrar].present?
|
||||||
registrar = Registrar.find_by(name: search_params[:registrar].strip)
|
registrars = Registrar.where("name like ?", "%#{search_params[:registrar].strip}%")
|
||||||
search_params.delete(:registrar)
|
search_params.delete(:registrar)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -30,8 +30,8 @@ class Admin::DomainVersionsController < AdminController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
whereS += " AND object->>'registrant_id' = '#{registrant.id}'" if registrant
|
whereS += " AND object->>'registrant_id' IN (#{registrants.map { |r| "'#{r.id.to_s}'" }.join ','})" if registrants
|
||||||
whereS += " AND object->>'registrar_id' = '#{registrar.id}'" if registrar
|
whereS += " AND object->>'registrar_id' IN (#{registrars.map { |r| "'#{r.id.to_s}'" }.join ','})" if registrars
|
||||||
|
|
||||||
versions = DomainVersion.includes(:item).where(whereS)
|
versions = DomainVersion.includes(:item).where(whereS)
|
||||||
@q = versions.search(params[:q])
|
@q = versions.search(params[:q])
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
.col-md-3
|
.col-md-3
|
||||||
.form-group
|
.form-group
|
||||||
= f.label :id
|
= f.label :id
|
||||||
= f.search_field :id, value: params[:q][:id], class: 'form-control', placeholder: t(:id)
|
= f.search_field :code, value: params[:q][:code], class: 'form-control', placeholder: t(:id)
|
||||||
.col-md-3
|
.col-md-3
|
||||||
.form-group
|
.form-group
|
||||||
= f.label :ident
|
= f.label :ident
|
||||||
|
|
|
@ -24,15 +24,17 @@
|
||||||
%dd{class: changing_css_class(@version,"ident_country_code", "ident_type", "ident")}
|
%dd{class: changing_css_class(@version,"ident_country_code", "ident_type", "ident")}
|
||||||
= ident_for(contact)
|
= ident_for(contact)
|
||||||
|
|
||||||
%dt= t(:email)
|
- if contact.email.present?
|
||||||
%dd{class: changing_css_class(@version,"email")}
|
%dt= t(:email)
|
||||||
= contact.email
|
%dd{class: changing_css_class(@version,"email")}
|
||||||
|
= contact.email
|
||||||
|
|
||||||
%dt= t(:phone)
|
- if contact.phone.present?
|
||||||
%dd{class: changing_css_class(@version,"phone")}
|
%dt= t(:phone)
|
||||||
= contact.phone
|
%dd{class: changing_css_class(@version,"phone")}
|
||||||
|
= contact.phone
|
||||||
|
|
||||||
- if contact.fax
|
- if contact.fax.present?
|
||||||
%dt= t(:fax)
|
%dt= t(:fax)
|
||||||
%dd{class: changing_css_class(@version,"fax")}
|
%dd{class: changing_css_class(@version,"fax")}
|
||||||
= contact.fax
|
= contact.fax
|
||||||
|
@ -57,20 +59,25 @@
|
||||||
%dt= t(:org_name)
|
%dt= t(:org_name)
|
||||||
%dd{class: changing_css_class(@version,"org_name")}= contact.org_name
|
%dd{class: changing_css_class(@version,"org_name")}= contact.org_name
|
||||||
|
|
||||||
%dt= t(:street)
|
- if contact.street.present?
|
||||||
%dd{class: changing_css_class(@version,"street")}= contact.street.to_s.gsub("\n", '<br>').html_safe
|
%dt= t(:street)
|
||||||
|
%dd{class: changing_css_class(@version,"street")}= contact.street.to_s.gsub("\n", '<br>').html_safe
|
||||||
|
|
||||||
%dt= t(:city)
|
- if contact.city.present?
|
||||||
%dd{class: changing_css_class(@version,"city")}= contact.city
|
%dt= t(:city)
|
||||||
|
%dd{class: changing_css_class(@version,"city")}= contact.city
|
||||||
|
|
||||||
%dt= t(:zip)
|
- if contact.zip.present?
|
||||||
%dd{class: changing_css_class(@version,"zip")}= contact.zip
|
%dt= t(:zip)
|
||||||
|
%dd{class: changing_css_class(@version,"zip")}= contact.zip
|
||||||
|
|
||||||
%dt= t(:state)
|
- if contact.state.present?
|
||||||
%dd{class: changing_css_class(@version,"state")}= contact.state
|
%dt= t(:state)
|
||||||
|
%dd{class: changing_css_class(@version,"state")}= contact.state
|
||||||
|
|
||||||
%dt= t(:country)
|
- if contact.country.present?
|
||||||
%dd{class: changing_css_class(@version,"country_code")}= contact.country
|
%dt= t(:country)
|
||||||
|
%dd{class: changing_css_class(@version,"country_code")}= contact.country
|
||||||
|
|
||||||
|
|
||||||
%span{:style => "padding-right:10px; float: right;"}
|
%span{:style => "padding-right:10px; float: right;"}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
- domain = Domain.new(@version.object.to_h)
|
- domain = Domain.new(@version.object.to_h)
|
||||||
- @version.object_changes.to_h.each{|k,v| domain[k]=v.last}
|
- @version.object_changes.to_h.each{|k,v| domain[k]=v.last}
|
||||||
|
|
||||||
= render 'shared/title', name: domain.name
|
|
||||||
|
|
||||||
- if @version
|
- if @version
|
||||||
- children = HashWithIndifferentAccess.new(@version.children)
|
- children = HashWithIndifferentAccess.new(@version.children)
|
||||||
- nameservers = Nameserver.all_versions_for(children[:nameservers], @version.created_at)
|
- nameservers = Nameserver.all_versions_for(children[:nameservers], @version.created_at)
|
||||||
|
@ -12,11 +10,14 @@
|
||||||
- registrant = Contact.all_versions_for(children[:registrant], @version.created_at)
|
- registrant = Contact.all_versions_for(children[:registrant], @version.created_at)
|
||||||
- event = @version.event
|
- event = @version.event
|
||||||
- creator = plain_username(@version.terminator)
|
- creator = plain_username(@version.terminator)
|
||||||
|
- domain = Domain.new(@version.object.to_h)
|
||||||
|
- @version.object_changes.to_h.each{|k,v| domain[k]=v.last}
|
||||||
|
|
||||||
|
= render 'shared/title', name: domain.name
|
||||||
|
|
||||||
.row
|
.row
|
||||||
.col-md-8
|
.col-md-8
|
||||||
.panel.panel-default{:style => "min-height:400px;"}
|
.panel.panel-default{:style => "min-height:450px;"}
|
||||||
.panel-heading
|
.panel-heading
|
||||||
%h3.panel-title
|
%h3.panel-title
|
||||||
= l(@version.created_at, format: :short)
|
= l(@version.created_at, format: :short)
|
||||||
|
@ -26,6 +27,19 @@
|
||||||
%dl.dl-horizontal
|
%dl.dl-horizontal
|
||||||
%dt= t(:name)
|
%dt= t(:name)
|
||||||
%dd= link_to(domain.name, admin_domain_path(@version.item_id))
|
%dd= link_to(domain.name, admin_domain_path(@version.item_id))
|
||||||
|
%dt= t(:registered_at)
|
||||||
|
%dd
|
||||||
|
= l(domain.registered_at, format: :short)
|
||||||
|
|
||||||
|
%dt= t(:created)
|
||||||
|
%dd
|
||||||
|
= l(domain.created_at, format: :short)
|
||||||
|
|
||||||
|
%dt= t(:updated)
|
||||||
|
%dd
|
||||||
|
= l(domain.updated_at, format: :short)
|
||||||
|
|
||||||
|
%br
|
||||||
|
|
||||||
%dt= t(:statuses)
|
%dt= t(:statuses)
|
||||||
%dd{class: changing_css_class(@version,"statuses")}
|
%dd{class: changing_css_class(@version,"statuses")}
|
||||||
|
@ -105,7 +119,7 @@
|
||||||
%span= t(:next)
|
%span= t(:next)
|
||||||
|
|
||||||
.col-md-4
|
.col-md-4
|
||||||
.panel.panel-default{:style => "min-height:400px;"}
|
.panel.panel-default{:style => "min-height:450px;"}
|
||||||
%ul.nav.nav-pills.nav-stacked
|
%ul.nav.nav-pills.nav-stacked
|
||||||
- @versions.each do |vs|
|
- @versions.each do |vs|
|
||||||
- if vs.id == @version.id and vs.reify
|
- if vs.id == @version.id and vs.reify
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue