]> source.dussan.org Git - sonarqube.git/commitdiff
update labels of variation select boxes
authorsimonbrandhof <simon.brandhof@gmail.com>
Thu, 23 Dec 2010 00:15:40 +0000 (00:15 +0000)
committersimonbrandhof <simon.brandhof@gmail.com>
Thu, 23 Dec 2010 00:15:40 +0000 (00:15 +0000)
plugins/sonar-core-gwt/src/main/java/org/sonar/plugins/core/violationsviewer/client/I18nConstants.java
plugins/sonar-core-gwt/src/main/java/org/sonar/plugins/core/violationsviewer/client/ViolationsViewer.java
sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb
sonar-server/src/main/webapp/WEB-INF/app/helpers/dashboard_helper.rb
sonar-server/src/main/webapp/WEB-INF/app/helpers/drilldown_helper.rb
sonar-server/src/main/webapp/WEB-INF/app/helpers/filters_helper.rb
sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_header.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/drilldown/violations.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/filters/_list.html.erb

index 5a1767f0eb01e53f80d7bb931c4af646ded09a6d..4d2fa97d408447ccd9b18279a33b91b73bdc166d 100644 (file)
@@ -31,6 +31,9 @@ public interface I18nConstants extends com.google.gwt.i18n.client.Constants {
   @DefaultStringValue("No filters")
   String noFilters();
 
+  @DefaultStringValue("Added...")
+  String addedPeriod();
+
   @DefaultStringValue("Expand:")
   String expand();
 
index 804b143edb8de2518730a045823f634ca69d4962..99de6907d552be9eb2fd56aecc5814f7035e1cfd 100644 (file)
@@ -127,7 +127,7 @@ public class ViolationsViewer extends Page {
   private void initPeriodBox() {
     periodBox = new ListBox();
     periodBox.setStyleName("small");
-    periodBox.addItem(I18nConstants.INSTANCE.noFilters());
+    periodBox.addItem(I18nConstants.INSTANCE.addedPeriod());
 
     initPeriod(1);
     initPeriod(2);
@@ -141,7 +141,7 @@ public class ViolationsViewer extends Page {
     if (period != null) {
       Date date = JsonUtils.parseDateTime(Configuration.getParameter("period" + periodIndex + "_date"));
       if (date != null) {
-        periodBox.addItem(period);
+        periodBox.addItem("Added " + period);
         dateFilters.add(date);
       }
     }
index 184f74aa749822dd9a87147cd6ea91fafbf46d8a..a62478a85fcde7341dffd0c92109362595724f8f 100644 (file)
@@ -83,13 +83,13 @@ module ApplicationHelper
     label=nil
     if mode
       if mode=='days'
-        label = "%s days ago" % mode_param
+        label = "over %s days" % mode_param
       elsif mode=='version'
-        label = "Version %s" % mode_param
+        label = "since version %s" % mode_param
       elsif mode=='previous_analysis'
-        label = "Previous analysis (%s)" % localize(Date.parse(mode_param))
+        label = "since previous analysis (%s)" % localize(Date.parse(mode_param))
       elsif mode=='date'
-        label = "Date: #{localize(Date.parse(mode_param))}"
+        label = "since #{localize(Date.parse(mode_param))}"
       end
     end
     label
index b6473f95dee4d14e6e693d0bb66a06034cbeeb99..90b920a01748b7dc0d7408e2d99ee6c479b2015a 100644 (file)
@@ -32,7 +32,7 @@ module DashboardHelper
     label=period_label(snapshot, index)
     if label
       selected=(params[:period]==index.to_s ? 'selected' : '')
-      "<option value='#{index}' #{selected}>#{label}</option>"
+      "<option value='#{index}' #{selected}>&Delta; #{label}</option>"
     else
       nil
     end
index 0016d5e791932e65b406d002d662f7a7f5e6b2b1..8cdfaf522e2167e23c9385614ea1f5b0ebd524d2 100644 (file)
@@ -26,13 +26,13 @@ module DrilldownHelper
 
     if mode
       if mode=='days'
-        label = "New violations from %s previous days" % mode_param
+        label = "Added over %s previous days" % mode_param
       elsif mode=='version'
-        label = "New violations since version %s" % mode_param
+        label = "Added since version %s" % mode_param
       elsif mode=='previous_analysis'
-        label = "New violations since previous analysis (%s)" % localize(Date.parse(mode_param))
+        label = "Added since previous analysis (%s)" % localize(Date.parse(mode_param))
       elsif mode=='date'
-        label = "New violations since #{localize(Date.parse(mode_param))}"
+        label = "Added since #{localize(Date.parse(mode_param))}"
       end
       if label
         selected=(params[:period]==index.to_s ? 'selected' : '')
index 9ba8ca4c1bf9a7236e174b1d2781c4b83d893ef1..27f66bda9134c2e1b0d6870db60e51edc9c9a5d1 100644 (file)
@@ -171,14 +171,14 @@ module FiltersHelper
 
   def period_name(property)
     if property=='previous_analysis'
-      "Compare to previous analysis"
+      "&Delta; since previous analysis"
     elsif property =~ /^[\d]+(\.[\d]+){0,1}$/
       # is integer
-      "Compare to #{property} days ago"
+      "&Delta; over #{property} days"
     elsif property =~ /\d{4}-\d{2}-\d{2}/
-      "Compare to #{property}"
+      "&Delta; since #{property}"
     elsif !property.blank?
-      "Compare to version #{property}"
+      "&Delta; since version #{property}"
     else
       nil
     end
index dad5d8ed91a0076a290cc2df70c73e4b231f967f..ce47937e37c36436e322fc32c2a2ce7a14a1d348 100644 (file)
@@ -21,7 +21,7 @@
     -
     <form method="GET" action="<%= url_for :only_path=>true, :overwrite_params => {:period => nil} -%>" style="display: inline">
     <select id="select-comparison" name="period" onchange="submit()" class="small">
-      <option value="">Compare to...</option>
+      <option value="">Variations...</option>
       <%= period_select_options(@snapshot, 1) -%>
       <%= period_select_options(@snapshot, 2) -%>
       <%= period_select_options(@snapshot, 3) -%>
index 131eb5227ee1fd9a7cd76b5a5ca390f70e088abe..c813c23adaf18cc55c469c151bb9e37caad66a80 100644 (file)
                       </td>
                </tr>
            <% end %>
-           <% if rule_measures.empty? %>
+
+           <% if rule_index==0 %>
            <tr class="even"><td>No violations</td></tr>
            <% end %>
        </table>
index ebef2d5c6c45c003df3a22d784ac68972449c51a..807acc83eb9557f2f0e53ca07b3043877985ab77 100644 (file)
@@ -4,7 +4,7 @@
     <div class="operations">
     <form action="<%= url_for :overwrite_params => {:period => nil} -%>" style="display: inline" method="get">
       <select name="period" onchange="submit()" class="small">
-          <option value="">Compare to...</option>
+          <option value="">Variations...</option>
           <% period_names.each_with_index do |name, index| %>
              <option value="<%= index+1 -%>" <%= 'selected' if @filter_context.period_index==index+1 -%>><%= name -%></value>
           <% end %>