Sha256: 6856f96e608eeb051c4c13b4110941be651703b74634d0d6ce62a063eb1bca86

Contents?: true

Size: 687 Bytes

Versions: 11

Compression:

Stored size: 687 Bytes

Contents

<% url_gen ||= lambda {|p| p} %>
<% if pagination.total_pages > 1 %>
<div class="paginate">
    <% if( pagination.previous_page ) %>
      <%= link_to '&lt; prev'.html_safe, url_gen.call(pagination.previous_page) %>
    <% end %>
    <% ([(pagination.current_page - 10), 1].max..[pagination.current_page + 10, pagination.total_pages].min).to_a.each do |p| %>
      <% if pagination.current_page != p %>  
        <%= link_to p, url_gen.call(p) %>
      <% else %>
        <span class="current"><%= p %></span>
      <% end %>
    <% end %>
    <% if( pagination.next_page ) %>
      <%= link_to 'next &gt;'.html_safe, url_gen.call(pagination.next_page) %>
    <% end %>
</div>
<% end %>

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
cohortly-0.0.93 app/views/cohortly/metrics/_pagination.html.erb
cohortly-0.0.92 app/views/cohortly/metrics/_pagination.html.erb
cohortly-0.0.9.1 app/views/cohortly/metrics/_pagination.html.erb
cohortly-0.0.9 app/views/cohortly/metrics/_pagination.html.erb
cohortly-0.0.8 app/views/cohortly/metrics/_pagination.html.erb
cohortly-0.0.7 app/views/cohortly/metrics/_pagination.html.erb
cohortly-0.0.6 app/views/cohortly/metrics/_pagination.html.erb
cohortly-0.0.5 app/views/cohortly/metrics/_pagination.html.erb
cohortly-0.0.4 app/views/cohortly/metrics/_pagination.html.erb
cohortly-0.0.3 app/views/cohortly/metrics/_pagination.html.erb
cohortly-0.0.2 app/views/cohortly/metrics/_pagination.html.erb