##// END OF EJS Templates
Adds a link to /time_entries/new from My Page Spent Time block (#17955)....
Jean-Philippe Lang -
r13059:efdf2584b68b
parent child
Show More
@@ -1,52 +1,58
1 1 <h3>
2 2 <%= link_to l(:label_spent_time), time_entries_path(:user_id => 'me') %>
3 3 (<%= l(:label_last_n_days, 7) %>)
4 4 </h3>
5 5 <%
6 6 entries = timelog_items
7 7 entries_by_day = entries.group_by(&:spent_on)
8 8 %>
9 9
10 <% if User.current.allowed_to?(:log_time, nil, :global => true) %>
11 <div class="contextual">
12 <%= link_to l(:button_log_time), new_time_entry_path, :class => "icon icon-add" %>
13 </div>
14 <% end %>
15
10 16 <div class="total-hours">
11 17 <p><%= l(:label_total_time) %>: <%= html_hours("%.2f" % entries.sum(&:hours).to_f) %></p>
12 18 </div>
13 19
14 20 <% if entries.any? %>
15 21 <table class="list time-entries">
16 22 <thead><tr>
17 23 <th><%= l(:label_activity) %></th>
18 24 <th><%= l(:label_project) %></th>
19 25 <th><%= l(:field_comments) %></th>
20 26 <th><%= l(:field_hours) %></th>
21 27 <th></th>
22 28 </tr></thead>
23 29 <tbody>
24 30 <% entries_by_day.keys.sort.reverse.each do |day| %>
25 31 <tr class="odd">
26 32 <td><strong><%= day == Date.today ? l(:label_today).titleize : format_date(day) %></strong></td>
27 33 <td colspan="2"></td>
28 34 <td class="hours"><em><%= html_hours("%.2f" % entries_by_day[day].sum(&:hours).to_f) %></em></td>
29 35 <td></td>
30 36 </tr>
31 37 <% entries_by_day[day].each do |entry| -%>
32 38 <tr class="time-entry" style="border-bottom: 1px solid #f5f5f5;">
33 39 <td class="activity"><%=h entry.activity %></td>
34 40 <td class="subject"><%=h entry.project %> <%= h(' - ') + link_to_issue(entry.issue, :truncate => 50) if entry.issue %></td>
35 41 <td class="comments"><%=h entry.comments %></td>
36 42 <td class="hours"><%= html_hours("%.2f" % entry.hours) %></td>
37 43 <td class="buttons">
38 44 <% if entry.editable_by?(@user) -%>
39 45 <%= link_to image_tag('edit.png'), {:controller => 'timelog', :action => 'edit', :id => entry},
40 46 :title => l(:button_edit) %>
41 47 <%= link_to image_tag('delete.png'), {:controller => 'timelog', :action => 'destroy', :id => entry},
42 48 :data => {:confirm => l(:text_are_you_sure)},
43 49 :method => :delete,
44 50 :title => l(:button_delete) %>
45 51 <% end -%>
46 52 </td>
47 53 </tr>
48 54 <% end -%>
49 55 <% end -%>
50 56 </tbody>
51 57 </table>
52 58 <% end %>
General Comments 0
You need to be logged in to leave comments. Login now