]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-3591 Improve widget inner-layout
authorFabrice Bellingard <fabrice.bellingard@sonarsource.com>
Tue, 25 Sep 2012 09:23:55 +0000 (11:23 +0200)
committerFabrice Bellingard <fabrice.bellingard@sonarsource.com>
Tue, 25 Sep 2012 09:23:55 +0000 (11:23 +0200)
plugins/sonar-design-plugin/src/main/resources/org/sonar/plugins/design/ui/widgets/lcom4.html.erb
plugins/sonar-design-plugin/src/main/resources/org/sonar/plugins/design/ui/widgets/response_for_class.html.erb

index 171d3e6175b754f35a2478b34760dbf534006fe2..a827d0a62de26be11eeef774f8262bf75429e9a1 100644 (file)
@@ -3,11 +3,13 @@
   if lcom
     lcom_distribution=measure('lcom4_distribution')
     suspect_lcom4_density=measure('suspect_lcom4_density')
+    
+    display_chart = suspect_lcom4_density && suspect_lcom4_density.value>1.0 && lcom_distribution && !lcom_distribution.data.blank?
 %>
 <table width="100%">
   <tbody>
     <tr>
-      <td valign="top">
+      <td valign="top" width="<%= display_chart ? '50' : '100' -%>%">
         <div class="dashbox">
           <h3><%= message('widget.lcom4.title') -%></h3>
           <p>
       </td>
 
       <%
-        if suspect_lcom4_density && suspect_lcom4_density.value>1.0 && lcom_distribution && !lcom_distribution.data.blank?
+        if display_chart
           query="ck=distbar&c=777777&w=180&h=100&fs=8&bgc=ffffff&v=" + u(lcom_distribution.data)
       %>
-      <td>
+      <td valign="top" width="50px">
         <a href="<%= url_for_drilldown('lcom4') -%>"><%= chart(query, :id => 'lcom4_distribution', :alt => '') -%></a>
       </td>
       <% end %>
index 63a6fa6f55a7ced611a30ff61110bfb2a9595536..976d6cdde9f3f0ef7252a75a9e10ceb4980d36c4 100644 (file)
@@ -2,11 +2,13 @@
   rfc=measure('rfc')
   if rfc
     rfc_distribution=measure('rfc_distribution')
+    
+    display_chart = rfc_distribution && !rfc_distribution.data.blank?
 %>
 <table width="100%">
   <tbody>
     <tr>
-      <td valign="top">
+      <td valign="top" width="<%= display_chart ? '50' : '100' -%>%">
         <div class="dashbox">
           <h3><%= message('widget.rfc.title') -%></h3>
           <p><span class="big">
       </td>
 
       <%
-        if rfc_distribution && !rfc_distribution.data.blank?
+        if display_chart
           query="ck=distbar&c=777777&w=180&h=100&fs=8&bgc=ffffff&v=" + u(rfc_distribution.data)
       %>
-      <td>
+      <td valign="top" width="50px">
         <a href="<%= url_for_drilldown('rfc') -%>"><%= chart(query, :id => 'rfc_distribution', :alt => '') -%></a>
       </td>
       <% end %>