Sha256: bae9534615578396001204bcfe3efc8d6ce56228a07847d8e2d94ce416d04d68

Contents?: true

Size: 1.18 KB

Versions: 24

Compression:

Stored size: 1.18 KB

Contents

<% pagination_size_hash = { 'large' => 'lg', 'small' => 'sm' } %>
<% per_page = 20 unless defined?(per_page) and per_page %>
<% object_count = 0 unless defined?(object_count) and object_count %>
<% page = params[:page].blank? ? 1 : params[:page].to_i %>
<% current_page_min = (page - 1)*per_page + 1 %>
<% current_page_max = page*per_page %>

<ul class="pagination pull-right <%= "pagination-#{pagination_size_hash[pagination_size]}" if defined?(pagination_size) and ['large', 'small'].include?(pagination_size) %>">
  <% if current_page_min > 1 %>
    <li><%= link_to '&laquo;'.html_safe, url_for( params.merge( page: page - 1 )  ) %></li>
  <% else %>
    <li class="disabled"><span>&laquo;</span></li>
  <% end %>

  <li>
    <span style="color:#333">
      <b><%= number_with_delimiter current_page_min %> to <%= number_with_delimiter [current_page_max, object_count].min %></b>
      of <%= number_with_delimiter object_count %>
    </span>
  </li>

  <% if current_page_max < object_count %>
    <li><%= link_to '&raquo;'.html_safe, url_for( params.merge( page: page + 1 )  ) %></li>
  <% else %>
    <li class="disabled"><span>&raquo;</span></li>
  <% end %>
</ul>

<div class="clear">&nbsp;</div>

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
contour-3.0.1 app/views/contour/layouts/_per_page.html.erb
contour-3.0.1.rc app/views/contour/layouts/_per_page.html.erb
contour-3.0.0 app/views/contour/layouts/_per_page.html.erb
contour-3.0.0.rc app/views/contour/layouts/_per_page.html.erb
contour-3.0.0.beta1 app/views/contour/layouts/_per_page.html.erb
contour-2.7.0 app/views/contour/layouts/_per_page.html.erb
contour-2.7.0.beta1 app/views/contour/layouts/_per_page.html.erb
contour-2.6.0 app/views/contour/layouts/_per_page.html.erb
contour-2.6.0.rc app/views/contour/layouts/_per_page.html.erb
contour-2.6.0.beta8 app/views/contour/layouts/_per_page.html.erb
contour-2.6.0.beta7 app/views/contour/layouts/_per_page.html.erb
contour-2.6.0.beta6 app/views/contour/layouts/_per_page.html.erb
contour-2.6.0.beta5 app/views/contour/layouts/_per_page.html.erb
contour-2.6.0.beta4 app/views/contour/layouts/_per_page.html.erb
contour-2.6.0.beta3 app/views/contour/layouts/_per_page.html.erb
contour-2.6.0.beta2 app/views/contour/layouts/_per_page.html.erb
contour-2.6.0.beta1 app/views/contour/layouts/_per_page.html.erb
contour-2.5.0 app/views/contour/layouts/_per_page.html.erb
contour-2.5.0.beta1 app/views/contour/layouts/_per_page.html.erb
contour-2.4.0 app/views/contour/layouts/_per_page.html.erb