Skip to content

Commit

Permalink
Merge pull request #51 from droptheplot/bootstrap4
Browse files Browse the repository at this point in the history
Bootstrap 4 theme
  • Loading branch information
yuki24 committed Jun 7, 2016
2 parents 77bb1dd + 34501f7 commit c5fa47c
Show file tree
Hide file tree
Showing 19 changed files with 91 additions and 0 deletions.
7 changes: 7 additions & 0 deletions bootstrap4/README.md
@@ -0,0 +1,7 @@
# Pagination for [Bootstrap 4](http://v4-alpha.getbootstrap.com)

With support for:

- erb
- haml
- slim
3 changes: 3 additions & 0 deletions bootstrap4/app/views/kaminari/_first_page.html.erb
@@ -0,0 +1,3 @@
<li class="page-item">
<%= link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, remote: remote, class: 'page-link' %>
</li>
2 changes: 2 additions & 0 deletions bootstrap4/app/views/kaminari/_first_page.html.haml
@@ -0,0 +1,2 @@
%li.page-item
= link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, remote: remote, class: 'page-link'
2 changes: 2 additions & 0 deletions bootstrap4/app/views/kaminari/_first_page.html.slim
@@ -0,0 +1,2 @@
li.page-item
= link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, remote: remote, class: 'page-link'
3 changes: 3 additions & 0 deletions bootstrap4/app/views/kaminari/_last_page.html.erb
@@ -0,0 +1,3 @@
<li class="page-item">
<%= link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, { remote: remote, class: 'page-link' } %>
</li>
2 changes: 2 additions & 0 deletions bootstrap4/app/views/kaminari/_last_page.html.haml
@@ -0,0 +1,2 @@
%li.page-item
= link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, { remote: remote, class: 'page-link' }
2 changes: 2 additions & 0 deletions bootstrap4/app/views/kaminari/_last_page.html.slim
@@ -0,0 +1,2 @@
li.page-item
= link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, { remote: remote, class: 'page-link' }
3 changes: 3 additions & 0 deletions bootstrap4/app/views/kaminari/_next_page.html.erb
@@ -0,0 +1,3 @@
<li class="page-item">
<%= link_to_unless current_page.last?, raw(t 'views.pagination.next'), url, rel: 'next', remote: remote, class: 'page-link' %>
</li>
2 changes: 2 additions & 0 deletions bootstrap4/app/views/kaminari/_next_page.html.haml
@@ -0,0 +1,2 @@
%li.page-item
= link_to_unless current_page.last?, raw(t 'views.pagination.next'), url, rel: 'next', remote: remote, class: 'page-link'
2 changes: 2 additions & 0 deletions bootstrap4/app/views/kaminari/_next_page.html.slim
@@ -0,0 +1,2 @@
li.page-item
= link_to_unless current_page.last?, raw(t 'views.pagination.next'), url, rel: 'next', remote: remote, class: 'page-link'
9 changes: 9 additions & 0 deletions bootstrap4/app/views/kaminari/_page.html.erb
@@ -0,0 +1,9 @@
<% if page.current? %>
<li class="page-item active">
<%= content_tag :a, page, remote: remote, rel: (page.next? ? 'next' : (page.prev? ? 'prev' : nil)), class: 'page-link' %>
</li>
<% else %>
<li class="page-item">
<%= link_to page, url, remote: remote, rel: (page.next? ? 'next' : (page.prev? ? 'prev' : nil)), class: 'page-link' %>
</li>
<% end %>
6 changes: 6 additions & 0 deletions bootstrap4/app/views/kaminari/_page.html.haml
@@ -0,0 +1,6 @@
- if page.current?
%li.page-item.active
= content_tag :a, page, remote: remote, rel: (page.next? ? 'next' : (page.prev? ? 'prev' : nil)), class: 'page-link'
- else
%li.page-item
= link_to page, url, remote: remote, rel: (page.next? ? 'next' : (page.prev? ? 'prev' : nil)), class: 'page-link'
6 changes: 6 additions & 0 deletions bootstrap4/app/views/kaminari/_page.html.slim
@@ -0,0 +1,6 @@
- if page.current?
li.page-item.active
= content_tag :a, page, remote: remote, rel: (page.next? ? 'next' : (page.prev? ? 'prev' : nil)), class: 'page-link'
- else
li.page-item
= link_to page, url, remote: remote, rel: (page.next? ? 'next' : (page.prev? ? 'prev' : nil)), class: 'page-link'
15 changes: 15 additions & 0 deletions bootstrap4/app/views/kaminari/_paginator.html.erb
@@ -0,0 +1,15 @@
<%= paginator.render do %>
<nav>
<ul class="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 %>
<% end %>
<% end %>
<%= next_page_tag unless current_page.last? %>
<%= last_page_tag unless current_page.last? %>
</ul>
</nav>
<% end %>
10 changes: 10 additions & 0 deletions bootstrap4/app/views/kaminari/_paginator.html.haml
@@ -0,0 +1,10 @@
= paginator.render do
%nav
%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
= next_page_tag unless current_page.last?
= last_page_tag unless current_page.last?
10 changes: 10 additions & 0 deletions bootstrap4/app/views/kaminari/_paginator.html.slim
@@ -0,0 +1,10 @@
= paginator.render do
nav
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
= next_page_tag unless current_page.last?
= last_page_tag unless current_page.last?
3 changes: 3 additions & 0 deletions bootstrap4/app/views/kaminari/_prev_page.html.erb
@@ -0,0 +1,3 @@
<li class="page-item">
<%= link_to_unless current_page.first?, raw(t 'views.pagination.previous'), url, rel: 'prev', remote: remote, class: 'page-link' %>
</li>
2 changes: 2 additions & 0 deletions bootstrap4/app/views/kaminari/_prev_page.html.haml
@@ -0,0 +1,2 @@
%li.page-item
= link_to_unless current_page.first?, raw(t 'views.pagination.previous'), url, rel: 'prev', remote: remote, class: 'page-link'
2 changes: 2 additions & 0 deletions bootstrap4/app/views/kaminari/_prev_page.html.slim
@@ -0,0 +1,2 @@
li.page-item
= link_to_unless current_page.first?, raw(t 'views.pagination.previous'), url, rel: 'prev', remote: remote, class: 'page-link'

0 comments on commit c5fa47c

Please sign in to comment.