X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/e6c5563c60df03d4d061a6b301b730f0672b69a5..c7cf228372bee18d84b14fc4089a758bc157fe76:/apps/workbench/app/views/application/_paging.html.erb diff --git a/apps/workbench/app/views/application/_paging.html.erb b/apps/workbench/app/views/application/_paging.html.erb deleted file mode 100644 index 463e65a814..0000000000 --- a/apps/workbench/app/views/application/_paging.html.erb +++ /dev/null @@ -1,120 +0,0 @@ -<% content_for :css do %> -.index-paging { -text-align: center; -padding-left: 1em; -padding-right: 1em; -background-color: whitesmoke; -} -.paging-number { -display: inline-block; -min-width: 1.2em; -} -<% end %> - -<% if results.result_offset != nil and results.result_limit != nil and results.items_available != nil %> -
- Displaying <%= results.result_offset+1 %> – - <%= if results.result_offset + results.result_limit > results.items_available - results.items_available - else - results.result_offset + results.result_limit - end %> - out of <%= results.items_available %> -
- -<% if not (results.result_offset == 0 and results.items_available <= results.result_limit) %> - -
- -<% if results.result_offset > 0 %> - <% if results.result_offset > results.result_limit %> - <% prev_offset = results.result_offset - results.result_limit %> - <% else %> - <% prev_offset = 0 %> - <% end %> -<% else %> - <% prev_offset = nil %> -<% end %> - -<% this_offset = results.result_offset %> - -<% if (results.result_offset + results.result_limit) < results.items_available %> - <% next_offset = results.result_offset + results.result_limit %> -<% else %> - <% next_offset = nil %> -<% end %> - - -<% if results.result_offset > 0 %> - <%= link_to raw(""), {:id => object, :offset => 0, :limit => results.result_limit} %> -<% else %> - -<% end %> - -<% if prev_offset %> - <%= link_to raw(""), {:id => object, :offset => prev_offset, :limit => results.result_limit} %> -<% else %> - -<% end %> - - -<% first = this_offset - (10 * results.result_limit) %> -<% last = this_offset + (11 * results.result_limit) %> - -<% lastpage_offset = (results.items_available / results.result_limit) * results.result_limit %> - -<% if last > results.items_available %> - <% first -= (last - lastpage_offset) %> - <% last -= (last - results.items_available) %> -<% end %> - -<% if first < 0 %> - <% d = -first %> - <% first += d %> - <% last += d %> -<% end %> - -<% last = results.items_available if last > results.items_available %> - -<% i = first %> -<% n = first / results.result_limit %> - -<% if first > 0 %> -… -<% end %> - -<% while i < last %> -<% if i != this_offset %> - <%= link_to "#{n+1}", {:id => @object, :offset => i, :limit => results.result_limit}, class: 'paging-number' %> -<% else %> - <%= n+1 %> -<% end %> -<% i += results.result_limit %> -<% n += 1 %> -<% end %> - -<% if last < results.items_available %> -… -<% end %> - - -<% if next_offset %> - <%= link_to raw(""), {:id => @object, :offset => next_offset, :limit => results.result_limit} %> -<% else %> - -<% end %> - -<% if (results.items_available - results.result_offset) >= results.result_limit %> - <%= link_to raw(""), {:id => @object, :offset => results.items_available - (results.items_available % results.result_limit), - :limit => results.result_limit} %> -<% else %> - -<% end %> - - - -
- -<% end %> - -<% end %>