aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/sonar-design-plugin
diff options
context:
space:
mode:
authorFabrice Bellingard <fabrice.bellingard@sonarsource.com>2012-09-25 11:23:55 +0200
committerFabrice Bellingard <fabrice.bellingard@sonarsource.com>2012-09-25 11:23:55 +0200
commitd653298b8bddde98b44bfb24af0aea92c63e5be8 (patch)
treefcc9502c022988a9f4fe252022af56f2ceb3f51e /plugins/sonar-design-plugin
parent736f1fa0b159c17d7f67571916f1d73a5046a4e2 (diff)
downloadsonarqube-d653298b8bddde98b44bfb24af0aea92c63e5be8.tar.gz
sonarqube-d653298b8bddde98b44bfb24af0aea92c63e5be8.zip
SONAR-3591 Improve widget inner-layout
Diffstat (limited to 'plugins/sonar-design-plugin')
-rw-r--r--plugins/sonar-design-plugin/src/main/resources/org/sonar/plugins/design/ui/widgets/lcom4.html.erb8
-rw-r--r--plugins/sonar-design-plugin/src/main/resources/org/sonar/plugins/design/ui/widgets/response_for_class.html.erb8
2 files changed, 10 insertions, 6 deletions
diff --git a/plugins/sonar-design-plugin/src/main/resources/org/sonar/plugins/design/ui/widgets/lcom4.html.erb b/plugins/sonar-design-plugin/src/main/resources/org/sonar/plugins/design/ui/widgets/lcom4.html.erb
index 171d3e6175b..a827d0a62de 100644
--- a/plugins/sonar-design-plugin/src/main/resources/org/sonar/plugins/design/ui/widgets/lcom4.html.erb
+++ b/plugins/sonar-design-plugin/src/main/resources/org/sonar/plugins/design/ui/widgets/lcom4.html.erb
@@ -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>
@@ -20,10 +22,10 @@
</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 %>
diff --git a/plugins/sonar-design-plugin/src/main/resources/org/sonar/plugins/design/ui/widgets/response_for_class.html.erb b/plugins/sonar-design-plugin/src/main/resources/org/sonar/plugins/design/ui/widgets/response_for_class.html.erb
index 63a6fa6f55a..976d6cdde9f 100644
--- a/plugins/sonar-design-plugin/src/main/resources/org/sonar/plugins/design/ui/widgets/response_for_class.html.erb
+++ b/plugins/sonar-design-plugin/src/main/resources/org/sonar/plugins/design/ui/widgets/response_for_class.html.erb
@@ -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">
@@ -16,10 +18,10 @@
</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 %>