]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-3357 Improve the "Violations" widget
authorFabrice Bellingard <bellingard@gmail.com>
Tue, 27 Mar 2012 08:54:49 +0000 (10:54 +0200)
committerFabrice Bellingard <bellingard@gmail.com>
Tue, 27 Mar 2012 08:55:34 +0000 (10:55 +0200)
- replace "On new code" label by "Added"
- replace "On old code" label by "Removed"

plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/rules.html.erb
plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/core.properties

index 21abde5f3cbe582b263826530a142aba679447fb..d62971a097ca60af510055cdd4ffe0e0c0313cc9 100644 (file)
                if @dashboard_configuration.selected_period?
                  violations_variation = variation_value(violations)
                  new_violations_variation = variation_value(new_violations)
-                 estimated_cleared_violations = (violations_variation - new_violations_variation).to_i if violations_variation && new_violations_variation
+                 estimated_cleared_violations = (new_violations_variation - violations_variation).to_i if violations_variation && new_violations_variation
             %>
               <% if new_violations_variation && new_violations_variation > 0 %>
                 <br/>
                 <span style="font-weight: bold">
-                  <%= message('widget.rules.on_new_code') -%>&nbsp;
+                  <%= message('widget.rules.added') -%>&nbsp;
                   <a href="<%= url_for(:controller => 'drilldown', :action => 'violations', :id => @project.key, :period => dashboard_configuration.period_index) -%>" class="varw"><%= format_variation(new_violations, :style => 'none', :default => '-') -%></a>
                 </span>
               <% end %>
-              <% if estimated_cleared_violations && estimated_cleared_violations < 0 %>
+              <% if estimated_cleared_violations && estimated_cleared_violations > 0 %>
                 <br/>
                 <span style="font-weight: bold">
-                  <%= message('widget.rules.on_old_code') -%>&nbsp;
+                  <%= message('widget.rules.removed') -%>&nbsp;
                   <span class="varb"><%= estimated_cleared_violations -%></span>
                 </span>
               <% end %>
index d41cd3320c90d18f6999ee2b8ea8810d55725eff..21c9bcb712f8389293b6e91c7792a5379c78325b 100644 (file)
@@ -654,6 +654,8 @@ widget.rules.violations=Violations
 widget.rules.rules_compliance=Rules compliance
 widget.rules.on_new_code=On new code:
 widget.rules.on_old_code=On old code:
+widget.rules.added=Added:
+widget.rules.removed=Removed:
 
 widget.size.name=Size metrics
 widget.size.description=Reports general metrics on the size of the project.