_report_criteria.rhtml
17 lines
| 860 B
| text/html+ruby
|
RhtmlLexer
|
r1162 | <% @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? -%> | ||||
<tr class="<%= cycle('odd', 'even') %> <%= 'last-level' unless criterias.length > level+1 %>"> | ||||
|
r569 | <%= '<td></td>' * level %> | ||
|
r1162 | <td><%= value.nil? ? l(:label_none) : @available_criterias[criterias[level]][:klass].find_by_id(value) %></td> | ||
<%= '<td></td>' * (criterias.length - level - 1) -%> | ||||
<% @periods.each do |period| -%> | ||||
|
r569 | <% sum = sum_hours(select_hours(hours_for_value, @columns, period.to_s)) %> | ||
|
r1162 | <td class="hours"><%= html_hours("%.2f" % sum) if sum > 0 %></td> | ||
<% end -%> | ||||
|
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 %> | ||||