Commit 09a80fee authored by Robert Speicher's avatar Robert Speicher

Merge branch 'upgrade-kaminari' into 'master'

Upgrade Kaminari from 0.16.3 to 0.17.0.

Changelog: https://github.com/amatsuda/kaminari/blob/master/CHANGELOG.rdoc#0170

Deprecates `num_pages` in favor of `total_pages` and includes Rails 5 support.

Working towards #14286.

See merge request !4387
parents 873718aa 7f4f959e
...@@ -73,7 +73,7 @@ gem 'grape-entity', '~> 0.4.2' ...@@ -73,7 +73,7 @@ gem 'grape-entity', '~> 0.4.2'
gem 'rack-cors', '~> 0.4.0', require: 'rack/cors' gem 'rack-cors', '~> 0.4.0', require: 'rack/cors'
# Pagination # Pagination
gem "kaminari", "~> 0.16.3" gem "kaminari", "~> 0.17.0"
# HAML # HAML
gem "haml-rails", '~> 0.9.0' gem "haml-rails", '~> 0.9.0'
......
...@@ -442,7 +442,7 @@ GEM ...@@ -442,7 +442,7 @@ GEM
railties (>= 3.2.16) railties (>= 3.2.16)
json (1.8.3) json (1.8.3)
jwt (1.5.2) jwt (1.5.2)
kaminari (0.16.3) kaminari (0.17.0)
actionpack (>= 3.0.0) actionpack (>= 3.0.0)
activesupport (>= 3.0.0) activesupport (>= 3.0.0)
kgio (2.10.0) kgio (2.10.0)
...@@ -959,7 +959,7 @@ DEPENDENCIES ...@@ -959,7 +959,7 @@ DEPENDENCIES
jquery-turbolinks (~> 2.1.0) jquery-turbolinks (~> 2.1.0)
jquery-ui-rails (~> 5.0.0) jquery-ui-rails (~> 5.0.0)
jwt jwt
kaminari (~> 0.16.3) kaminari (~> 0.17.0)
letter_opener_web (~> 1.3.0) letter_opener_web (~> 1.3.0)
licensee (~> 8.0.0) licensee (~> 8.0.0)
loofah (~> 2.0.3) loofah (~> 2.0.3)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
-# available local variables -# available local variables
-# url: url to the first page -# url: url to the first page
-# current_page: a page object for the currently displayed page -# current_page: a page object for the currently displayed page
-# num_pages: total number of pages -# total_pages: total number of pages
-# per_page: number of items to fetch per page -# per_page: number of items to fetch per page
-# remote: data-remote -# remote: data-remote
%li.first %li.first
......
-# Non-link tag that stands for skipped pages... -# Non-link tag that stands for skipped pages...
-# available local variables -# available local variables
-# current_page: a page object for the currently displayed page -# current_page: a page object for the currently displayed page
-# num_pages: total number of pages -# total_pages: total number of pages
-# per_page: number of items to fetch per page -# per_page: number of items to fetch per page
-# remote: data-remote -# remote: data-remote
%li{class: "page"} %li{class: "page"}
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
-# available local variables -# available local variables
-# url: url to the last page -# url: url to the last page
-# current_page: a page object for the currently displayed page -# current_page: a page object for the currently displayed page
-# num_pages: total number of pages -# total_pages: total number of pages
-# per_page: number of items to fetch per page -# per_page: number of items to fetch per page
-# remote: data-remote -# remote: data-remote
%li.last %li.last
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
-# available local variables -# available local variables
-# url: url to the next page -# url: url to the next page
-# current_page: a page object for the currently displayed page -# current_page: a page object for the currently displayed page
-# num_pages: total number of pages -# total_pages: total number of pages
-# per_page: number of items to fetch per page -# per_page: number of items to fetch per page
-# remote: data-remote -# remote: data-remote
- if current_page.last? - if current_page.last?
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
-# page: a page object for "this" page -# page: a page object for "this" page
-# url: url to this page -# url: url to this page
-# current_page: a page object for the currently displayed page -# current_page: a page object for the currently displayed page
-# num_pages: total number of pages -# total_pages: total number of pages
-# per_page: number of items to fetch per page -# per_page: number of items to fetch per page
-# remote: data-remote -# remote: data-remote
%li{class: "page#{' active' if page.current?}"} %li{class: "page#{' active' if page.current?}"}
......
-# The container tag -# The container tag
-# available local variables -# available local variables
-# current_page: a page object for the currently displayed page -# current_page: a page object for the currently displayed page
-# num_pages: total number of pages -# total_pages: total number of pages
-# per_page: number of items to fetch per page -# per_page: number of items to fetch per page
-# remote: data-remote -# remote: data-remote
-# paginator: the paginator that renders the pagination tags inside -# paginator: the paginator that renders the pagination tags inside
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
%div.gl-pagination %div.gl-pagination
%ul.pagination.clearfix %ul.pagination.clearfix
- unless current_page.first? - unless current_page.first?
= first_page_tag unless num_pages < 5 # As kaminari will always show the first 5 pages = first_page_tag unless total_pages < 5 # As kaminari will always show the first 5 pages
= prev_page_tag = prev_page_tag
- each_page do |page| - each_page do |page|
- if page.left_outer? || page.right_outer? || page.inside_window? - if page.left_outer? || page.right_outer? || page.inside_window?
...@@ -18,5 +18,5 @@ ...@@ -18,5 +18,5 @@
= gap_tag = gap_tag
= next_page_tag = next_page_tag
- unless current_page.last? - unless current_page.last?
= last_page_tag unless num_pages < 5 = last_page_tag unless total_pages < 5
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
-# available local variables -# available local variables
-# url: url to the previous page -# url: url to the previous page
-# current_page: a page object for the currently displayed page -# current_page: a page object for the currently displayed page
-# num_pages: total number of pages -# total_pages: total number of pages
-# per_page: number of items to fetch per page -# per_page: number of items to fetch per page
-# remote: data-remote -# remote: data-remote
- if current_page.first? - if current_page.first?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment