Merge branch 'pagination-last-page' into 'master'
Pagination last page First commit adds a link to the last page.![Screenshot_from_2015-09-17_20-29-00](https://gitlab.com/zj/gitlab-ce/uploads/dcd4f97b8b75c6725ed2a71ba86057b4/Screenshot_from_2015-09-17_20-29-00.png) Unless there are less than 5 pages to show.![Screenshot_from_2015-09-17_20-34-31](https://gitlab.com/zj/gitlab-ce/uploads/2d730ad11306abcfa83c69627d4f6a7d/Screenshot_from_2015-09-17_20-34-31.png) Also updates the `Kaminari` gem to the latest version, which is a minor update. [Changelog](https://github.com/amatsuda/kaminari/blob/master/CHANGELOG.rdoc) See merge request !1334
This commit is contained in:
commit
68cb24c439
|
@ -4,6 +4,7 @@ v 8.1.0 (unreleased)
|
|||
- Show CI status on all pages where commits list is rendered
|
||||
- Automatically enable CI when push .gitlab-ci.yml file to repository
|
||||
- Fix cases where Markdown did not render links in activity feed (Stan Hu)
|
||||
- Add first and last to pagination (Zeger-Jan van de Weg)
|
||||
|
||||
v 8.0.2 (unreleased)
|
||||
- Skip check_initd_configured_correctly on omnibus installs
|
||||
|
|
2
Gemfile
2
Gemfile
|
@ -77,7 +77,7 @@ gem "stamp", '~> 0.5.0'
|
|||
gem 'enumerize', '~> 0.7.0'
|
||||
|
||||
# Pagination
|
||||
gem "kaminari", "~> 0.15.1"
|
||||
gem "kaminari", "~> 0.16.3"
|
||||
|
||||
# HAML
|
||||
gem "haml-rails", '~> 0.5.3'
|
||||
|
|
|
@ -367,7 +367,7 @@ GEM
|
|||
railties (>= 3.2.16)
|
||||
json (1.8.3)
|
||||
jwt (1.5.1)
|
||||
kaminari (0.15.1)
|
||||
kaminari (0.16.3)
|
||||
actionpack (>= 3.0.0)
|
||||
activesupport (>= 3.0.0)
|
||||
kgio (2.9.3)
|
||||
|
@ -846,7 +846,7 @@ DEPENDENCIES
|
|||
jquery-scrollto-rails (~> 1.4.3)
|
||||
jquery-turbolinks (~> 2.0.1)
|
||||
jquery-ui-rails (~> 4.2.1)
|
||||
kaminari (~> 0.15.1)
|
||||
kaminari (~> 0.16.3)
|
||||
letter_opener (~> 1.1.2)
|
||||
mail_room (~> 0.5.1)
|
||||
minitest (~> 5.7.0)
|
||||
|
|
|
@ -9,6 +9,8 @@
|
|||
margin: 0;
|
||||
display: block;
|
||||
|
||||
li.first,
|
||||
li.last,
|
||||
li.next,
|
||||
li.prev {
|
||||
> a {
|
||||
|
|
|
@ -5,5 +5,5 @@
|
|||
-# num_pages: total number of pages
|
||||
-# per_page: number of items to fetch per page
|
||||
-# remote: data-remote
|
||||
%span.first
|
||||
%li.first
|
||||
= link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, remote: remote
|
||||
|
|
|
@ -5,5 +5,5 @@
|
|||
-# num_pages: total number of pages
|
||||
-# per_page: number of items to fetch per page
|
||||
-# remote: data-remote
|
||||
%span.last
|
||||
%li.last
|
||||
= link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, {remote: remote}
|
||||
|
|
|
@ -8,10 +8,15 @@
|
|||
= paginator.render do
|
||||
%div.gl-pagination
|
||||
%ul.pagination.clearfix
|
||||
= prev_page_tag unless current_page.first?
|
||||
- unless current_page.first?
|
||||
= first_page_tag unless num_pages < 5 # As kaminari will always show the first 5 pages
|
||||
= prev_page_tag
|
||||
- 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?
|
||||
- unless current_page.last?
|
||||
= next_page_tag
|
||||
= last_page_tag unless num_pages < 5
|
||||
|
||||
|
|
Loading…
Reference in New Issue