Commit 5a4342c3 authored by Clement Ho's avatar Clement Ho

[skip ci] Add pagination styles

parent 4e54f5ae
......@@ -6,6 +6,7 @@
.pagination {
padding: 0;
margin: 20px 0;
a {
cursor: pointer;
......@@ -44,7 +45,7 @@
display: none;
}
.page {
.page-item {
display: none;
&.active {
......@@ -63,7 +64,7 @@
padding: 6px 10px;
}
.page {
.page-item {
display: none;
&.active {
......@@ -78,7 +79,7 @@
*/
@media (min-width: map-get($grid-breakpoints, xs)) and (max-width: map-get($grid-breakpoints, sm)) {
.gl-pagination {
.page {
.page-item {
display: none;
&.active,
......
......@@ -5,5 +5,5 @@
-# total_pages: total number of pages
-# per_page: number of items to fetch per page
-# remote: data-remote
%li.first
%li.first.page-item
= link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, remote: remote
......@@ -4,6 +4,5 @@
-# total_pages: total number of pages
-# per_page: number of items to fetch per page
-# remote: data-remote
%li
%span.gap
= raw(t 'views.pagination.truncate')
%li.page-item
= link_to raw(t 'views.pagination.truncate'), '#', class: 'page-link'
......@@ -5,5 +5,5 @@
-# total_pages: total number of pages
-# per_page: number of items to fetch per page
-# remote: data-remote
%li.last
%li.last.page-item
= link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, {remote: remote}
......@@ -5,9 +5,8 @@
-# total_pages: total number of pages
-# per_page: number of items to fetch per page
-# remote: data-remote
- if current_page.last?
%li.next.disabled
%span= raw(t 'views.pagination.next')
- else
%li.next
= link_to raw(t 'views.pagination.next'), url, rel: 'next', remote: remote
- page_url = current_page.last? ? '#' : url
%li.page-item{ class: ('disabled' if current_page.last?) }
= link_to raw(t 'views.pagination.next'), page_url, rel: 'next', remote: remote, class: 'page-link'
......@@ -6,5 +6,5 @@
-# total_pages: total number of pages
-# per_page: number of items to fetch per page
-# remote: data-remote
%li.page{ class: [active_when(page.current?), ('sibling' if page.next? || page.prev?)] }
= link_to page, url, { remote: remote, rel: page.next? ? 'next' : page.prev? ? 'prev' : nil }
%li.page-item{ class: [active_when(page.current?), ('sibling' if page.next? || page.prev?)] }
= link_to page, url, { remote: remote, rel: page.next? ? 'next' : page.prev? ? 'prev' : nil, class: 'page-link' }
......@@ -7,7 +7,7 @@
-# paginator: the paginator that renders the pagination tags inside
= paginator.render do
.gl-pagination
%ul.pagination.clearfix
%ul.pagination.justify-content-center
- unless current_page.first?
= first_page_tag unless total_pages < 5 # As kaminari will always show the first 5 pages
= prev_page_tag
......
......@@ -5,9 +5,8 @@
-# total_pages: total number of pages
-# per_page: number of items to fetch per page
-# remote: data-remote
- if current_page.first?
%li.prev.disabled
%span= raw(t 'views.pagination.previous')
- else
%li.prev
= link_to raw(t 'views.pagination.previous'), url, rel: 'prev', remote: remote
- page_url = current_page.first? ? '#' : url
%li.page-item{ class: ('disabled' if current_page.first?) }
= link_to raw(t 'views.pagination.next'), page_url, rel: 'next', remote: remote, class: 'page-link'
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