diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2014-08-28 14:19:06 +0200 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@sonarsource.com> | 2014-08-28 14:19:06 +0200 |
commit | 819ad25a12f354fbdb4d21d31419097187b0baeb (patch) | |
tree | 476bdf5a15e44ca527eb41b5f3d68d7cae6b088b /server/sonar-web | |
parent | 8b266df87be50366ff730bd21059ea746f2d079a (diff) | |
download | sonarqube-819ad25a12f354fbdb4d21d31419097187b0baeb.tar.gz sonarqube-819ad25a12f354fbdb4d21d31419097187b0baeb.zip |
Restore period option from link_to_resource because it's used on project
Diffstat (limited to 'server/sonar-web')
-rw-r--r-- | server/sonar-web/src/main/webapp/WEB-INF/app/helpers/application_helper.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/helpers/application_helper.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/helpers/application_helper.rb index 9830f89dd3b..5624de3a9ce 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/helpers/application_helper.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/helpers/application_helper.rb @@ -309,6 +309,8 @@ module ApplicationHelper # # def link_to_resource(resource, name=nil, options={}) + period_index=options[:period] + period_index=nil if period_index && period_index<=0 if resource.display_dashboard? if options[:dashboard] root = "#{ApplicationController.root_context}/dashboard/index?" @@ -320,6 +322,7 @@ module ApplicationHelper query = request.query_parameters query[:id] = resource.id query[:metric] = options[:metric] if options[:metric] + query[:period] = period_index if period_index query.each do |key, value| path += '&' unless path.empty? path += "#{u key}=#{u value}" @@ -327,6 +330,7 @@ module ApplicationHelper "<a class='#{options[:class]}' title='#{options[:title]}' href='#{root + path}'>#{name || resource.name}</a>" else url = "#{ApplicationController.root_context}/dashboard/index?id=#{u resource.key}" + url += "&period=#{u period_index}" if period_index url += "&metric=#{u options[:metric]}" if options[:metric] "<a class='#{options[:class]}' title='#{options[:title]}' " + "onclick='window.open(this.href,\"resource-#{resource.key.parameterize}\",\"\");return false;' " + |