From 0ce40ec70d380493eb20bf56c3aef9ab5ba498c1 Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Fri, 21 Jun 2013 12:12:47 +0200 Subject: [PATCH] Add an option in paginate_java to display a link on the total number --- .../src/main/webapp/WEB-INF/app/helpers/application_helper.rb | 4 +++- .../app/views/project/widgets/issues/_issues_list.html.erb | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb b/sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb index b1957e6bb68..98886673a8a 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb @@ -911,12 +911,14 @@ module ApplicationHelper # Options : # :id HTML id of the node # :colspan number of columns in the table + # :url_results url to display on the number of results # :include_loading_icon add a hidden loading icon, only if value is true and if the option :id is set as well. The HTML id of the generated icon # is '_loading' def paginate_java(pagination, options={}, &block) total = pagination.total.to_i page_index = pagination.pageIndex() ? pagination.pageIndex().to_i : 1 pages = pagination.pages().to_i + results_html = options[:url_results] ? message('x_results', :params => "#{total}") : message('x_results', :params => [total]) html = ' [total]) if total>0 + html += results_html if total>0 if pages > 1 max_pages = pages diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/project/widgets/issues/_issues_list.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/project/widgets/issues/_issues_list.html.erb index 3acbc701649..c243b9d8cc1 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/project/widgets/issues/_issues_list.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/project/widgets/issues/_issues_list.html.erb @@ -71,7 +71,8 @@ link_params[:widget_id] = widget_id link_params[:period] = params[:period] %> - <%= paginate_java(paging, :colspan => 4, :id => "issue-filter-foot-#{widget_id}", :include_loading_icon => true) { |label, page_id| + <%= paginate_java(paging, :colspan => 4, :id => "issue-filter-foot-#{widget_id}", :include_loading_icon => true, + :url_results => url_for({:controller => 'issues', :action => 'search' }.merge(search_options)) ) { |label, page_id| link_to_remote(label, :update => "issues-widget-#{widget_id}", :url => link_params.merge({:pageIndex => page_id})) -- 2.39.5