@DefaultStringValue("No filters")
String noFilters();
- @DefaultStringValue("Added...")
+ @DefaultStringValue("Time changes...")
String addedPeriod();
@DefaultStringValue("Expand:")
# === Optional parameters
# * color: true|false. Default is true.
# * index: integer between 1 and 5. By default the index is defined by the dashboard variation select-box
+ # * style: light|normal. Default is normal (parenthesis + bold)
#
# === Examples
# format_variation('ncloc')
end
end
end
- html="<span class='#{css_class}'>(#{formatted_val})</span>"
+ if options[:style]!='light'
+ formatted_val="<b>(#{formatted_val})</b>"
+ end
+ html="<span class='#{css_class}'>#{formatted_val}</span>"
end
end
html
if mode
if mode=='days'
- label = "Added over %s previous days" % mode_param
+ label = "Added over %s days" % mode_param
elsif mode=='version'
label = "Added since version %s" % mode_param
elsif mode=='previous_analysis'
-
<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="">Variations...</option>
+ <option value="">Time changes...</option>
<%= period_select_options(@snapshot, 1) -%>
<%= period_select_options(@snapshot, 2) -%>
<%= period_select_options(@snapshot, 3) -%>
<td><%= image_tag "priority/#{priority_id}.png" %></td>
<td><%= link_to label, {:controller => 'drilldown', :action => 'violations', :id => @project.id, :priority => Sonar::RulePriority.to_s(priority_id), :period => @period_index} %></td>
<td style="padding-left: 10px;" align="right">
- <%= @period_index ? format_variation(measure, :index => @period_index) : format_measure(measure) -%>
+ <%= @period_index ? format_variation(measure, :index => @period_index, :style => 'light') : format_measure(measure) -%>
</td>
<td align="left">
<% value = measure_or_variation_value(measure) %>
- <%= barchart(:width => 60, :percent => (value ? (100 * value / max).to_i : 0), :color => '#777') if max>0 %>
+ <%= barchart(:width => 60, :percent => (value ? (100 * value / max).to_i : 0), :color => (@period_index ? '#cc0000' : '#777')) if max>0 %>
</td>
</tr>
\ No newline at end of file
<% if @snapshot.project_snapshot.periods? %>
- <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="">All violations</option>
+ <option value="">Time changes...</option>
<%= period_select_options(@snapshot, 1) -%>
<%= period_select_options(@snapshot, 2) -%>
<%= period_select_options(@snapshot, 3) -%>
<%= link_to(rule.name, {:overwrite_params => {:rule => rule.key, :sid => nil, :priority => Sonar::RulePriority.to_s(@priority_id)}}, :title => "#{rule.plugin_name}: #{rule.plugin_rule_key}") %>
</td>
<td class="right" nowrap="nowrap">
- <span><%= @period_index ? format_variation(rule_measure, :index => @period_index) : rule_measure.formatted_value -%></span>
+ <span><%= @period_index ? format_variation(rule_measure, :index => @period_index, :style => 'light') : rule_measure.formatted_value -%></span>
</td>
<td class="left last">
- <%= barchart(:width => 70, :percent => (100 * value / max).to_i, :color => '#777') if max>0 %>
+ <%= barchart(:width => 70, :percent => (100 * value / max).to_i, :color => (@period_index ? '#cc0000' : '#777')) if max>0 %>
<!--[if IE]> <![endif]-->
</td>
</tr>
<% end %>
</td>
<td class="right last" nowrap>
- <%= @period_index ? format_variation(measure, :index => @period_index) : measure.formatted_value -%>
+ <%= @period_index ? format_variation(measure, :index => @period_index, :style => 'light') : measure.formatted_value -%>
<!--[if IE]> <![endif]-->
</td>
</tr>
/* ------------------- VARIATIONS ------------------- */
.var {
- font-weight: bold;
color: #444 !important;
}
.varb {/* better */
- font-weight: bold;
- color: #078C00 !important;
+ color: #078C00 !important;
}
.varw {/* worst */
- font-weight: bold;
color: #cc0000 !important;
}