]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-3825 improve treemap widget
authorSimon Brandhof <simon.brandhof@gmail.com>
Tue, 4 Dec 2012 21:50:06 +0000 (22:50 +0100)
committerSimon Brandhof <simon.brandhof@gmail.com>
Tue, 4 Dec 2012 21:51:19 +0000 (22:51 +0100)
sonar-server/src/main/webapp/WEB-INF/app/views/measures/_display_treemap.html.erb

index 561d68e3441772013732571d1ca6e1b9826daf28..8daad3011bb7ed51553b4c27df356b02fa9115c5 100644 (file)
@@ -1,22 +1,33 @@
 <%
-  treemap_id = 1
-  if defined? widget
-    treemap_id = widget.id
+   treemap_id = 1
+   if defined? widget
+     treemap_id = widget.id
 %>
-  <span class="note"><%= message('size') -%>: <b><%= filter.display.size_metric.short_name -%></b></span>
-  <% if filter.display.color_metric %>
-    &nbsp;&nbsp;
-    <span class="note"><%= message('color') -%>: <b><%= filter.display.color_metric.short_name -%></b> <%= render :partial => 'treemap/gradient', :locals => {:metric => filter.display.color_metric} %></span>
-  <% end %>
+  <table class="spaced">
+    <tr>
+      <% if filter.display.size_metric %>
+        <td class="thin nowrap"><span class="note"><%= message('size') -%>: <b><%= filter.display.size_metric.short_name -%></b></span></td>
+      <% end %>
+      <% if filter.display.color_metric %>
+        <td class="thin nowrap">
+          <span class="note"><%= message('color') -%>
+          : <b><%= filter.display.color_metric.short_name -%></b> <%= render :partial => 'treemap/gradient', :locals => {:metric => filter.display.color_metric} %></span>
+        </td>
+      <% end %>
+      <td>
+        <%= image_tag 'loading-small.gif', :id => "tm-loading-#{treemap_id}", :style => 'display:none' -%>
+      </td>
+    </tr>
+  </table>
 <% else %>
   <table class="spaced width100">
     <tr>
       <td valign="top" class="thin nowrap">
-          <span class="comments"><%= message('size') -%></span>
-          <br/>
-          <%= metric_select_tag 'tmSize', Metric.all.select { |m| m.treemap_size? },
-                                :html_id => 'select-tm-size',
-                                :selected_key => filter.display.size_metric.key -%>
+        <span class="comments"><%= message('size') -%></span>
+        <br/>
+        <%= metric_select_tag 'tmSize', Metric.all.select { |m| m.treemap_size? },
+                              :html_id => 'select-tm-size',
+                              :selected_key => filter.display.size_metric.key -%>
       </td>
       <td valign="top" class="thin nowrap">
         <span class="comments"><%= message('color') -%></span>