1 <% content_for :css do %>
6 background-color: whitesmoke;
10 <% if results.result_offset != nil and results.result_limit != nil and results.items_available != nil %>
11 <div class="index-paging">
13 <% if results.result_offset > 0 %>
14 <% if results.result_offset > results.result_limit %>
15 <% prev_offset = results.result_offset - results.result_limit %>
20 <% prev_offset = nil %>
23 <% this_offset = results.result_offset %>
24 <% this_page = results.result_offset / results.result_limit %>
26 <% if (results.result_offset + results.result_limit) < results.items_available %>
27 <% next_offset = results.result_offset + results.result_limit %>
29 <% next_offset = nil %>
32 <span class="pull-left">
33 <% if results.result_offset > 0 %>
34 <%= link_to raw("<span class='glyphicon glyphicon-fast-backward'></span>"), {:id => object, :offset => 0, :limit => results.result_limit} %>
36 <span class='glyphicon glyphicon-fast-backward text-muted'></span>
40 <%= link_to raw("<span class='glyphicon glyphicon-step-backward'></span>"), {:id => object, :offset => prev_offset, :limit => results.result_limit} %>
42 <span class='glyphicon glyphicon-step-backward text-muted'></span>
46 <% n = this_page - 10 %>
48 <% last = this_page + 10 %>
55 <% i = n * results.result_limit %>
56 <% while i < results.items_available and n < last %>
57 <% if n != this_page %>
58 <%= link_to "#{n+1}", {:id => @object, :offset => i, :limit => results.result_limit} %>
62 <% i += results.result_limit %>
66 <% if i < results.items_available %>
70 <span class="pull-right">
72 <%= link_to raw("<span class='glyphicon glyphicon-step-forward'></span>"), {:id => @object, :offset => next_offset, :limit => results.result_limit} %>
74 <span class='glyphicon glyphicon-forward text-muted'></span>
77 <% if (results.items_available - results.result_offset) >= results.result_limit %>
78 <%= link_to raw("<span class='glyphicon glyphicon-fast-forward'></span>"), {:id => @object, :offset => results.items_available - (results.items_available % results.result_limit),
79 :limit => results.result_limit} %>
81 <span class='glyphicon glyphicon-fast-forward text-muted'></span>