From de1c458b45c0faeed864d91988a8a64c80d9aa43 Mon Sep 17 00:00:00 2001 From: simonbrandhof Date: Wed, 27 Apr 2011 23:00:43 +0200 Subject: [PATCH] Add header to comparison of quality profiles --- .../app/views/profiles/_diff_rule.html.erb | 2 +- .../app/views/profiles/compare.html.erb | 235 +++++++++--------- .../WEB-INF/app/views/reviews/index.html.erb | 2 +- .../src/main/webapp/stylesheets/style.css | 9 +- 4 files changed, 130 insertions(+), 118 deletions(-) diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/profiles/_diff_rule.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/profiles/_diff_rule.html.erb index 9b7acaec2d7..dfa7b21c653 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/profiles/_diff_rule.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/profiles/_diff_rule.html.erb @@ -1,3 +1,3 @@ <%= image_tag "priority/#{arule.priority}.png" %> -<%= h(arule.rule.name) -%> <%= h(arule.rule.plugin_name) -%> \ No newline at end of file +<%= h(arule.rule.name) -%> <%= h(arule.rule.plugin_name) -%> \ No newline at end of file diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/profiles/compare.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/profiles/compare.html.erb index 8b3957a1e8e..d9db7e9648c 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/profiles/compare.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/profiles/compare.html.erb @@ -1,4 +1,5 @@ -

<%= link_to 'Quality profiles', :controller => 'profiles', :action => 'index' -%> / Compare

+

<%= link_to 'Quality profiles', :controller => 'profiles', :action => 'index' -%> / + Compare

<% if @profile1 && @profile2 %> - <%= image_tag 'switch.png'-%> + <%= image_tag 'switch.png' -%> <% end %>
<% if @profile1 && @profile2 %> - - +
+ + + + + + +
+

Only in <%= h(@profile1.name) -%>

+ <%= @in1.size -%> rules +
+

Only in <%= h(@profile2.name) -%>

+ <%= @in2.size -%> rules +
+

With different configuration

+ <%= @modified.size -%> rules +
+

With same configuration

+ <%= @sames.size -%> rules +
-<% unless @in1.empty? %> - - - - - - - - - <% @in1.each do |diff| %> - - - - <% end %> -
<%= @in1.size -%> rules only in <%= h @profile1.name %>
- <%= render :partial => 'diff_rule', :locals => {:arule => diff.arule1} %> -
- - - - -<% end %> + + -<% unless @in2.empty? %> - - - - - -<% end %> + <% unless @in1.empty? %> + + + + + + <% end %> + <% unless @in2.empty? %> + + + + + + <% end %> -<% unless @modified.empty? %> - - - -<% end %> -<% unless @sames.empty? %> - - - -<% end %> - -
- - - - - - - <% @in2.each do |diff| %> - - - - <% end %> -
<%= @in2.size -%> rules only in <%= h @profile2.name %>
- <%= render :partial => 'diff_rule', :locals => {:arule => diff.arule2} %> -
-
+ + + + + + + <% @in1.each do |diff| %> + + + + <% end %> +
<%= @in1.size -%> rules only in + <%= h @profile1.name %> +
+ <%= render :partial => 'diff_rule', :locals => {:arule => diff.arule1} %> +
+
+ + + + + + + <% @in2.each do |diff| %> + + + + <% end %> +
<%= @in2.size -%> rules only in + <%= h @profile2.name %> +
+ <%= render :partial => 'diff_rule', :locals => {:arule => diff.arule2} %> +
+
- - - - - - - - - <% @modified.each do |diff| - td_css=cycle('even','odd', :name => 'modified') - %> - - - - - - <% end %> -
<%= @modified.size -%> rules have a different configuration
- <%= h @profile1.name %> -

<%= h @profile2.name %>
- <%= render :partial => 'diff_rule', :locals => {:arule => diff.arule1} %> - <% if diff.removed_params && !diff.removed_params.empty? %> -
    - <% diff.removed_params.each do |parameter| %> -
  • <%= h(parameter.name) -%>: <%= parameter.value.gsub(',', ', ') -%>
  • - <% end %> -
- <% end %> -
- <%= render :partial => 'diff_rule', :locals => {:arule => diff.arule2} %> - <% if diff.added_params && !diff.added_params.empty? %> -
    - <% diff.added_params.each do |parameter| %> -
  • <%= h(parameter.name) -%>: <%= parameter.value.gsub(',', ', ') -%>
  • - <% end %> -
- <% end %> -
-
- - - - - - - - - - - -
<%= @sames.size -%> rules have the same configuration
Not displayed
-
+ <% unless @modified.empty? %> + + + + + + + + + + + <% @modified.each do |diff| + td_css=cycle('even', 'odd', :name => 'modified') + %> + + + + + + <% end %> +
<%= @modified.size -%> rules have a different configuration
+
<%= h @profile1.name %> +
+
<%= h @profile2.name %> +
+ <%= render :partial => 'diff_rule', :locals => {:arule => diff.arule1} %> + <% if diff.removed_params && !diff.removed_params.empty? %> +
    + <% diff.removed_params.each do |parameter| %> +
  • <%= h(parameter.name) -%>: + <%= parameter.value.gsub(',', ', ') -%>
  • + <% end %> +
+ <% end %> +
+ <%= render :partial => 'diff_rule', :locals => {:arule => diff.arule2} %> + <% if diff.added_params && !diff.added_params.empty? %> +
    + <% diff.added_params.each do |parameter| %> +
  • <%= h(parameter.name) -%>: + <%= parameter.value.gsub(',', ', ') -%>
  • + <% end %> +
+ <% end %> +
+ + + <% end %> + + <% end %> \ No newline at end of file diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/index.html.erb index 7926a401119..ca4b8de4763 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/index.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/index.html.erb @@ -19,7 +19,7 @@