diff options
author | Julien Lancelot <julien.lancelot@gmail.com> | 2013-06-21 12:12:47 +0200 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@gmail.com> | 2013-06-21 12:13:02 +0200 |
commit | 0ce40ec70d380493eb20bf56c3aef9ab5ba498c1 (patch) | |
tree | 8ef64d19f2ed96be8641dbc6db02193e0562fcb2 | |
parent | 10a5e1b5cafe98fcbb6028dbdfafec88d3a9c60a (diff) | |
download | sonarqube-0ce40ec70d380493eb20bf56c3aef9ab5ba498c1.tar.gz sonarqube-0ce40ec70d380493eb20bf56c3aef9ab5ba498c1.zip |
Add an option in paginate_java to display a link on the total number
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb | 4 | ||||
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/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 <tfoot> 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 '<id>_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 => "<a href='#{options[:url_results]}'>#{total}</a>") : message('x_results', :params => [total]) html = '<tfoot' html += " id='#{options[:id]}'" if options[:id] @@ -929,7 +931,7 @@ module ApplicationHelper html += '<div' html += " id='#{options[:id]}_pages'" if options[:id] html += '>' - html += message('x_results', :params => [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})) |