diff options
author | Zeger-Jan van de Weg <mail@zjvandeweg.nl> | 2015-09-17 21:24:47 +0300 |
---|---|---|
committer | Zeger-Jan van de Weg <mail@zjvandeweg.nl> | 2015-09-23 23:15:16 +0300 |
commit | 3d177a818f1c623704df94d6ab6649cf9f70dbbc (patch) | |
tree | 22a8166cb36cc7e6faee8111b3aec2713f76442e /app/views/kaminari | |
parent | fd6b5099fbb0198cbf02ffcb647cb93253a42c0f (diff) |
Add links to first and/or last page with kaminari
Also update Kaminari gem to the latest version
Diffstat (limited to 'app/views/kaminari')
-rw-r--r-- | app/views/kaminari/gitlab/_first_page.html.haml | 2 | ||||
-rw-r--r-- | app/views/kaminari/gitlab/_last_page.html.haml | 2 | ||||
-rw-r--r-- | app/views/kaminari/gitlab/_paginator.html.haml | 9 |
3 files changed, 9 insertions, 4 deletions
diff --git a/app/views/kaminari/gitlab/_first_page.html.haml b/app/views/kaminari/gitlab/_first_page.html.haml index 41c9c0b3af6..ada7306d98d 100644 --- a/app/views/kaminari/gitlab/_first_page.html.haml +++ b/app/views/kaminari/gitlab/_first_page.html.haml @@ -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 diff --git a/app/views/kaminari/gitlab/_last_page.html.haml b/app/views/kaminari/gitlab/_last_page.html.haml index b03a206224c..3431d029bcc 100644 --- a/app/views/kaminari/gitlab/_last_page.html.haml +++ b/app/views/kaminari/gitlab/_last_page.html.haml @@ -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} diff --git a/app/views/kaminari/gitlab/_paginator.html.haml b/app/views/kaminari/gitlab/_paginator.html.haml index b8d419b5894..2f645186921 100644 --- a/app/views/kaminari/gitlab/_paginator.html.haml +++ b/app/views/kaminari/gitlab/_paginator.html.haml @@ -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 + |