<% @hours.collect {|h| h[criterias[level]]}.uniq.each do |value| %> <% hours_for_value = select_hours(hours, criterias[level], value) -%> <% next if hours_for_value.empty? -%> <%= '' * level %> <%= value.nil? ? l(:label_none) : @available_criterias[criterias[level]][:klass].find_by_id(value) %> <%= '' * (criterias.length - level - 1) -%> <% @periods.each do |period| -%> <% sum = sum_hours(select_hours(hours_for_value, @columns, period.to_s)) %> <%= html_hours("%.2f" % sum) if sum > 0 %> <% end -%> <% if criterias.length > level+1 -%> <%= render(:partial => 'report_criteria', :locals => {:criterias => criterias, :hours => hours_for_value, :level => (level + 1)}) %> <% end -%> <% end %>