Skip to content
Browse files

Add pagination markup for Twitter Bootstrap 2.0

  • Loading branch information...
1 parent da144fd commit 9e0a479cc3d02744283575d5d663287afc48f202 @jweslley jweslley committed Feb 16, 2012
View
2 bootstrap/DESCRIPTION
@@ -0,0 +1,2 @@
+Pagination for Twitter Bootstrap 2.0.
+http://twitter.github.com/bootstrap/
View
3 bootstrap/app/views/kaminari/_first_page.html.erb
@@ -0,0 +1,3 @@
+<li>
+ <%= link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, :remote => remote %>
+</li>
View
2 bootstrap/app/views/kaminari/_first_page.html.haml
@@ -0,0 +1,2 @@
+%li
+ = link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, :remote => remote
View
3 bootstrap/app/views/kaminari/_gap.html.erb
@@ -0,0 +1,3 @@
+<li class="disabled">
+ <%= link_to raw(t 'views.pagination.truncate'), '#' %>
+</li>
View
2 bootstrap/app/views/kaminari/_gap.html.haml
@@ -0,0 +1,2 @@
+%li.disabled
+ = link_to raw(t 'views.pagination.truncate'), '#'
View
3 bootstrap/app/views/kaminari/_last_page.html.erb
@@ -0,0 +1,3 @@
+<li>
+ <%= link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, {:remote => remote} %>
+</li>
View
2 bootstrap/app/views/kaminari/_last_page.html.haml
@@ -0,0 +1,2 @@
+%li
+ = link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, {:remote => remote}
View
3 bootstrap/app/views/kaminari/_next_page.html.erb
@@ -0,0 +1,3 @@
+<li>
+ <%= link_to_unless current_page.last?, raw(t 'views.pagination.next'), url, :rel => 'next', :remote => remote %>
+</li>
View
2 bootstrap/app/views/kaminari/_next_page.html.haml
@@ -0,0 +1,2 @@
+%li
+ = link_to_unless current_page.last?, raw(t 'views.pagination.next'), url, :rel => 'next', :remote => remote
View
3 bootstrap/app/views/kaminari/_page.html.erb
@@ -0,0 +1,3 @@
+<li class="<%= 'active' if page.current? %>">
+ <%= link_to page, page.current? ? '#' : url, {:remote => remote, :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil} %>
+</li>
View
2 bootstrap/app/views/kaminari/_page.html.haml
@@ -0,0 +1,2 @@
+%li{class: "#{'active' if page.current?}"}
+ = link_to page, page.current? ? '#' : url, {:remote => remote, :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil}
View
17 bootstrap/app/views/kaminari/_paginator.html.erb
@@ -0,0 +1,17 @@
+<%= paginator.render do -%>
+ <div class="pagination">
+ <ul>
+ <%= 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 %>
+ <% end -%>
+ <% end -%>
+ <%= next_page_tag unless current_page.last? %>
+ <%= last_page_tag unless current_page.last? %>
+ </ul>
+ </div>
+<% end -%>
View
12 bootstrap/app/views/kaminari/_paginator.html.haml
@@ -0,0 +1,12 @@
+= paginator.render do
+ .pagination
+ %ul
+ = 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?
View
3 bootstrap/app/views/kaminari/_prev_page.html.erb
@@ -0,0 +1,3 @@
+<li>
+ <%= link_to_unless current_page.first?, raw(t 'views.pagination.previous'), url, :rel => 'prev', :remote => remote %>
+</li>
View
2 bootstrap/app/views/kaminari/_prev_page.html.haml
@@ -0,0 +1,2 @@
+%li
+ = link_to_unless current_page.first?, raw(t 'views.pagination.previous'), url, :rel => 'prev', :remote => remote

0 comments on commit 9e0a479

Please sign in to comment.
Something went wrong with that request. Please try again.