options[:period]=@period
end
+ if params[:committer]
+ @committer=params[:committer]
+ options[:committer]=@committer
+ end
+
# load data
@drilldown = Drilldown.new(@project, @metric, selected_rids, options)
@snapshot = @drilldown.snapshot
conditions += ' AND project_measures.characteristic_id IS NULL'
end
- conditions += ' AND project_measures.committer IS NULL'
+ if options[:committer]
+ conditions += ' AND project_measures.committer=:committer'
+ condition_values[:committer]=options[:committer]
+ else
+ conditions += ' AND project_measures.committer IS NULL'
+ end
@measures=ProjectMeasure.find(:all,
:select => "project_measures.id,project_measures.metric_id,project_measures.#{value_column},project_measures.text_value,project_measures.alert_status,project_measures.alert_text,project_measures.snapshot_id",
has_many :measures, :class_name => 'ProjectMeasure', :conditions => 'rule_id IS NULL AND characteristic_id IS NULL AND committer IS NULL'
has_many :rulemeasures, :class_name => 'ProjectMeasure', :conditions => 'rule_id IS NOT NULL AND characteristic_id IS NULL AND committer IS NULL', :include => 'rule'
has_many :characteristic_measures, :class_name => 'ProjectMeasure', :conditions => 'rule_id IS NULL AND characteristic_id IS NOT NULL AND committer IS NULL'
+ has_many :committer_measures, :class_name => 'ProjectMeasure', :conditions => 'rule_id IS NULL AND characteristic_id IS NULL AND committer IS NOT NULL'
has_many :events, :dependent => :destroy, :order => 'event_date DESC'
has_one :source, :class_name => 'SnapshotSource', :dependent => :destroy
metric ? measures_hash[metric.id] : nil
end
+ def committer_measure(metric, committer)
+ committer_measures.each do |m|
+ return m if m.metric_id==metric.id && m.committer==committer
+ end
+ nil
+ end
+
def characteristic_measure(metric, characteristic)
characteristic_measures.each do |m|
return m if m.metric_id==metric.id && m.characteristic==characteristic
<% end %>
<div class="dashbox">
- <% if @characteristic %>
+ <% if @committer %>
+ <h3><%= @highlighted_metric.short_name -%> / <%= h(@committer) -%></h3>
+
+ <p class="big">
+ <%= format_measure(@snapshot.committer_measure(@highlighted_metric, @committer), :period => @period) %>
+ </p>
+ <% elsif @characteristic %>
<h3><%= @highlighted_metric.short_name -%> / <%= h(@characteristic.name(true)) -%></h3>
<p class="big"><%= format_measure(@snapshot.characteristic_measure(@highlighted_metric, @characteristic)) %></p>
<% if @highlighted_metric!=@metric %>
<tr>
<td colspan="<%= @drilldown.columns.size -%>"><%= message('drilldown.drilldown_on') -%>
- <b><%= format_measure(@metric.key, :period => @period) -%> <%= @metric.short_name -%></b></td>
+ <% if @committer %>
+ <b><%= format_measure(@snapshot.committer_measure(@metric, @committer), :period => @period) -%> <%= @metric.short_name -%></b>
+ <% else %>
+ <b><%= format_measure(@metric.key, :period => @period) -%> <%= @metric.short_name -%></b>
+ <% end %>
+ </td>
</tr>
<tr>
<% end