1 <% content_for :css do %>
6 background-color: whitesmoke;
14 <% results.fetch_multiple_pages(false) %>
16 <% if results.respond_to? :result_offset and
17 results.respond_to? :result_limit and
18 results.respond_to? :items_available and
19 results.result_offset != nil and
20 results.result_limit != nil and
21 results.items_available != nil
23 <div class="index-paging">
24 Displaying <%= results.result_offset+1 %> –
25 <%= if results.result_offset + results.result_limit > results.items_available
26 results.items_available
28 results.result_offset + results.result_limit
30 out of <%= results.items_available %>
33 <% if not (results.result_offset == 0 and results.items_available <= results.result_limit) %>
35 <div class="index-paging">
37 <% if results.result_offset > 0 %>
38 <% if results.result_offset > results.result_limit %>
39 <% prev_offset = results.result_offset - results.result_limit %>
44 <% prev_offset = nil %>
47 <% this_offset = results.result_offset %>
49 <% if (results.result_offset + results.result_limit) < results.items_available %>
50 <% next_offset = results.result_offset + results.result_limit %>
52 <% next_offset = nil %>
55 <span class="pull-left">
56 <% if results.result_offset > 0 %>
57 <%= link_to raw("<span class='glyphicon glyphicon-fast-backward'></span>"), {:id => object, :offset => 0, :limit => results.result_limit} %>
59 <span class='glyphicon glyphicon-fast-backward text-muted'></span>
63 <%= link_to raw("<span class='glyphicon glyphicon-step-backward'></span>"), {:id => object, :offset => prev_offset, :limit => results.result_limit} %>
65 <span class='glyphicon glyphicon-step-backward text-muted'></span>
69 <% first = this_offset - (10 * results.result_limit) %>
70 <% last = this_offset + (11 * results.result_limit) %>
72 <% lastpage_offset = (results.items_available / results.result_limit) * results.result_limit %>
74 <% if last > results.items_available %>
75 <% first -= (last - lastpage_offset) %>
76 <% last -= (last - results.items_available) %>
85 <% last = results.items_available if last > results.items_available %>
88 <% n = first / results.result_limit %>
95 <% if i != this_offset %>
96 <%= link_to "#{n+1}", {:id => @object, :offset => i, :limit => results.result_limit}, class: 'paging-number' %>
98 <span class="paging-number" style="font-weight: bold;"><%= n+1 %></span>
100 <% i += results.result_limit %>
104 <% if last < results.items_available %>
108 <span class="pull-right">
110 <%= link_to raw("<span class='glyphicon glyphicon-step-forward'></span>"), {:id => @object, :offset => next_offset, :limit => results.result_limit} %>
112 <span class='glyphicon glyphicon-forward text-muted'></span>
115 <% if (results.items_available - results.result_offset) >= results.result_limit %>
116 <%= link_to raw("<span class='glyphicon glyphicon-fast-forward'></span>"), {:id => @object, :offset => results.items_available - (results.items_available % results.result_limit),
117 :limit => results.result_limit} %>
119 <span class='glyphicon glyphicon-fast-forward text-muted'></span>