mirror of
https://github.com/internetee/registry.git
synced 2025-07-20 17:55:55 +02:00
Merge pull request #162 from internetee/108869472-objects_archive
108869472 objects archive
This commit is contained in:
commit
6d4facf1c0
14 changed files with 229 additions and 106 deletions
|
@ -20,7 +20,7 @@ class Admin::ContactVersionsController < AdminController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
versions = ContactVersion.includes(:item).where(whereS)
|
versions = ContactVersion.includes(:item).where(whereS).order(created_at: :desc, id: :desc)
|
||||||
@q = versions.search(params[:q])
|
@q = versions.search(params[:q])
|
||||||
@versions = @q.result.page(params[:page])
|
@versions = @q.result.page(params[:page])
|
||||||
@versions = @versions.per(params[:results_per_page]) if params[:results_per_page].to_i > 0
|
@versions = @versions.per(params[:results_per_page]) if params[:results_per_page].to_i > 0
|
||||||
|
@ -29,10 +29,20 @@ 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
|
@versions = ContactVersion.where(item_id: @version.item_id).order(created_at: :desc, id: :desc)
|
||||||
@versions = @q.result.page(params[:page])
|
@versions_map = @versions.all.map(&:id)
|
||||||
@versions = @versions.per(per_page)
|
|
||||||
|
# what we do is calc amount of results until needed version
|
||||||
|
# then we cacl which page it is
|
||||||
|
if params[:page].blank?
|
||||||
|
counter = @versions_map.index(@version.id) + 1
|
||||||
|
page = counter / per_page
|
||||||
|
page += 1 if (counter % per_page) != 0
|
||||||
|
params[:page] = page
|
||||||
|
end
|
||||||
|
|
||||||
|
@versions = @versions.page(params[:page]).per(per_page)
|
||||||
end
|
end
|
||||||
|
|
||||||
def search
|
def search
|
||||||
|
@ -40,7 +50,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}' ~* '#{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])
|
registrants = Contact.where("name ilike ?", "%#{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])
|
registrars = Registrar.where("name ilike ?", "%#{search_params[:registrar].strip}%")
|
||||||
search_params.delete(:registrar)
|
search_params.delete(:registrar)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -25,15 +25,19 @@ 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
|
||||||
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.present?
|
||||||
whereS += " AND object->>'registrar_id' = '#{registrar.id}'" if registrar
|
whereS += " AND 1=0" if registrants == []
|
||||||
|
whereS += " AND object->>'registrar_id' IN (#{registrars.map { |r| "'#{r.id.to_s}'" }.join ','})" if registrars.present?
|
||||||
|
whereS += " AND 1=0" if registrars == []
|
||||||
|
|
||||||
versions = DomainVersion.includes(:item).where(whereS)
|
versions = DomainVersion.includes(:item).where(whereS).order(created_at: :desc, id: :desc)
|
||||||
@q = versions.search(params[:q])
|
@q = versions.search(params[:q])
|
||||||
@versions = @q.result.page(params[:page])
|
@versions = @q.result.page(params[:page])
|
||||||
@versions = @versions.per(params[:results_per_page]) if params[:results_per_page].to_i > 0
|
@versions = @versions.per(params[:results_per_page]) if params[:results_per_page].to_i > 0
|
||||||
|
@ -43,10 +47,20 @@ class Admin::DomainVersionsController < AdminController
|
||||||
|
|
||||||
def show
|
def show
|
||||||
per_page = 7
|
per_page = 7
|
||||||
@version = DomainVersion.find(params[:id])
|
@version = DomainVersion.find(params[:id])
|
||||||
@q = DomainVersion.where(item_id: @version.item_id).order(created_at: :desc).search
|
@versions = DomainVersion.where(item_id: @version.item_id).order(created_at: :desc, id: :desc)
|
||||||
@versions = @q.result.page(params[:page])
|
@versions_map = @versions.all.map(&:id)
|
||||||
@versions = @versions.per(per_page)
|
|
||||||
|
# what we do is calc amount of results until needed version
|
||||||
|
# then we cacl which page it is
|
||||||
|
if params[:page].blank?
|
||||||
|
counter = @versions_map.index(@version.id) + 1
|
||||||
|
page = counter / per_page
|
||||||
|
page += 1 if (counter % per_page) != 0
|
||||||
|
params[:page] = page
|
||||||
|
end
|
||||||
|
|
||||||
|
@versions = @versions.page(params[:page]).per(per_page)
|
||||||
end
|
end
|
||||||
|
|
||||||
def search
|
def search
|
||||||
|
@ -54,7 +68,7 @@ class Admin::DomainVersionsController < AdminController
|
||||||
end
|
end
|
||||||
|
|
||||||
def create_where_string(key, value)
|
def create_where_string(key, value)
|
||||||
" AND object->>'#{key}' ~ '#{value}'"
|
" AND object->>'#{key}' ~* '#{value}'"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -11,21 +11,18 @@
|
||||||
.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
|
||||||
= f.search_field :ident, value: params[:q][:ident], class: 'form-control', placeholder: t(: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
|
.col-md-3
|
||||||
.form-group
|
.form-group
|
||||||
= label_tag :action
|
= 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' }
|
= select_tag '[q][event]', options_for_select([['Update', 'update'], ['Destroy', 'destroy'], ['Create', 'create']], 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
|
.col-md-3
|
||||||
.form-group
|
.form-group
|
||||||
= label_tag t(:results_per_page)
|
= label_tag t(:results_per_page)
|
||||||
|
@ -52,33 +49,35 @@
|
||||||
= t(:id)
|
= t(:id)
|
||||||
%th{class: 'col-xs-2'}
|
%th{class: 'col-xs-2'}
|
||||||
= t(:ident)
|
= t(:ident)
|
||||||
%th{class: 'col-xs-2'}
|
|
||||||
= 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)
|
||||||
|
%th{class: 'col-xs-2'}
|
||||||
|
= t(:created_at)
|
||||||
%tbody
|
%tbody
|
||||||
- @versions.each do |version|
|
- @versions.each do |version|
|
||||||
- if version.reify
|
- if version
|
||||||
|
- contact = Contact.new(version.object.to_h)
|
||||||
|
- version.object_changes.to_h.each{|k,v| contact[k]=v.last}
|
||||||
|
|
||||||
%tr
|
%tr
|
||||||
%td= link_to(version.reify.name, admin_contact_version_path(version.id))
|
%td= link_to(contact.name, admin_contact_version_path(version.id))
|
||||||
%td= version.reify.code
|
%td= contact.code
|
||||||
%td= ident_for(version.reify)
|
%td= ident_for(contact)
|
||||||
%td= version.reify.phone
|
|
||||||
%td
|
%td
|
||||||
- if version.reify.registrar
|
- if contact.registrar
|
||||||
= link_to(version.reify.registrar, admin_registrar_path(version.reify.registrar))
|
= link_to(contact.registrar, admin_registrar_path(contact.registrar))
|
||||||
%td= l(version.created_at, format: :short)
|
|
||||||
%td= version.event
|
%td= version.event
|
||||||
|
%td= l(version.created_at, format: :short)
|
||||||
|
|
||||||
|
|
||||||
.row
|
.row
|
||||||
.col-md-6
|
.col-md-6
|
||||||
= paginate @versions
|
= paginate @versions
|
||||||
.col-md-6.text-right
|
.col-md-6.text-right
|
||||||
|
.pagination
|
||||||
|
= t(:result_count, count: @versions.total_count)
|
||||||
|
|
||||||
|
|
||||||
:coffee
|
:coffee
|
||||||
|
|
|
@ -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,51 +59,50 @@
|
||||||
%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;"}
|
||||||
- if @version.previous
|
- if (prev = @versions_map[(@versions_map.index(@version.id) - 1)]) && @versions_map.index(@version.id) != 0
|
||||||
= link_to(t(:previous),
|
= link_to(t(:previous),
|
||||||
admin_contact_version_path(@version.previous.id),
|
admin_contact_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_contact_version_path(@version.next.id),
|
admin_contact_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 => "#"}
|
||||||
%span= t(:next)
|
%span= t(:next)
|
||||||
|
|
||||||
.col-md-4
|
.col-md-4
|
||||||
.panel.panel-default{:style => "min-height:420px;"}
|
.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
|
%li{class: (vs.id == @version.id) && :active}
|
||||||
%li.active
|
= link_to admin_contact_version_path(vs) do
|
||||||
= link_to admin_contact_version_path(vs.id) do
|
= l(vs.created_at, format: :short)
|
||||||
= l(vs.created_at, format: :short)
|
= vs.event
|
||||||
= 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;"}
|
%span{:style => "padding-left:10px; position: absolute; bottom: 10px;"}
|
||||||
= paginate @versions
|
= paginate @versions, theme: :admin
|
|
@ -19,7 +19,7 @@
|
||||||
.col-md-3
|
.col-md-3
|
||||||
.form-group
|
.form-group
|
||||||
= label_tag :action
|
= 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' }
|
= select_tag '[q][event]', options_for_select([['Update', 'update'], ['Destroy', 'destroy'], ['Create', 'create']], params[:q][:event]), { include_blank:true, multiple: false, placeholder: t(:choose), class: 'form-control js-combobox' }
|
||||||
.row
|
.row
|
||||||
.col-md-3
|
.col-md-3
|
||||||
.col-md-3
|
.col-md-3
|
||||||
|
@ -49,29 +49,41 @@
|
||||||
= 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)
|
||||||
|
%th{class: 'col-xs-2'}
|
||||||
|
= t(:created_at)
|
||||||
%tbody
|
%tbody
|
||||||
- @versions.each do |version|
|
- @versions.each do |version|
|
||||||
- if version.reify
|
- if version
|
||||||
|
- domain = Domain.new(version.object.to_h)
|
||||||
|
- version.object_changes.to_h.each{|k,v| domain[k]=v.last}
|
||||||
|
|
||||||
%tr
|
%tr
|
||||||
%td= link_to(version.reify.name, admin_domain_version_path(version.id))
|
%td= link_to(domain.name, admin_domain_version_path(version.id))
|
||||||
%td
|
%td
|
||||||
- if version.reify.registrant
|
- if domain.registrant
|
||||||
= link_to(version.reify.registrant, admin_registrant_path(version.reify.registrant))
|
= domain.registrant.name
|
||||||
|
- else
|
||||||
|
- contact = Contact.all_versions_for([domain.registrant_id], version.created_at).first
|
||||||
|
- 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.try(:name)
|
||||||
|
= " ".html_safe
|
||||||
|
= "(#{t(:deleted)})"
|
||||||
%td
|
%td
|
||||||
- if version.reify.registrar
|
- if domain.registrar
|
||||||
= link_to(version.reify.registrar, admin_registrar_path(version.reify.registrar))
|
= link_to(domain.registrar, admin_registrar_path(domain.registrar))
|
||||||
%td= l(version.created_at, format: :short)
|
|
||||||
%td= version.event
|
%td= version.event
|
||||||
|
%td= l(version.created_at, format: :short)
|
||||||
|
|
||||||
|
|
||||||
.row
|
.row
|
||||||
.col-md-6
|
.col-md-6
|
||||||
= paginate @versions
|
= paginate @versions
|
||||||
.col-md-6.text-right
|
.col-md-6.text-right
|
||||||
|
.pagination
|
||||||
|
= t(:result_count, count: @versions.total_count)
|
||||||
|
|
||||||
|
|
||||||
:coffee
|
:coffee
|
||||||
|
|
|
@ -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: @version.reify.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)
|
||||||
|
@ -13,10 +11,11 @@
|
||||||
- event = @version.event
|
- event = @version.event
|
||||||
- creator = plain_username(@version.terminator)
|
- creator = plain_username(@version.terminator)
|
||||||
|
|
||||||
|
= 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)
|
||||||
|
@ -25,7 +24,21 @@
|
||||||
.panel-body
|
.panel-body
|
||||||
%dl.dl-horizontal
|
%dl.dl-horizontal
|
||||||
%dt= t(:name)
|
%dt= t(:name)
|
||||||
%dd= link_to(domain.name, admin_domain_path(@version.item_id))
|
- if !domain.name
|
||||||
|
- domain_name = Domain.find(@version.item_id).try(:name)
|
||||||
|
- else
|
||||||
|
- domain_name = domain.name
|
||||||
|
%dd= link_to(domain_name, admin_domain_path(@version.item_id))
|
||||||
|
|
||||||
|
%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")}
|
||||||
|
@ -84,40 +97,35 @@
|
||||||
\...#{ns[:public_key].to_s[-20,20]}
|
\...#{ns[:public_key].to_s[-20,20]}
|
||||||
%br
|
%br
|
||||||
|
|
||||||
%dt= t(:registrar)
|
- if domain.registrar
|
||||||
%dd{class: changing_css_class(@version,"registrar_id")}
|
%dt= t(:registrar)
|
||||||
= link_to admin_registrar_path(domain.registrar), target: "registrar_#{domain.registrar.id}" do
|
%dd{class: changing_css_class(@version,"registrar_id")}
|
||||||
= domain.registrar.name
|
= link_to admin_registrar_path(domain.registrar), target: "registrar_#{domain.registrar.id}" do
|
||||||
|
= domain.registrar.name
|
||||||
|
%span{:style => "margin: 20px 20px; clear:both;"}
|
||||||
|
|
||||||
%span{:style => "padding-right:10px; padding-top:40px; float: right; bottom: 10px;"}
|
- if (prev = @versions_map[(@versions_map.index(@version.id) - 1)]) && @versions_map.index(@version.id) != 0
|
||||||
- if @version.previous
|
|
||||||
= 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 => "#"}
|
||||||
%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
|
%li{class: (vs.id == @version.id) && :active}
|
||||||
%li.active
|
= link_to admin_domain_version_path(vs) do
|
||||||
= link_to admin_domain_version_path(vs.id) do
|
= l(vs.created_at, format: :short)
|
||||||
= l(vs.created_at, format: :short)
|
= vs.event
|
||||||
= 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;"}
|
%span{:style => "padding-left:10px; position: absolute; bottom: 10px;"}
|
||||||
= paginate @versions
|
= paginate @versions, theme: :admin
|
||||||
|
|
11
app/views/kaminari/admin/_first_page.html.haml
Normal file
11
app/views/kaminari/admin/_first_page.html.haml
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
-# Link to the "First" page
|
||||||
|
-# available local variables
|
||||||
|
-# url: url to the first page
|
||||||
|
-# current_page: a page object for the currently displayed page
|
||||||
|
-# total_pages: total number of pages
|
||||||
|
-# per_page: number of items to fetch per page
|
||||||
|
-# remote: data-remote
|
||||||
|
%span.first
|
||||||
|
- param_name = current_page.instance_variable_get("@options")[:param_name] || Kaminari.config.param_name
|
||||||
|
- urlik = url_for( params.merge(param_name => 1, :only_path => true))
|
||||||
|
= link_to_unless current_page.first?, t('views.pagination.first').html_safe, urlik, :remote => remote
|
8
app/views/kaminari/admin/_gap.html.haml
Normal file
8
app/views/kaminari/admin/_gap.html.haml
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
-# Non-link tag that stands for skipped pages...
|
||||||
|
-# available local variables
|
||||||
|
-# current_page: a page object for the currently displayed page
|
||||||
|
-# total_pages: total number of pages
|
||||||
|
-# per_page: number of items to fetch per page
|
||||||
|
-# remote: data-remote
|
||||||
|
%span.page.gap
|
||||||
|
= t('views.pagination.truncate').html_safe
|
9
app/views/kaminari/admin/_last_page.html.haml
Normal file
9
app/views/kaminari/admin/_last_page.html.haml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
-# Link to the "Last" page
|
||||||
|
-# available local variables
|
||||||
|
-# url: url to the last page
|
||||||
|
-# current_page: a page object for the currently displayed page
|
||||||
|
-# total_pages: total number of pages
|
||||||
|
-# per_page: number of items to fetch per page
|
||||||
|
-# remote: data-remote
|
||||||
|
%span.last
|
||||||
|
= link_to_unless current_page.last?, t('views.pagination.last').html_safe, url, :remote => remote
|
9
app/views/kaminari/admin/_next_page.html.haml
Normal file
9
app/views/kaminari/admin/_next_page.html.haml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
-# Link to the "Next" page
|
||||||
|
-# available local variables
|
||||||
|
-# url: url to the next page
|
||||||
|
-# current_page: a page object for the currently displayed page
|
||||||
|
-# total_pages: total number of pages
|
||||||
|
-# per_page: number of items to fetch per page
|
||||||
|
-# remote: data-remote
|
||||||
|
%span.next
|
||||||
|
= link_to_unless current_page.last?, t('views.pagination.next').html_safe, url, :rel => 'next', :remote => remote
|
12
app/views/kaminari/admin/_page.html.haml
Normal file
12
app/views/kaminari/admin/_page.html.haml
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
-# Link showing page number
|
||||||
|
-# available local variables
|
||||||
|
-# page: a page object for "this" page
|
||||||
|
-# url: url to this page
|
||||||
|
-# current_page: a page object for the currently displayed page
|
||||||
|
-# total_pages: total number of pages
|
||||||
|
-# per_page: number of items to fetch per page
|
||||||
|
-# remote: data-remote
|
||||||
|
%span{:class => "page#{' current' if page.current?}"}
|
||||||
|
- param_name = current_page.instance_variable_get("@options")[:param_name] || Kaminari.config.param_name
|
||||||
|
- urlik = url_for( params.merge(param_name => page.to_i, :only_path => true))
|
||||||
|
= link_to_unless page.current?, page, urlik, {:remote => remote, :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil}
|
18
app/views/kaminari/admin/_paginator.html.haml
Normal file
18
app/views/kaminari/admin/_paginator.html.haml
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
-# The container tag
|
||||||
|
-# available local variables
|
||||||
|
-# current_page: a page object for the currently displayed page
|
||||||
|
-# total_pages: total number of pages
|
||||||
|
-# per_page: number of items to fetch per page
|
||||||
|
-# remote: data-remote
|
||||||
|
-# paginator: the paginator that renders the pagination tags inside
|
||||||
|
= paginator.render do
|
||||||
|
%nav.pagination
|
||||||
|
= first_page_tag unless current_page.first?
|
||||||
|
= prev_page_tag unless current_page.first?
|
||||||
|
- each_page do |page|
|
||||||
|
- if page.left_outer? || page.right_outer? || page.inside_window?
|
||||||
|
= page_tag page
|
||||||
|
- elsif !page.was_truncated?
|
||||||
|
= gap_tag
|
||||||
|
= next_page_tag unless current_page.last?
|
||||||
|
= last_page_tag unless current_page.last?
|
11
app/views/kaminari/admin/_prev_page.html.haml
Normal file
11
app/views/kaminari/admin/_prev_page.html.haml
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
-# Link to the "Previous" page
|
||||||
|
-# available local variables
|
||||||
|
-# url: url to the previous page
|
||||||
|
-# current_page: a page object for the currently displayed page
|
||||||
|
-# total_pages: total number of pages
|
||||||
|
-# per_page: number of items to fetch per page
|
||||||
|
-# remote: data-remote
|
||||||
|
%span.prev
|
||||||
|
- param_name = current_page.instance_variable_get("@options")[:param_name] || Kaminari.config.param_name
|
||||||
|
- urlik = url_for( params.merge(param_name => current_page.to_i - 1, :only_path => true))
|
||||||
|
= link_to_unless current_page.first?, t('views.pagination.previous').html_safe, urlik, :rel => 'prev', :remote => remote
|
|
@ -959,4 +959,5 @@ 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'
|
||||||
cant_match_version: 'Impossible match version with request'
|
cant_match_version: 'Impossible match version with request'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue