From b81f60728bcad3bbb55d28129720f1db11eae1f7 Mon Sep 17 00:00:00 2001 From: David Gageot Date: Mon, 21 May 2012 16:21:22 +0200 Subject: [PATCH] Empty widgets shouldn't be displayed --- .../app/views/dashboard/_widget.html.erb | 42 ++++++++++--------- .../app/views/dashboard/index.html.erb | 12 +++--- 2 files changed, 28 insertions(+), 26 deletions(-) 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 8996cf2e686..6f9e706d922 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,27 +1,31 @@ <% widget_body=widget_body(widget) %> -<%= render :partial => 'widget_title', :locals => {:widget => widget} -%> +<% if widget_body.include?('<') %> +
+ <%= render :partial => 'widget_title', :locals => {:widget => widget} -%> -
- <% if widget.configured %> - <% if widget_body.include?('<') - default_layout=(widget.java_definition.getWidgetLayout().name()=='DEFAULT') - if default_layout %> -
- <% end %> - <%= widget_body -%> +
+ <% default_layout=(widget.java_definition.getWidgetLayout().name()=='DEFAULT') %> <% if default_layout %> -
+
+ <%= widget_body -%> +
+ <% else %> + <%= widget_body -%> <% end %> - <% end %> - <% else %> - - <% end %> -
-
+
+<% elsif !widget.configured %> + +<% end %> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/index.html.erb index 83b795b23ed..2c62c6650af 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/index.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/index.html.erb @@ -13,13 +13,11 @@ widget_definition=@authorized_widget_definitions.find { |wd| wd.getId()==widget.widget_key } if widget_definition %> -
- <%= render :partial => 'widget', :locals => {:widget => widget} %> -
- <% - end - end - %> + <%= render :partial => 'widget', :locals => {:widget => widget} %> + <% + end + end + %>
<% end %> -- 2.39.5