annotate .svn/pristine/bf/bf27e7a4eaace3c336ad2614552c89b7687ffee1.svn-base @ 1295:622f24f53b42 redmine-2.3

Update to Redmine SVN revision 11972 on 2.3-stable branch
author Chris Cannam
date Fri, 14 Jun 2013 09:02:21 +0100
parents
children
rev   line source
Chris@1295 1 <h3><%=l(:label_spent_time)%> (<%= l(:label_last_n_days, 7) %>)</h3>
Chris@1295 2 <%
Chris@1295 3 entries = timelog_items
Chris@1295 4 entries_by_day = entries.group_by(&:spent_on)
Chris@1295 5 %>
Chris@1295 6
Chris@1295 7 <div class="total-hours">
Chris@1295 8 <p><%= l(:label_total_time) %>: <%= html_hours("%.2f" % entries.sum(&:hours).to_f) %></p>
Chris@1295 9 </div>
Chris@1295 10
Chris@1295 11 <% if entries.any? %>
Chris@1295 12 <table class="list time-entries">
Chris@1295 13 <thead><tr>
Chris@1295 14 <th><%= l(:label_activity) %></th>
Chris@1295 15 <th><%= l(:label_project) %></th>
Chris@1295 16 <th><%= l(:field_comments) %></th>
Chris@1295 17 <th><%= l(:field_hours) %></th>
Chris@1295 18 <th></th>
Chris@1295 19 </tr></thead>
Chris@1295 20 <tbody>
Chris@1295 21 <% entries_by_day.keys.sort.reverse.each do |day| %>
Chris@1295 22 <tr class="odd">
Chris@1295 23 <td><strong><%= day == Date.today ? l(:label_today).titleize : format_date(day) %></strong></td>
Chris@1295 24 <td colspan="2"></td>
Chris@1295 25 <td class="hours"><em><%= html_hours("%.2f" % entries_by_day[day].sum(&:hours).to_f) %></em></td>
Chris@1295 26 <td></td>
Chris@1295 27 </tr>
Chris@1295 28 <% entries_by_day[day].each do |entry| -%>
Chris@1295 29 <tr class="time-entry" style="border-bottom: 1px solid #f5f5f5;">
Chris@1295 30 <td class="activity"><%=h entry.activity %></td>
Chris@1295 31 <td class="subject"><%=h entry.project %> <%= h(' - ') + link_to_issue(entry.issue, :truncate => 50) if entry.issue %></td>
Chris@1295 32 <td class="comments"><%=h entry.comments %></td>
Chris@1295 33 <td class="hours"><%= html_hours("%.2f" % entry.hours) %></td>
Chris@1295 34 <td align="center">
Chris@1295 35 <% if entry.editable_by?(@user) -%>
Chris@1295 36 <%= link_to image_tag('edit.png'), {:controller => 'timelog', :action => 'edit', :id => entry},
Chris@1295 37 :title => l(:button_edit) %>
Chris@1295 38 <%= link_to image_tag('delete.png'), {:controller => 'timelog', :action => 'destroy', :id => entry},
Chris@1295 39 :data => {:confirm => l(:text_are_you_sure)},
Chris@1295 40 :method => :delete,
Chris@1295 41 :title => l(:button_delete) %>
Chris@1295 42 <% end -%>
Chris@1295 43 </td>
Chris@1295 44 </tr>
Chris@1295 45 <% end -%>
Chris@1295 46 <% end -%>
Chris@1295 47 </tbody>
Chris@1295 48 </table>
Chris@1295 49 <% end %>