mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 09:57:23 +02:00
108869472-filter_and_view_fixes
This commit is contained in:
parent
8d35fe9e77
commit
b013acad7c
4 changed files with 11 additions and 5 deletions
|
@ -25,6 +25,8 @@ class Admin::DomainVersionsController < AdminController
|
||||||
case key
|
case key
|
||||||
when 'event'
|
when 'event'
|
||||||
whereS += " AND event = '#{value}'"
|
whereS += " AND event = '#{value}'"
|
||||||
|
when 'name'
|
||||||
|
whereS += " AND (object->>'name' ~* '#{value}' OR object_changes->>'name' ~* '#{value}')"
|
||||||
else
|
else
|
||||||
whereS += create_where_string(key, value)
|
whereS += create_where_string(key, value)
|
||||||
end
|
end
|
||||||
|
@ -47,11 +49,12 @@ class Admin::DomainVersionsController < AdminController
|
||||||
per_page = 7
|
per_page = 7
|
||||||
@version = DomainVersion.find(params[:id])
|
@version = DomainVersion.find(params[:id])
|
||||||
@versions = DomainVersion.where(item_id: @version.item_id).order(id: :desc)
|
@versions = DomainVersion.where(item_id: @version.item_id).order(id: :desc)
|
||||||
|
@versions_map = @versions.all.map(&:id)
|
||||||
|
|
||||||
# what we do is calc amount of results until needed version
|
# what we do is calc amount of results until needed version
|
||||||
# then we cacl which page it is
|
# then we cacl which page it is
|
||||||
if params[:page].blank?
|
if params[:page].blank?
|
||||||
counter = @versions.where("id > ?", @version.id).count
|
counter = @versions_map.index(@version.id) + 1
|
||||||
page = counter / per_page
|
page = counter / per_page
|
||||||
page += 1 if (counter % per_page) != 0
|
page += 1 if (counter % per_page) != 0
|
||||||
params[:page] = page
|
params[:page] = page
|
||||||
|
|
|
@ -69,6 +69,8 @@
|
||||||
- if contact.nil? && ver = ContactVersion.where(item_id: domain.registrant_id).last
|
- if contact.nil? && ver = ContactVersion.where(item_id: domain.registrant_id).last
|
||||||
- contact = Contact.new(ver.object.to_h.merge(ver.object_changes.to_h.each_with_object({}){|(k,v), o| o[k]=v.last } ))
|
- contact = Contact.new(ver.object.to_h.merge(ver.object_changes.to_h.each_with_object({}){|(k,v), o| o[k]=v.last } ))
|
||||||
= contact.try(:name)
|
= contact.try(:name)
|
||||||
|
= " ".html_safe
|
||||||
|
= "(#{t(:deleted)})"
|
||||||
%td
|
%td
|
||||||
- if domain.registrar
|
- if domain.registrar
|
||||||
= link_to(domain.registrar, admin_registrar_path(domain.registrar))
|
= link_to(domain.registrar, admin_registrar_path(domain.registrar))
|
||||||
|
|
|
@ -104,16 +104,16 @@
|
||||||
= domain.registrar.name
|
= domain.registrar.name
|
||||||
%span{:style => "margin: 20px 20px; clear:both;"}
|
%span{:style => "margin: 20px 20px; clear:both;"}
|
||||||
|
|
||||||
- if @version.previous
|
- if prev = @versions_map[(@versions_map.index(@version.id) - 1)]
|
||||||
= link_to(t(:previous),
|
= link_to(t(:previous),
|
||||||
admin_domain_version_path(@version.previous.id),
|
admin_domain_version_path(prev),
|
||||||
class: 'btn btn-primary')
|
class: 'btn btn-primary')
|
||||||
- else
|
- else
|
||||||
%a.btn.btn-primary.disabled{:href => "#"}
|
%a.btn.btn-primary.disabled{:href => "#"}
|
||||||
%span= t(:previous)
|
%span= t(:previous)
|
||||||
- if @version.next
|
- if nxt = @versions_map[(@versions_map.index(@version.id) + 1)]
|
||||||
= link_to(t(:next),
|
= link_to(t(:next),
|
||||||
admin_domain_version_path(@version.next.id),
|
admin_domain_version_path(nxt),
|
||||||
class: 'btn btn-default')
|
class: 'btn btn-default')
|
||||||
- else
|
- else
|
||||||
%a.btn.btn-default.disabled{:href => "#"}
|
%a.btn.btn-default.disabled{:href => "#"}
|
||||||
|
|
|
@ -959,3 +959,4 @@ en:
|
||||||
verified_confirm: 'Verified status is for cases when current registrant is the one applying for the update. Legal document signed by the registrant is required. Are you sure this update is properly verified with the registrant?'
|
verified_confirm: 'Verified status is for cases when current registrant is the one applying for the update. Legal document signed by the registrant is required. Are you sure this update is properly verified with the registrant?'
|
||||||
verified: 'Verified'
|
verified: 'Verified'
|
||||||
only_estonian_residets_can_signin: "Access currently available only to Estonian citizens and e-residents with Estonian ID-card or Mobile-ID."
|
only_estonian_residets_can_signin: "Access currently available only to Estonian citizens and e-residents with Estonian ID-card or Mobile-ID."
|
||||||
|
deleted: 'Deleted'
|
Loading…
Add table
Add a link
Reference in a new issue