annotate app/views/my/blocks/_timelog.html.erb @ 1298:4f746d8966dd redmine_2.3_integration

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