[Cost Report] Added edit and delete links to entries in filter view

git-svn-id: https://dev.finn.de/svn/cockpit/trunk@263 7926756e-e54e-46e6-9721-ed318f58905e
pull/6827/head
hjust 15 years ago
parent 93086d20a7
commit b087710d31
  1. 22
      app/views/cost_reports/_list_items.rhtml

@ -12,6 +12,7 @@
<%= sort_header_tag("entry__spent_on", :caption => l(:caption_spent), :default_order => 'desc') %>
<%= sort_header_tag("entry__user_id", :caption => l(:label_user), :default_order => 'asc') %>
<%= sort_header_tag("entry__costs", :caption => l(:caption_costs), :default_order => 'asc') %>
<th></th>
</tr></thead>
<tbody>
<% @entries.each do |entry| %>
@ -30,6 +31,27 @@
<td><%= format_date entry.spent_on %></td>
<td><%= link_to_user entry.user %></td>
<td class="currency"><%= number_to_currency(entry.real_costs) %></td>
<td style="width: 40px">
<% if entry.is_a? TimeEntry %>
<% if entry.editable_by?(User.current) -%>
<%= link_to image_tag('edit.png'), {:controller => 'timelog', :action => 'edit', :id => entry, :project_id => nil},
:title => l(:button_edit) %>
<%= link_to image_tag('delete.png'), {:controller => 'timelog', :action => 'destroy', :id => entry, :project_id => nil},
:confirm => l(:text_are_you_sure),
:method => :post,
:title => l(:button_delete) %>
<% end -%>
<% else %>
<% if entry.editable_by?(User.current) -%>
<%= link_to image_tag('edit.png'), {:controller => 'costlog', :action => 'edit', :id => entry, :project_id => nil},
:title => l(:button_edit) %>
<%= link_to image_tag('delete.png'), {:controller => 'costlog', :action => 'destroy', :id => entry, :project_id => nil},
:confirm => l(:text_are_you_sure),
:method => :post,
:title => l(:button_delete) %>
<% end -%>
<% end %>
</td>
</tr>
<% end %>
</tbody>

Loading…
Cancel
Save