From 8eb27bccaa8b9dd269925ea8e23d44a39c06bd71 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Tue, 4 Dec 2012 13:54:13 +0100 Subject: [PATCH] SONAR-3825 improve rendering of treemap widget --- .../views/measures/_display_treemap.html.erb | 68 +++++++++++-------- 1 file changed, 40 insertions(+), 28 deletions(-) diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_display_treemap.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_display_treemap.html.erb index d8d31d05d34..751826520ff 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_display_treemap.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_display_treemap.html.erb @@ -1,30 +1,38 @@ - - - - - - -
- <%= message('size') -%> -
- <%= metric_select_tag 'tmSize', Metric.all.select { |m| m.treemap_size? }, - :html_id => 'select-tm-size', - :selected_key => filter.display.size_metric.key -%> -
- <%= message('color') -%> - <% if filter.display.color_metric %> - - <%= render :partial => 'treemap/gradient', :locals => {:metric => filter.display.color_metric} %> - +<% if defined? widget %> + <%= message('size') -%>: <%= filter.display.size_metric.short_name -%> + <% if filter.display.color_metric %> + <%= message('color') -%>: <%= filter.display.color_metric.short_name -%> <%= render :partial => 'treemap/gradient', :locals => {:metric => filter.display.color_metric} %> + <% end %> +<% else %> + + + + + + +
+ <%= message('size') -%> +
+ <%= metric_select_tag 'tmSize', Metric.all.select { |m| m.treemap_size? }, + :html_id => 'select-tm-size', + :selected_key => filter.display.size_metric.key -%> +
+ <%= message('color') -%> + <% if filter.display.color_metric %> + + <%= render :partial => 'treemap/gradient', :locals => {:metric => filter.display.color_metric} %> + <% end %> -
- <%= metric_select_tag 'tmColor', Metric.all.select { |m| m.treemap_color? }, - :html_id => 'select-tm-color', - :allow_empty => true, - :selected_key => (filter.display.color_metric ? filter.display.color_metric.key : nil) -%> +
+ <%= metric_select_tag 'tmColor', Metric.all.select { |m| m.treemap_color? }, + :html_id => 'select-tm-color', + :allow_empty => true, + :selected_key => (filter.display.color_metric ? filter.display.color_metric.key : nil) -%> + + +
+<% end %> - -
<% content_for :script do %> <% end %> -
- <%= filter.display.html -%> -
\ No newline at end of file +<% if filter.results.empty? %> +

<%= message('no_data') -%>

+<% else %> +
+ <%= filter.display.html -%> +
+<% end %> \ No newline at end of file -- 2.39.5