mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 17:59:47 +02:00
Sortable domain list
This commit is contained in:
parent
11319b6f36
commit
46921c3e57
4 changed files with 18 additions and 5 deletions
3
Gemfile
3
Gemfile
|
@ -48,6 +48,9 @@ gem 'nprogress-rails', '~> 0.1.3.1'
|
||||||
# for pagination
|
# for pagination
|
||||||
gem 'kaminari', '~> 0.16.1'
|
gem 'kaminari', '~> 0.16.1'
|
||||||
|
|
||||||
|
# for searching
|
||||||
|
gem 'ransack', '~> 1.3.0'
|
||||||
|
|
||||||
group :assets do
|
group :assets do
|
||||||
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
|
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
|
||||||
gem 'therubyracer', platforms: :ruby
|
gem 'therubyracer', platforms: :ruby
|
||||||
|
|
|
@ -128,6 +128,8 @@ GEM
|
||||||
cliver (~> 0.3.1)
|
cliver (~> 0.3.1)
|
||||||
multi_json (~> 1.0)
|
multi_json (~> 1.0)
|
||||||
websocket-driver (>= 0.2.0)
|
websocket-driver (>= 0.2.0)
|
||||||
|
polyamorous (1.1.0)
|
||||||
|
activerecord (>= 3.0)
|
||||||
polyglot (0.3.5)
|
polyglot (0.3.5)
|
||||||
powerpack (0.0.9)
|
powerpack (0.0.9)
|
||||||
pry (0.10.1)
|
pry (0.10.1)
|
||||||
|
@ -158,6 +160,12 @@ GEM
|
||||||
rainbow (2.0.0)
|
rainbow (2.0.0)
|
||||||
raindrops (0.13.0)
|
raindrops (0.13.0)
|
||||||
rake (10.3.2)
|
rake (10.3.2)
|
||||||
|
ransack (1.3.0)
|
||||||
|
actionpack (>= 3.0)
|
||||||
|
activerecord (>= 3.0)
|
||||||
|
activesupport (>= 3.0)
|
||||||
|
i18n
|
||||||
|
polyamorous (~> 1.1)
|
||||||
rb-fsevent (0.9.4)
|
rb-fsevent (0.9.4)
|
||||||
rb-inotify (0.9.5)
|
rb-inotify (0.9.5)
|
||||||
ffi (>= 0.5.0)
|
ffi (>= 0.5.0)
|
||||||
|
@ -266,6 +274,7 @@ DEPENDENCIES
|
||||||
pry (~> 0.10.1)
|
pry (~> 0.10.1)
|
||||||
pry-byebug (~> 1.3.3)
|
pry-byebug (~> 1.3.3)
|
||||||
rails (= 4.1.4)
|
rails (= 4.1.4)
|
||||||
|
ransack (~> 1.3.0)
|
||||||
rspec-rails (~> 3.0.2)
|
rspec-rails (~> 3.0.2)
|
||||||
sass-rails (~> 4.0.3)
|
sass-rails (~> 4.0.3)
|
||||||
sdoc (~> 0.4.0)
|
sdoc (~> 0.4.0)
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
class Admin::DomainsController < ApplicationController
|
class Admin::DomainsController < ApplicationController
|
||||||
def index
|
def index
|
||||||
@domains = Domain.order(:name).page(params[:page])
|
@q = Domain.search(params[:q])
|
||||||
|
@domains = @q.result.page(params[:page])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -6,13 +6,13 @@
|
||||||
%table.table.table-striped.table-bordered.table-condensed
|
%table.table.table-striped.table-bordered.table-condensed
|
||||||
%tr
|
%tr
|
||||||
%th{class: 'col-xs-2'}
|
%th{class: 'col-xs-2'}
|
||||||
= t('shared.name')
|
= sort_link(@q, 'name')
|
||||||
%th{class: 'col-xs-2'}
|
%th{class: 'col-xs-2'}
|
||||||
= t('shared.registrar')
|
= sort_link(@q, 'registrar_name', t('shared.registrar'))
|
||||||
%th{class: 'col-xs-2'}
|
%th{class: 'col-xs-2'}
|
||||||
= t('shared.owner')
|
= sort_link(@q, 'owner_contact_international_address_name', t('shared.owner'))
|
||||||
%th{class: 'col-xs-1'}
|
%th{class: 'col-xs-1'}
|
||||||
= t('shared.valid_to')
|
= sort_link(@q, 'valid_to', t('shared.valid_to'))
|
||||||
%th{class: 'col-xs-1'}
|
%th{class: 'col-xs-1'}
|
||||||
= t('shared.action')
|
= t('shared.action')
|
||||||
- @domains.each do |x|
|
- @domains.each do |x|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue