From 10e37b4e9a40d9b1b706f9df8759482658c66d8e Mon Sep 17 00:00:00 2001 From: David Gageot Date: Mon, 21 May 2012 18:42:33 +0200 Subject: [PATCH] Fix widget title for project widget on global dashboards --- .../src/main/webapp/WEB-INF/app/helpers/dashboard_helper.rb | 2 -- .../WEB-INF/app/views/dashboard/_configure_widget.html.erb | 3 +++ .../main/webapp/WEB-INF/app/views/dashboard/_widget.html.erb | 3 +++ .../webapp/WEB-INF/app/views/dashboard/_widget_title.html.erb | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/sonar-server/src/main/webapp/WEB-INF/app/helpers/dashboard_helper.rb b/sonar-server/src/main/webapp/WEB-INF/app/helpers/dashboard_helper.rb index 250f06188e7..1dc049c3569 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/helpers/dashboard_helper.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/helpers/dashboard_helper.rb @@ -118,14 +118,12 @@ module DashboardHelper widget_body="" if widget.configured - switch_to_widget_resource(widget) begin widget_body=render :inline => widget.java_definition.getTarget().getTemplate(), :locals => {:widget_properties => widget.properties_as_hash, :widget => widget, :dashboard_configuration => @dashboard_configuration} rescue => error logger.error(message('dashboard.cannot_render_widget_x', :params => [widget.java_definition.getId(), error])) logger.error(error.backtrace.join('\n')) end - restore_global_resource end widget_body diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_configure_widget.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_configure_widget.html.erb index 890c5b0b1da..3d7e81f9795 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_configure_widget.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_configure_widget.html.erb @@ -1,3 +1,4 @@ +<% switch_to_widget_resource(widget) %> <% widget_body=widget_body(widget) %>
@@ -43,3 +44,5 @@ <% end %>
+ +<% restore_global_resource %> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget.html.erb index 6f9e706d922..e7ae2a5ce94 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget.html.erb @@ -1,3 +1,4 @@ +<% switch_to_widget_resource(widget) %> <% widget_body=widget_body(widget) %> <% if widget_body.include?('<') %> @@ -29,3 +30,5 @@ <% end %> + +<% restore_global_resource %> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget_title.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget_title.html.erb index ce1adbd2c33..71921380506 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget_title.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget_title.html.erb @@ -9,5 +9,5 @@ <% end %> <% elsif @dashboard.global and @resource and !widget.java_definition.global %> -
<%= @resource.name -%>
+
<%= @resource.name -%>
<% end %> -- 2.39.5