]> source.dussan.org Git - sonarqube.git/commitdiff
Fix widget title for project widget on global dashboards
authorDavid Gageot <david@gageot.net>
Mon, 21 May 2012 16:42:33 +0000 (18:42 +0200)
committerDavid Gageot <david@gageot.net>
Mon, 21 May 2012 16:42:33 +0000 (18:42 +0200)
sonar-server/src/main/webapp/WEB-INF/app/helpers/dashboard_helper.rb
sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_configure_widget.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget_title.html.erb

index 250f06188e728d24440e4d3252bbe441eacce104..1dc049c3569b8032d7c768c54fca08c33f13b309 100644 (file)
@@ -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
index 890c5b0b1da26fe55f6717aac6295a496ff2dd9a..3d7e81f9795d87bd1926e403c69d9d5bca18b728 100644 (file)
@@ -1,3 +1,4 @@
+<% switch_to_widget_resource(widget) %>
 <% widget_body=widget_body(widget) %>
 
 <div class="widget-header">
@@ -43,3 +44,5 @@
   <% end %>
   <div style="clear: both;"></div>
 </div>
+
+<% restore_global_resource %>
index 6f9e706d9222c7ff2152e6c3456d081e503ce4e1..e7ae2a5ce94646e6da8116e80e8f841acdeb68c5 100644 (file)
@@ -1,3 +1,4 @@
+<% switch_to_widget_resource(widget) %>
 <% widget_body=widget_body(widget) %>
 
 <% if widget_body.include?('<') %>
@@ -29,3 +30,5 @@
     </div>
   </div>
 <% end %>
+
+<% restore_global_resource %>
index ce1adbd2c335bb63272938e1d0ad0b9a9e9ebb5a..71921380506c32c93cb99ee77f841caedd80a60d 100644 (file)
@@ -9,5 +9,5 @@
     <% end %>
   </div>
 <% elsif @dashboard.global and @resource and !widget.java_definition.global %>
-  <div class="widget-title"><%= @resource.name -%></div>
+  <div class="widget-title" id="widget_title_<%= widget.id -%>"><%= @resource.name -%></div>
 <% end %>