mirror of
https://github.com/internetee/registry.git
synced 2025-05-19 18:59:38 +02:00
Pagination for domains
This commit is contained in:
parent
8531e50474
commit
11319b6f36
6 changed files with 29 additions and 2 deletions
4
Gemfile
4
Gemfile
|
@ -42,8 +42,12 @@ gem 'isikukood'
|
|||
|
||||
gem 'bootstrap-sass', '~> 3.2.0.1'
|
||||
|
||||
# for visual loader
|
||||
gem 'nprogress-rails', '~> 0.1.3.1'
|
||||
|
||||
# for pagination
|
||||
gem 'kaminari', '~> 0.16.1'
|
||||
|
||||
group :assets do
|
||||
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
|
||||
gem 'therubyracer', platforms: :ruby
|
||||
|
|
|
@ -96,6 +96,9 @@ GEM
|
|||
railties (>= 3.0, < 5.0)
|
||||
thor (>= 0.14, < 2.0)
|
||||
json (1.8.1)
|
||||
kaminari (0.16.1)
|
||||
actionpack (>= 3.0.0)
|
||||
activesupport (>= 3.0.0)
|
||||
kgio (2.9.2)
|
||||
libv8 (3.16.14.3)
|
||||
libxml-ruby (2.7.0)
|
||||
|
@ -254,6 +257,7 @@ DEPENDENCIES
|
|||
isikukood
|
||||
jbuilder (~> 2.0)
|
||||
jquery-rails
|
||||
kaminari (~> 0.16.1)
|
||||
nokogiri (~> 1.6.2.1)
|
||||
nprogress-rails (~> 0.1.3.1)
|
||||
pg
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
class Admin::DomainsController < ApplicationController
|
||||
def index
|
||||
@domains = Domain.all
|
||||
@domains = Domain.order(:name).page(params[:page])
|
||||
end
|
||||
end
|
||||
|
|
|
@ -3,7 +3,6 @@ class Domain < ActiveRecord::Base
|
|||
# TODO most inputs should be trimmed before validatation, probably some global logic?
|
||||
|
||||
include EppErrors
|
||||
|
||||
EPP_ATTR_MAP = {
|
||||
owner_contact: 'registrant',
|
||||
name_dirty: 'name',
|
||||
|
|
|
@ -22,3 +22,6 @@
|
|||
%td= link_to(x.owner_contact, root_path)
|
||||
%td= l(x.valid_to, format: :short)
|
||||
%td= link_to(t('shared.edit'), edit_admin_domain_path(x), class: 'btn btn-primary btn-xs')
|
||||
.row
|
||||
.col-md-12
|
||||
= paginate @domains
|
||||
|
|
|
@ -20,6 +20,23 @@
|
|||
# available at http://guides.rubyonrails.org/i18n.html.
|
||||
|
||||
en:
|
||||
views:
|
||||
pagination:
|
||||
first: "« First"
|
||||
last: "Last »"
|
||||
previous: "‹ Prev"
|
||||
next: "Next ›"
|
||||
truncate: "…"
|
||||
helpers:
|
||||
page_entries_info:
|
||||
one_page:
|
||||
display_entries:
|
||||
zero: "No %{entry_name} found"
|
||||
one: "Displaying <b>1</b> %{entry_name}"
|
||||
other: "Displaying <b>all %{count}</b> %{entry_name}"
|
||||
more_pages:
|
||||
display_entries: "Displaying %{entry_name} <b>%{first} - %{last}</b> of <b>%{total}</b> in total"
|
||||
|
||||
time:
|
||||
formats:
|
||||
default: "%d. %B %Y, %H:%M"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue