_report_criteria.rhtml
19 lines
| 926 B
| text/html+ruby
|
RhtmlLexer
|
r1325 | <% @hours.collect {|h| h[criterias[level]].to_s}.uniq.each do |value| %> | ||
|
r1162 | <% hours_for_value = select_hours(hours, criterias[level], value) -%> | ||
<% next if hours_for_value.empty? -%> | ||||
<tr class="<%= cycle('odd', 'even') %> <%= 'last-level' unless criterias.length > level+1 %>"> | ||||
|
r569 | <%= '<td></td>' * level %> | ||
|
r1489 | <td><%= h(format_criteria_value(criterias[level], value)) %></td> | ||
|
r1162 | <%= '<td></td>' * (criterias.length - level - 1) -%> | ||
|
r1311 | <% total = 0 -%> | ||
|
r1162 | <% @periods.each do |period| -%> | ||
|
r1311 | <% sum = sum_hours(select_hours(hours_for_value, @columns, period.to_s)); total += sum -%> | ||
|
r1162 | <td class="hours"><%= html_hours("%.2f" % sum) if sum > 0 %></td> | ||
<% end -%> | ||||
|
r1311 | <td class="hours"><%= html_hours("%.2f" % total) if total > 0 %></td> | ||
|
r569 | </tr> | ||
|
r1162 | <% if criterias.length > level+1 -%> | ||
|
r569 | <%= render(:partial => 'report_criteria', :locals => {:criterias => criterias, :hours => hours_for_value, :level => (level + 1)}) %> | ||
|
r1162 | <% end -%> | ||
|
r569 | |||
<% end %> | ||||