summaryrefslogtreecommitdiffstats
path: root/app/views/timelog/_report_criteria.rhtml
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/timelog/_report_criteria.rhtml')
-rw-r--r--app/views/timelog/_report_criteria.rhtml17
1 files changed, 17 insertions, 0 deletions
diff --git a/app/views/timelog/_report_criteria.rhtml b/app/views/timelog/_report_criteria.rhtml
new file mode 100644
index 000000000..e4f5fa39a
--- /dev/null
+++ b/app/views/timelog/_report_criteria.rhtml
@@ -0,0 +1,17 @@
+<% @available_criterias[criterias[level]][:values].each do |value| %>
+<tr class="<%= cycle('odd', 'even') if criterias.length < level + 2 %>">
+<%= '<td></td>' * level %>
+<td><%= value.name %></td>
+<%= '<td></td>' * (criterias.length - level - 1) %>
+<% hours_for_value = select_hours(hours, criterias[level], value.id) %>
+ <% @periods.each do |period| %>
+ <% sum = sum_hours(select_hours(hours_for_value, @columns, period.to_s)) %>
+ <td align="center"><%= sum > 0 ? sum : "-" %></td>
+ <% end %>
+</tr>
+<% if criterias.length > level+1 %>
+ <%= render(:partial => 'report_criteria', :locals => {:criterias => criterias, :hours => hours_for_value, :level => (level + 1)}) %>
+<% end %>
+
+<% end %>
+<% reset_cycle %>