Fixed styling of pagination bootstrap-style
This commit is contained in:
parent
d7c7488c86
commit
50601b9dcb
8 changed files with 36 additions and 0 deletions
1
Gemfile
1
Gemfile
|
|
@ -59,6 +59,7 @@ end
|
|||
gem 'bootstrap-sass'
|
||||
|
||||
# Pagination
|
||||
# Hint: rails generate kaminari:views bootstrap
|
||||
gem 'kaminari'
|
||||
|
||||
# Lightbox image viewer for full-sized images
|
||||
|
|
|
|||
3
app/views/kaminari/_first_page.html.erb
Normal file
3
app/views/kaminari/_first_page.html.erb
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<li>
|
||||
<%= link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, :remote => remote %>
|
||||
</li>
|
||||
3
app/views/kaminari/_gap.html.erb
Normal file
3
app/views/kaminari/_gap.html.erb
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<li class="disabled">
|
||||
<%= link_to raw(t 'views.pagination.truncate'), '#' %>
|
||||
</li>
|
||||
3
app/views/kaminari/_last_page.html.erb
Normal file
3
app/views/kaminari/_last_page.html.erb
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<li>
|
||||
<%= link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, {:remote => remote} %>
|
||||
</li>
|
||||
3
app/views/kaminari/_next_page.html.erb
Normal file
3
app/views/kaminari/_next_page.html.erb
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<li>
|
||||
<%= link_to_unless current_page.last?, raw(t 'views.pagination.next'), url, :rel => 'next', :remote => remote %>
|
||||
</li>
|
||||
3
app/views/kaminari/_page.html.erb
Normal file
3
app/views/kaminari/_page.html.erb
Normal 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>
|
||||
17
app/views/kaminari/_paginator.html.erb
Normal file
17
app/views/kaminari/_paginator.html.erb
Normal 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 -%>
|
||||
3
app/views/kaminari/_prev_page.html.erb
Normal file
3
app/views/kaminari/_prev_page.html.erb
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<li>
|
||||
<%= link_to_unless current_page.first?, raw(t 'views.pagination.previous'), url, :rel => 'prev', :remote => remote %>
|
||||
</li>
|
||||
Loading…
Add table
Add a link
Reference in a new issue