mirror of
https://github.com/internetee/registry.git
synced 2025-07-20 17:55:55 +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
|
||||
per_page = 7
|
||||
@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 = @versions.per(per_page)
|
||||
end
|
||||
|
@ -40,7 +40,7 @@ class Admin::ContactVersionsController < AdminController
|
|||
end
|
||||
|
||||
def create_where_string(key, value)
|
||||
" AND object->>'#{key}' ~ '#{value}'"
|
||||
" AND object->>'#{key}' LIKE '%#{value}%'"
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -8,13 +8,13 @@ class Admin::DomainVersionsController < AdminController
|
|||
@versions = @q.result.page(params[:page])
|
||||
search_params = params[:q].deep_dup
|
||||
|
||||
if search_params[:registrant]
|
||||
registrant = Contact.find_by(name: search_params[:registrant].strip)
|
||||
if search_params[:registrant].present?
|
||||
registrants = Contact.where("name like ?", "%#{search_params[:registrant].strip}%")
|
||||
search_params.delete(:registrant)
|
||||
end
|
||||
|
||||
if search_params[:registrar]
|
||||
registrar = Registrar.find_by(name: search_params[:registrar].strip)
|
||||
if search_params[:registrar].present?
|
||||
registrars = Registrar.where("name like ?", "%#{search_params[:registrar].strip}%")
|
||||
search_params.delete(:registrar)
|
||||
end
|
||||
|
||||
|
@ -30,8 +30,8 @@ class Admin::DomainVersionsController < AdminController
|
|||
end
|
||||
end
|
||||
|
||||
whereS += " AND object->>'registrant_id' = '#{registrant.id}'" if registrant
|
||||
whereS += " AND object->>'registrar_id' = '#{registrar.id}'" if registrar
|
||||
whereS += " AND object->>'registrant_id' IN (#{registrants.map { |r| "'#{r.id.to_s}'" }.join ','})" if registrants
|
||||
whereS += " AND object->>'registrar_id' IN (#{registrars.map { |r| "'#{r.id.to_s}'" }.join ','})" if registrars
|
||||
|
||||
versions = DomainVersion.includes(:item).where(whereS)
|
||||
@q = versions.search(params[:q])
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
.col-md-3
|
||||
.form-group
|
||||
= 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
|
||||
.form-group
|
||||
= f.label :ident
|
||||
|
|
|
@ -24,15 +24,17 @@
|
|||
%dd{class: changing_css_class(@version,"ident_country_code", "ident_type", "ident")}
|
||||
= ident_for(contact)
|
||||
|
||||
%dt= t(:email)
|
||||
%dd{class: changing_css_class(@version,"email")}
|
||||
= contact.email
|
||||
- if contact.email.present?
|
||||
%dt= t(:email)
|
||||
%dd{class: changing_css_class(@version,"email")}
|
||||
= contact.email
|
||||
|
||||
%dt= t(:phone)
|
||||
%dd{class: changing_css_class(@version,"phone")}
|
||||
= contact.phone
|
||||
- if contact.phone.present?
|
||||
%dt= t(:phone)
|
||||
%dd{class: changing_css_class(@version,"phone")}
|
||||
= contact.phone
|
||||
|
||||
- if contact.fax
|
||||
- if contact.fax.present?
|
||||
%dt= t(:fax)
|
||||
%dd{class: changing_css_class(@version,"fax")}
|
||||
= contact.fax
|
||||
|
@ -57,20 +59,25 @@
|
|||
%dt= t(:org_name)
|
||||
%dd{class: changing_css_class(@version,"org_name")}= contact.org_name
|
||||
|
||||
%dt= t(:street)
|
||||
%dd{class: changing_css_class(@version,"street")}= contact.street.to_s.gsub("\n", '<br>').html_safe
|
||||
- if contact.street.present?
|
||||
%dt= t(:street)
|
||||
%dd{class: changing_css_class(@version,"street")}= contact.street.to_s.gsub("\n", '<br>').html_safe
|
||||
|
||||
%dt= t(:city)
|
||||
%dd{class: changing_css_class(@version,"city")}= contact.city
|
||||
- if contact.city.present?
|
||||
%dt= t(:city)
|
||||
%dd{class: changing_css_class(@version,"city")}= contact.city
|
||||
|
||||
%dt= t(:zip)
|
||||
%dd{class: changing_css_class(@version,"zip")}= contact.zip
|
||||
- if contact.zip.present?
|
||||
%dt= t(:zip)
|
||||
%dd{class: changing_css_class(@version,"zip")}= contact.zip
|
||||
|
||||
%dt= t(:state)
|
||||
%dd{class: changing_css_class(@version,"state")}= contact.state
|
||||
- if contact.state.present?
|
||||
%dt= t(:state)
|
||||
%dd{class: changing_css_class(@version,"state")}= contact.state
|
||||
|
||||
%dt= t(:country)
|
||||
%dd{class: changing_css_class(@version,"country_code")}= contact.country
|
||||
- if contact.country.present?
|
||||
%dt= t(:country)
|
||||
%dd{class: changing_css_class(@version,"country_code")}= contact.country
|
||||
|
||||
|
||||
%span{:style => "padding-right:10px; float: right;"}
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
- 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
|
||||
|
||||
- if @version
|
||||
- children = HashWithIndifferentAccess.new(@version.children)
|
||||
- nameservers = Nameserver.all_versions_for(children[:nameservers], @version.created_at)
|
||||
|
@ -12,11 +10,14 @@
|
|||
- registrant = Contact.all_versions_for(children[:registrant], @version.created_at)
|
||||
- event = @version.event
|
||||
- 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
|
||||
.col-md-8
|
||||
.panel.panel-default{:style => "min-height:400px;"}
|
||||
.panel.panel-default{:style => "min-height:450px;"}
|
||||
.panel-heading
|
||||
%h3.panel-title
|
||||
= l(@version.created_at, format: :short)
|
||||
|
@ -26,6 +27,19 @@
|
|||
%dl.dl-horizontal
|
||||
%dt= t(:name)
|
||||
%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)
|
||||
%dd{class: changing_css_class(@version,"statuses")}
|
||||
|
@ -105,7 +119,7 @@
|
|||
%span= t(:next)
|
||||
|
||||
.col-md-4
|
||||
.panel.panel-default{:style => "min-height:400px;"}
|
||||
.panel.panel-default{:style => "min-height:450px;"}
|
||||
%ul.nav.nav-pills.nav-stacked
|
||||
- @versions.each do |vs|
|
||||
- if vs.id == @version.id and vs.reify
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue