OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openproject/app/views/cost_reports/_cost_entry_table.rhtml

26 lines
899 B

<% list = [:project_id, :issue_id, :units, :cost_type_id, :spent_on, :user_id, :activity_id] %>
<table class="list">
<thead>
<% list.each do |field| %><th><%= label_for(field) %></th><% end %>
<th><%= @cost_type.try(:unit_plural) || l(:field_costs) %></th>
</thead>
<tfoot>
<th colspan='<%= list.size + 1 %>'><%= show_result @query %></th>
</tfoot>
<tbody>
<% @query.each_direct_result do |result| %>
<tr class='<%= cycle("odd", "even") %>'>
<% list.each do |field| %><td><%= show_field field, result.fields[field.to_s] %></td><% end %>
<td class="currency"><%= show_result(result) %></td>
</tr>
<% if params[:debug] %>
<tr>
<td colspan='<%= list.size + 1 %>'>
<%= result.fields.reject {|k,v| list.include? k.to_sym }.inspect %>
</td>
</tr>
<% end %>
<% end %>
</tbody>
</table>