annotate .svn/pristine/e9/e907a83f032fcb91aee4dcf2f7e14ae7c9fab77a.svn-base @ 1519:afce8026aaeb redmine-2.4-integration

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