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

36 lines
1.4 KiB

<% list = [:project_id, :issue_id, :spent_on, :user_id, :activity_id] %>
<table class="list report">
<thead>
<% list.each do |field| %><th><%= label_for(field) %></th><% end %>
<th><%= @cost_type.try(:unit_plural) || l(:units) %></th>
<th><%= l(:field_costs) %></th>
<th></th>
</thead>
<tfoot>
<th class="result right" colspan='<%= list.size + 2 %>'><%= show_result @query %></th>
<th></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="units"><%= show_result(result, result.fields['cost_type_id'].to_i) %></td>
<td class="currency"><%= show_result(result) %></td>
<td style="width: 40px">
<%= link_to image_tag('edit.png'), action_for(result, :action => 'edit'), :title => l(:button_edit) %>
<%= link_to image_tag('delete.png'), action_for(result, :action => 'destroy'),
:title => l(:button_edit), :confirm => l(:text_are_you_sure),
:method => :post, :title => l(:button_delete) %>
</td>
</tr>
<% if params[:debug] %>
<tr>
<td colspan='<%= list.size + 3 %>'>
<%= result.fields.reject {|k,v| list.include? k.to_sym }.inspect %>
</td>
</tr>
<% end %>
<% end %>
</tbody>
</table>