@DefaultStringValue("No filters")
String noFilters();
+ @DefaultStringValue("Added...")
+ String addedPeriod();
+
@DefaultStringValue("Expand:")
String expand();
private void initPeriodBox() {
periodBox = new ListBox();
periodBox.setStyleName("small");
- periodBox.addItem(I18nConstants.INSTANCE.noFilters());
+ periodBox.addItem(I18nConstants.INSTANCE.addedPeriod());
initPeriod(1);
initPeriod(2);
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);
}
}
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
label=period_label(snapshot, index)
if label
selected=(params[:period]==index.to_s ? 'selected' : '')
- "<option value='#{index}' #{selected}>#{label}</option>"
+ "<option value='#{index}' #{selected}>Δ #{label}</option>"
else
nil
end
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' : '')
def period_name(property)
if property=='previous_analysis'
- "Compare to previous analysis"
+ "Δ since previous analysis"
elsif property =~ /^[\d]+(\.[\d]+){0,1}$/
# is integer
- "Compare to #{property} days ago"
+ "Δ over #{property} days"
elsif property =~ /\d{4}-\d{2}-\d{2}/
- "Compare to #{property}"
+ "Δ since #{property}"
elsif !property.blank?
- "Compare to version #{property}"
+ "Δ since version #{property}"
else
nil
end
-
<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) -%>
</td>
</tr>
<% end %>
- <% if rule_measures.empty? %>
+
+ <% if rule_index==0 %>
<tr class="even"><td>No violations</td></tr>
<% end %>
</table>
<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 %>