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

[skip ci] Add pagination styles

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