1 <% content_for :css do %>
6 background-color: whitesmoke;
14 <% if results.respond_to? :result_offset and
15 results.respond_to? :result_limit and
16 results.respond_to? :items_available and
17 results.result_offset != nil and
18 results.result_limit != nil and
19 results.items_available != nil
21 <div class="index-paging">
22 Displaying <%= results.result_offset+1 %> –
23 <%= if results.result_offset + results.result_limit > results.items_available
24 results.items_available
26 results.result_offset + results.result_limit
28 out of <%= results.items_available %>
31 <% if not (results.result_offset == 0 and results.items_available <= results.result_limit) %>
33 <div class="index-paging">
35 <% if results.result_offset > 0 %>
36 <% if results.result_offset > results.result_limit %>
37 <% prev_offset = results.result_offset - results.result_limit %>
42 <% prev_offset = nil %>
45 <% this_offset = results.result_offset %>
47 <% if (results.result_offset + results.result_limit) < results.items_available %>
48 <% next_offset = results.result_offset + results.result_limit %>
50 <% next_offset = nil %>
53 <span class="pull-left">
54 <% if results.result_offset > 0 %>
55 <%= link_to raw("<span class='glyphicon glyphicon-fast-backward'></span>"), {:id => object, :offset => 0, :limit => results.result_limit} %>
57 <span class='glyphicon glyphicon-fast-backward text-muted'></span>
61 <%= link_to raw("<span class='glyphicon glyphicon-step-backward'></span>"), {:id => object, :offset => prev_offset, :limit => results.result_limit} %>
63 <span class='glyphicon glyphicon-step-backward text-muted'></span>
67 <% first = this_offset - (10 * results.result_limit) %>
68 <% last = this_offset + (11 * results.result_limit) %>
70 <% lastpage_offset = (results.items_available / results.result_limit) * results.result_limit %>
72 <% if last > results.items_available %>
73 <% first -= (last - lastpage_offset) %>
74 <% last -= (last - results.items_available) %>
83 <% last = results.items_available if last > results.items_available %>
86 <% n = first / results.result_limit %>
93 <% if i != this_offset %>
94 <%= link_to "#{n+1}", {:id => @object, :offset => i, :limit => results.result_limit}, class: 'paging-number' %>
96 <span class="paging-number" style="font-weight: bold;"><%= n+1 %></span>
98 <% i += results.result_limit %>
102 <% if last < results.items_available %>
106 <span class="pull-right">
108 <%= link_to raw("<span class='glyphicon glyphicon-step-forward'></span>"), {:id => @object, :offset => next_offset, :limit => results.result_limit} %>
110 <span class='glyphicon glyphicon-forward text-muted'></span>
113 <% if (results.items_available - results.result_offset) >= results.result_limit %>
114 <%= link_to raw("<span class='glyphicon glyphicon-fast-forward'></span>"), {:id => @object, :offset => results.items_available - (results.items_available % results.result_limit),
115 :limit => results.result_limit} %>
117 <span class='glyphicon glyphicon-fast-forward text-muted'></span>