From 542a118e207d20b3bb323b35bd23e02b14c202de Mon Sep 17 00:00:00 2001 From: Fabrice Bellingard Date: Thu, 8 Dec 2011 12:29:34 +0100 Subject: [PATCH] SONAR-2795 Paging at filters page Display a maximum of 20 page links, which will prevent UI side effects (no need to have more than 20 links, people never go that far in pagination). --- .../main/webapp/WEB-INF/app/views/filters/_list.html.erb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_list.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_list.html.erb index 44468d9516f..c164cfbadea 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_list.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/filters/_list.html.erb @@ -42,12 +42,17 @@ <%= pluralize(@filter_context.size, message('result').downcase) %> - <% if @filter_context.page_count>1 %> + <% + if @filter_context.page_count>1 + max_pages = @filter_context.page_count + max_pages = 20 if @filter_context.page_count > 20 + %> | <%= link_to_if @filter_context.page_id>1, message('paging_previous'), {:overwrite_params => {:page_id => @filter_context.page_id-1}} %> - <% for index in 1..@filter_context.page_count %> + <% for index in 1..max_pages %> <%= link_to_unless index==@filter_context.page_id, index.to_s, {:overwrite_params => {:page_id => index}} %> <% end %> + <%= '...' if @filter_context.page_count > 20 -%> <%= link_to_if @filter_context.page_id<@filter_context.page_count, message('paging_next'), {:overwrite_params => {:page_id => 1+@filter_context.page_id}} %> <% end %> -- 2.39.5