Fixed styling of pagination bootstrap-style

This commit is contained in:
Christoph Haas 2013-08-11 23:40:20 +02:00
parent d7c7488c86
commit 50601b9dcb
8 changed files with 36 additions and 0 deletions

View file

@ -59,6 +59,7 @@ end
gem 'bootstrap-sass'
# Pagination
# Hint: rails generate kaminari:views bootstrap
gem 'kaminari'
# Lightbox image viewer for full-sized images

View file

@ -0,0 +1,3 @@
<li>
<%= link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, :remote => remote %>
</li>

View file

@ -0,0 +1,3 @@
<li class="disabled">
<%= link_to raw(t 'views.pagination.truncate'), '#' %>
</li>

View file

@ -0,0 +1,3 @@
<li>
<%= link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, {:remote => remote} %>
</li>

View file

@ -0,0 +1,3 @@
<li>
<%= link_to_unless current_page.last?, raw(t 'views.pagination.next'), url, :rel => 'next', :remote => remote %>
</li>

View file

@ -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 file

@ -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 file

@ -0,0 +1,3 @@
<li>
<%= link_to_unless current_page.first?, raw(t 'views.pagination.previous'), url, :rel => 'prev', :remote => remote %>
</li>