From 7e9dcfe82550cb0d1f5ea79a9da0dae147ffc9e7 Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Wed, 14 May 2014 16:53:04 +0200 Subject: SONAR-5130 Display measures on 3 columns --- .../org/sonar/plugins/core/widgets/size.html.erb | 36 ++++++++++++++-------- 1 file changed, 24 insertions(+), 12 deletions(-) (limited to 'plugins') diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/size.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/size.html.erb index fe972d726ef..495005cb8b5 100644 --- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/size.html.erb +++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/size.html.erb @@ -16,7 +16,7 @@ %> -
+
<% if ncloc %>

<%= message('widget.size.lines_of_code') -%>

@@ -28,8 +28,11 @@ <% max = ncloc_language_dist_hash.max_by{|_k,v| v.to_i}[1].to_i - # Sort lines language distribution by reverse number of lines - ncloc_language_dist_hash.sort {|v1,v2| v2[1].to_i <=> v1[1].to_i }.each do |language_key, language_ncloc| + + # Sort lines language distribution by language name + languages_by_key = Hash[languages.collect { |l| [l.getKey(), l.getName] }] + puts "#### " + languages_by_key.inspect + ncloc_language_dist_hash.sort {|v1,v2| (languages_by_key[v1[0]] ? languages_by_key[v1[0]].to_s : v1[0]) <=> (languages_by_key[v2[0]] ? languages_by_key[v2[0]].to_s : v2[0]) }.each do |language_key, language_ncloc| %> + + -- cgit v1.2.3
@@ -67,21 +70,30 @@

+<%= format_measure(generated_ncloc, :suffix => message('widget.size.generated.suffix'), :url => url_for_drilldown(generated_ncloc)) -%> <%= dashboard_configuration.selected_period? ? format_variation(generated_ncloc) : trend_icon(generated_ncloc) -%>

<% end %>

<%= format_measure(lines, :suffix => message('widget.size.lines.suffix'), :url => url_for_drilldown(lines)) -%> <%= dashboard_configuration.selected_period? ? format_variation(lines) : trend_icon(lines) -%>

- <% if classes %> -

<%= format_measure(classes, :url => url_for_drilldown(classes), :suffix => message('widget.size.classes.suffix')) -%> <%= dashboard_configuration.selected_period? ? format_variation(classes) : trend_icon(classes) -%>

- <% end %> -

<%= format_measure(functions, :suffix => message('widget.size.methods.suffix'), :url => url_for_drilldown(functions)) -%> <%= dashboard_configuration.selected_period? ? format_variation(functions) : trend_icon(functions) -%>

- <% if measure('accessors') %> -

<%= format_measure('accessors', :suffix => message('widget.size.accessors.suffix'), :url => url_for_drilldown('accessors')) -%> <%= dashboard_configuration.selected_period? ? format_variation('accessors') : trend_icon('accessors') -%>

- <% end %> <% if generated_lines && generated_lines.value>0 %>

incl. <%= format_measure(generated_lines, :suffix => message('widget.size.generated.suffix'), :url => url_for_drilldown(generated_lines)) -%> <%= dashboard_configuration.selected_period? ? format_variation(generated_lines) : trend_icon(generated_lines) -%>

<% end %> + <% if projects %> +

<%= format_measure(projects, :suffix => message('widget.size.projects.suffix')) -%> <%= dashboard_configuration.selected_period? ? format_variation(projects) : trend_icon(projects) -%>

+ <% end %> + +
+
+

<%= message('widget.size.methods') -%>

+

+ <%= format_measure(functions, :url => url_for_drilldown(functions)) -%> + <%= dashboard_configuration.selected_period? ? format_variation(functions) : trend_icon(functions) -%> +

+ <% if classes %> +

<%= format_measure(classes, :url => url_for_drilldown(classes), :suffix => message('widget.size.classes.suffix')) -%> <%= dashboard_configuration.selected_period? ? format_variation(classes) : trend_icon(classes) -%>

+ <% end %> <% if statements %>

<%= format_measure(statements, :suffix => message('widget.size.statements.suffix'), :url => url_for_drilldown(statements)) -%> <%= dashboard_configuration.selected_period? ? format_variation(statements) : trend_icon(statements) -%>

<% end %> - <% if projects %> -

<%= format_measure(projects, :suffix => message('widget.size.projects.suffix')) -%> <%= dashboard_configuration.selected_period? ? format_variation(projects) : trend_icon(projects) -%>

+ <% if measure('accessors') %> +

<%= format_measure('accessors', :suffix => message('widget.size.accessors.suffix'), :url => url_for_drilldown('accessors')) -%> <%= dashboard_configuration.selected_period? ? format_variation('accessors') : trend_icon('accessors') -%>

<% end %>