diff options
author | Simon Brandhof <simon.brandhof@gmail.com> | 2011-10-13 12:07:05 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@gmail.com> | 2011-10-13 12:07:05 +0200 |
commit | 049d0b5e982916a4b345df1736dce368129dc9af (patch) | |
tree | 5f4ceb9375ceeca3d82324534299360d84341597 | |
parent | 5e2dcafceb82cb9d6761f0d95d8a57b320bf0986 (diff) | |
download | sonarqube-049d0b5e982916a4b345df1736dce368129dc9af.tar.gz sonarqube-049d0b5e982916a4b345df1736dce368129dc9af.zip |
SONAR-2771 surround the widget with <div id='block_1'> in order to be consistent with dashboards
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/controllers/widget_controller.rb | 2 | ||||
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/views/widget/index.html.erb | 50 |
2 files changed, 27 insertions, 25 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/widget_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/widget_controller.rb index 1b7af59bb0d..fe0dab59a2d 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/widget_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/widget_controller.rb @@ -45,7 +45,7 @@ class WidgetController < ApplicationController def load_widget widget_key = params[:id] @widget_definition = java_facade.getWidget(widget_key) - @widget=Widget.new(:widget_key => widget_key) + @widget=Widget.new(:widget_key => widget_key, :id => 1) @widget_definition.getWidgetProperties().each do |property_definition| @widget.properties<<WidgetProperty.new( diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/widget/index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/widget/index.html.erb index aba1a5a61ef..b5a77d249a3 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/widget/index.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/widget/index.html.erb @@ -1,28 +1,30 @@ -<div class="<%= @widget_definition.getId() %>" style="height:100%;"> - <% - begin - widget_body=render :inline => @widget_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_definition.getId(), error])) - logger.error(error.backtrace.join("\n")) - widget_body="" - end +<div id="block_1" class="block"> + <div class="<%= @widget_definition.getId() %>" style="height:100%;"> + <% + begin + widget_body=render :inline => @widget_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_definition.getId(), error])) + logger.error(error.backtrace.join("\n")) + widget_body="" + end - if widget_body.include?('<') - %> + if widget_body.include?('<') + %> + <% + default_layout=(@widget_definition.getWidgetLayout().name()=='DEFAULT') + if default_layout + %> + <div class="widget"> + <% end %> + <%= widget_body -%> + <% if default_layout %> + <div class="clear"></div> + </div> + <% end %> <% - default_layout=(@widget_definition.getWidgetLayout().name()=='DEFAULT') - if default_layout + end %> - <div class="widget"> - <% end %> - <%= widget_body -%> - <% if default_layout %> - <div class="clear"></div> - </div> - <% end %> - <% - end - %> - <div style="clear: both;"></div> + <div style="clear: both;"></div> + </div> </div>
\ No newline at end of file |