-
-
Save hachy/3dd2f674c0d269369ae656f9406e87af to your computer and use it in GitHub Desktop.
v4.0.0-alpha.6 kaminari のページネーションリンクに Twitter Bootstrap 4 のスタイルを適用する ref: http://qiita.com/manemone@github/items/564c58ea59fb3450826c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%li.page-item.prev{ class: "#{'disabled' if current_page.first?}" } | |
= link_to (current_page.first? ? "#" : url), class: "page-link", "aria-label" => "First", :remote => remote do | |
%span{"aria-hidden" => "true"} « | |
%span.sr-only | |
= t('views.pagination.first').html_safe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%li.page-item.gap | |
.page-link | |
= t('views.pagination.truncate').html_safe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%li.page-item.next{ class: "#{'disabled' if current_page.last?}" } | |
= link_to (current_page.last? ? "#" : url), class: "page-link", "aria-label" => "Last", :remote => remote do | |
%span{"aria-hidden" => "true"} » | |
%span.sr-only | |
= t('views.pagination.last').html_safe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%li.page-item.next{ class: "#{'disabled' if current_page.last?}" } | |
= link_to (current_page.last? ? "#" : url), class: "page-link", "aria-label" => "Next", :remote => remote do | |
%span{"aria-hidden" => "true"} › | |
%span.sr-only | |
= t('views.pagination.next').html_safe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%li.page-item{ class: "#{'active' if page.current?}" } | |
= link_to url, class: "page-link", remote: remote do | |
= page | |
- if page.current? | |
%span.sr-only (current) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
= paginator.render do | |
%nav.text-center | |
%ul.pagination | |
= first_page_tag unless current_page.first? | |
= prev_page_tag unless current_page.first? | |
- 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? | |
= last_page_tag unless current_page.last? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%li.page-item.prev{ class: "#{'disabled' if current_page.first?}" } | |
= link_to (current_page.first? ? "#" : url), class: "page-link", "aria-label" => "Previous", :remote => remote do | |
%span{"aria-hidden" => "true"} ‹ | |
%span.sr-only | |
= t('views.pagination.previous').html_safe |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment