app/views/sail/settings/index.html.erb in sail-3.2.4 vs app/views/sail/settings/index.html.erb in sail-3.3.0
- old
+ new
@@ -20,16 +20,26 @@
<div id="pagination">
<div class="clearfix"></div>
<div class="page-links">
- <%= link_to("", settings_path(page: [params[:page].to_i - 1, 0].max, monitor_mode: params[:monitor_mode]), method: :get, id: "angle-left-link", title: I18n.t("sail.previous_page")) %>
+ <%= link_to("", settings_path(page: [params[:page].to_i - 1, 0].max, monitor_mode: params[:monitor_mode], query: params[:query]), method: :get, id: "angle-left-link", title: I18n.t("sail.previous_page")) %>
+ <%= link_to(1, settings_path(page: 0, monitor_mode: params[:monitor_mode], query: params[:query]), method: :get, class: params[:page].to_i.zero? || params[:page].blank? ? "active" : "") %>
- <% (0...@number_of_pages).each do |page| %>
- <%= link_to(page + 1, settings_path(page: page, monitor_mode: params[:monitor_mode]), method: :get, class: params[:page].to_i == page || params[:page].blank? && page.zero? ? "active" : "") %>
+ <% if params[:page].to_i - Sail::ConstantCollection::MAX_PAGES > 1 %>
+ ●●●
<% end %>
- <%= link_to("", settings_path(page: [params[:page].to_i + 1, @number_of_pages - 1].min, monitor_mode: params[:monitor_mode]), method: :get, id: "angle-right-link", title: I18n.t("sail.next_page")) %>
+ <% ([params[:page].to_i - Sail::ConstantCollection::MAX_PAGES, 1].max...[@number_of_pages - 1, params[:page].to_i + Sail::ConstantCollection::MAX_PAGES].min).each do |page| %>
+ <%= link_to(page + 1, settings_path(page: page, monitor_mode: params[:monitor_mode], query: params[:query]), method: :get, class: params[:page].to_i == page || params[:page].blank? && page.zero? ? "active" : "") %>
+ <% end %>
+
+ <% if params[:page].to_i + Sail::ConstantCollection::MAX_PAGES < @number_of_pages - 1 %>
+ ●●●
+ <% end %>
+
+ <%= link_to(@number_of_pages, settings_path(page: @number_of_pages - 1, monitor_mode: params[:monitor_mode], query: params[:query]), method: :get, class: params[:page].to_i == @number_of_pages - 1 ? "active" : "") %>
+ <%= link_to("", settings_path(page: [params[:page].to_i + 1, @number_of_pages - 1].min, monitor_mode: params[:monitor_mode], query: params[:query]), method: :get, id: "angle-right-link", title: I18n.t("sail.next_page")) %>
</div>
</div>
<% end %>
</div>