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
+<% switch_to_widget_resource(widget) %>
<% widget_body=widget_body(widget) %>
<div class="widget-header">
<% end %>
<div style="clear: both;"></div>
</div>
+
+<% restore_global_resource %>
+<% switch_to_widget_resource(widget) %>
<% widget_body=widget_body(widget) %>
<% if widget_body.include?('<') %>
</div>
</div>
<% end %>
+
+<% restore_global_resource %>
<% 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 %>