diff options
author | Julien Lancelot <julien.lancelot@sonarsource.com> | 2014-05-14 16:53:04 +0200 |
---|---|---|
committer | Julien Lancelot <julien.lancelot@sonarsource.com> | 2014-05-14 16:53:12 +0200 |
commit | 7e9dcfe82550cb0d1f5ea79a9da0dae147ffc9e7 (patch) | |
tree | 48b25f657283a4892ea3aba10eff88813d71e973 /plugins | |
parent | f7632015504772d25a57539b47b8fd23f38949ea (diff) | |
download | sonarqube-7e9dcfe82550cb0d1f5ea79a9da0dae147ffc9e7.tar.gz sonarqube-7e9dcfe82550cb0d1f5ea79a9da0dae147ffc9e7.zip |
SONAR-5130 Display measures on 3 columns
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/size.html.erb | 36 |
1 files changed, 24 insertions, 12 deletions
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 @@ %> <table width="100%"> <tr> - <td valign="top" width="48%" nowrap> + <td valign="top" width="40%" nowrap> <div class="dashbox"> <% if ncloc %> <h3><%= message('widget.size.lines_of_code') -%></h3> @@ -28,8 +28,11 @@ <table class="clear width100"> <% 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| %> <tr> <td> @@ -67,21 +70,30 @@ <p>+<%= 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) -%></p> <% end %> <p><%= format_measure(lines, :suffix => message('widget.size.lines.suffix'), :url => url_for_drilldown(lines)) -%> <%= dashboard_configuration.selected_period? ? format_variation(lines) : trend_icon(lines) -%></p> - <% if classes %> - <p><%= format_measure(classes, :url => url_for_drilldown(classes), :suffix => message('widget.size.classes.suffix')) -%></span> <%= dashboard_configuration.selected_period? ? format_variation(classes) : trend_icon(classes) -%></p> - <% end %> - <p><%= format_measure(functions, :suffix => message('widget.size.methods.suffix'), :url => url_for_drilldown(functions)) -%> <%= dashboard_configuration.selected_period? ? format_variation(functions) : trend_icon(functions) -%></p> - <% if measure('accessors') %> - <p><%= format_measure('accessors', :suffix => message('widget.size.accessors.suffix'), :url => url_for_drilldown('accessors')) -%> <%= dashboard_configuration.selected_period? ? format_variation('accessors') : trend_icon('accessors') -%></p> - <% end %> <% if generated_lines && generated_lines.value>0 %> <p>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) -%></p> <% end %> + <% if projects %> + <p><%= format_measure(projects, :suffix => message('widget.size.projects.suffix')) -%> <%= dashboard_configuration.selected_period? ? format_variation(projects) : trend_icon(projects) -%></p> + <% end %> + </div> + </td> + <td width="10"> </td> + <td valign="top"> + <div class="dashbox"> + <h3><%= message('widget.size.methods') -%></h3> + <p> + <span class="big"><%= format_measure(functions, :url => url_for_drilldown(functions)) -%></span> + <%= dashboard_configuration.selected_period? ? format_variation(functions) : trend_icon(functions) -%> + </p> + <% if classes %> + <p><%= format_measure(classes, :url => url_for_drilldown(classes), :suffix => message('widget.size.classes.suffix')) -%></span> <%= dashboard_configuration.selected_period? ? format_variation(classes) : trend_icon(classes) -%></p> + <% end %> <% if statements %> <p> <%= format_measure(statements, :suffix => message('widget.size.statements.suffix'), :url => url_for_drilldown(statements)) -%> <%= dashboard_configuration.selected_period? ? format_variation(statements) : trend_icon(statements) -%></p> <% end %> - <% if projects %> - <p><%= format_measure(projects, :suffix => message('widget.size.projects.suffix')) -%> <%= dashboard_configuration.selected_period? ? format_variation(projects) : trend_icon(projects) -%></p> + <% if measure('accessors') %> + <p><%= format_measure('accessors', :suffix => message('widget.size.accessors.suffix'), :url => url_for_drilldown('accessors')) -%> <%= dashboard_configuration.selected_period? ? format_variation('accessors') : trend_icon('accessors') -%></p> <% end %> </div> </td> |