mirror of
https://github.com/internetee/registry.git
synced 2025-07-01 16:53:37 +02:00
Deleted contacts and domains list
This commit is contained in:
parent
a41505e319
commit
f94dccfaa4
10 changed files with 88 additions and 5 deletions
6
app/controllers/admin/contact_histories_controller.rb
Normal file
6
app/controllers/admin/contact_histories_controller.rb
Normal file
|
@ -0,0 +1,6 @@
|
|||
class Admin::ContactHistoriesController < AdminController
|
||||
def index
|
||||
@q = ContactVersion.deleted.search(params[:q])
|
||||
@contacts = @q.result.page(params[:page])
|
||||
end
|
||||
end
|
6
app/controllers/admin/domain_histories_controller.rb
Normal file
6
app/controllers/admin/domain_histories_controller.rb
Normal file
|
@ -0,0 +1,6 @@
|
|||
class Admin::DomainHistoriesController < AdminController
|
||||
def index
|
||||
@q = DomainVersion.deleted.search(params[:q])
|
||||
@domains = @q.result.page(params[:page])
|
||||
end
|
||||
end
|
|
@ -34,7 +34,7 @@ class Contact < ActiveRecord::Base
|
|||
delegate :zip, to: :address#, prefix: true
|
||||
|
||||
# archiving
|
||||
has_paper_trail class_name: 'AddressVersion'
|
||||
has_paper_trail class_name: 'ContactVersion'
|
||||
|
||||
IDENT_TYPE_ICO = 'ico'
|
||||
IDENT_TYPES = [
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
class ContactVersion < PaperTrail::Version
|
||||
scope :deleted, -> { where(event: 'destroy') }
|
||||
|
||||
self.table_name = :contact_versions
|
||||
self.sequence_name = :contact_version_id_seq
|
||||
end
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
class DomainVersion < PaperTrail::Version
|
||||
scope :deleted, -> { where(event: 'destroy') }
|
||||
|
||||
self.table_name = :domain_versions
|
||||
self.sequence_name = :domain_version_id_seq
|
||||
end
|
||||
|
|
31
app/views/admin/contact_histories/index.haml
Normal file
31
app/views/admin/contact_histories/index.haml
Normal file
|
@ -0,0 +1,31 @@
|
|||
.row
|
||||
.col-md-12
|
||||
%h2= t('shared.contacts')
|
||||
%hr
|
||||
.row
|
||||
.col-md-12
|
||||
.table-responsive
|
||||
%table.table.table-hover.table-bordered.table-condensed
|
||||
%thead
|
||||
%tr
|
||||
%th{class: 'col-xs-2'}
|
||||
= sort_link(@q, 'name', t('shared.name'))
|
||||
%th{class: 'col-xs-1'}
|
||||
= sort_link(@q, 'code', t('shared.code'))
|
||||
%th{class: 'col-xs-1'}
|
||||
whodunnit
|
||||
= #sort_link(@q, 'ident', t('shared.identity_code'))
|
||||
%th{class: 'col-xs-2'}
|
||||
deleted_at
|
||||
%tbody
|
||||
- @contacts.each do |version|
|
||||
- contact = version.reify
|
||||
- next unless contact
|
||||
%tr
|
||||
%td= contact.name #link_to(x, admin_contact_path(x))
|
||||
%td= contact.code #link_to(x, admin_contact_path(x))
|
||||
%td= version.whodunnit if version
|
||||
%td= version.created_at if version
|
||||
.row
|
||||
.col-md-12
|
||||
= paginate @contacts
|
|
@ -4,7 +4,7 @@
|
|||
= render 'admin/contacts/partials/search'
|
||||
.col-sm-6
|
||||
%h2.text-right.text-center-xs
|
||||
= link_to(t('shared.add'), new_admin_contact_path, class: 'btn btn-primary')
|
||||
= link_to(t('shared.deleted'), admin_contact_versions_path(deleted: true), class: 'btn btn-primary')
|
||||
%hr
|
||||
.row
|
||||
.col-md-12
|
||||
|
|
29
app/views/admin/domain_histories/index.haml
Normal file
29
app/views/admin/domain_histories/index.haml
Normal file
|
@ -0,0 +1,29 @@
|
|||
.row
|
||||
.col-md-12
|
||||
%h2= t('shared.domains')
|
||||
%hr
|
||||
.row
|
||||
.col-md-12
|
||||
.table-responsive
|
||||
%table.table.table-hover.table-bordered.table-condensed
|
||||
%thead
|
||||
%tr
|
||||
%th{class: 'col-xs-2'}
|
||||
= sort_link(@q, 'name', t('shared.name'))
|
||||
%th{class: 'col-xs-1'}
|
||||
whodunnit
|
||||
= #sort_link(@q, 'ident', t('shared.identity_code'))
|
||||
%th{class: 'col-xs-2'}
|
||||
deleted_at
|
||||
%tbody
|
||||
- @domains.each do |version|
|
||||
- domain = version.reify
|
||||
- next unless domain
|
||||
%tr
|
||||
%td= domain.name #link_to(x, admin_contact_path(x))
|
||||
%td= domain.status #link_to(x, admin_contact_path(x))
|
||||
%td= version.whodunnit if version
|
||||
%td= version.created_at if version
|
||||
.row
|
||||
.col-md-12
|
||||
= paginate @domains
|
|
@ -51,10 +51,15 @@
|
|||
%ul.dropdown-menu{role: "menu"}
|
||||
%li.dropdown-header= t('shared.domain')
|
||||
%li
|
||||
= link_to t('shared.domains'), admin_domain_versions_path
|
||||
= link_to t('shared.versions'), admin_domain_versions_path
|
||||
%li
|
||||
= link_to t('shared.deleted'), admin_domain_histories_path
|
||||
|
||||
%li.dropdown-header= t('shared.contact')
|
||||
%li
|
||||
= link_to t('shared.contacts'), admin_contact_versions_path
|
||||
= link_to t('shared.versions'), admin_contact_versions_path
|
||||
%li
|
||||
= link_to t('shared.deleted'), admin_contact_histories_path
|
||||
|
||||
%ul.nav.navbar-nav.navbar-right
|
||||
%li= link_to t('shared.log_out', user: current_user), '/logout'
|
||||
|
|
|
@ -24,9 +24,11 @@ Rails.application.routes.draw do
|
|||
resources :users
|
||||
resources :epp_users
|
||||
resources :contact_versions
|
||||
#resources :address_versions
|
||||
resources :domain_versions
|
||||
|
||||
resources :contact_histories
|
||||
resources :domain_histories
|
||||
|
||||
root 'domains#index'
|
||||
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue