annotate app/views/my/blocks/_timelog.html.erb @ 1524:82fac3dcf466 redmine-2.5-integration

Fix failure to interpret Javascript when autocompleting members for project
author Chris Cannam <chris.cannam@soundsoftware.ac.uk>
date Thu, 11 Sep 2014 10:24:38 +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@909 5 <%
Chris@1464 6 entries = timelog_items
Chris@0 7 entries_by_day = entries.group_by(&:spent_on)
Chris@0 8 %>
Chris@0 9
Chris@0 10 <div class="total-hours">
Chris@1464 11 <p><%= l(:label_total_time) %>: <%= html_hours("%.2f" % entries.sum(&:hours).to_f) %></p>
Chris@0 12 </div>
Chris@0 13
Chris@0 14 <% if entries.any? %>
Chris@0 15 <table class="list time-entries">
Chris@0 16 <thead><tr>
Chris@0 17 <th><%= l(:label_activity) %></th>
Chris@0 18 <th><%= l(:label_project) %></th>
Chris@0 19 <th><%= l(:field_comments) %></th>
Chris@0 20 <th><%= l(:field_hours) %></th>
Chris@0 21 <th></th>
Chris@0 22 </tr></thead>
Chris@0 23 <tbody>
Chris@0 24 <% entries_by_day.keys.sort.reverse.each do |day| %>
Chris@0 25 <tr class="odd">
Chris@0 26 <td><strong><%= day == Date.today ? l(:label_today).titleize : format_date(day) %></strong></td>
Chris@0 27 <td colspan="2"></td>
Chris@0 28 <td class="hours"><em><%= html_hours("%.2f" % entries_by_day[day].sum(&:hours).to_f) %></em></td>
Chris@0 29 <td></td>
Chris@0 30 </tr>
Chris@0 31 <% entries_by_day[day].each do |entry| -%>
Chris@0 32 <tr class="time-entry" style="border-bottom: 1px solid #f5f5f5;">
Chris@0 33 <td class="activity"><%=h entry.activity %></td>
Chris@1115 34 <td class="subject"><%=h entry.project %> <%= h(' - ') + link_to_issue(entry.issue, :truncate => 50) if entry.issue %></td>
Chris@0 35 <td class="comments"><%=h entry.comments %></td>
Chris@0 36 <td class="hours"><%= html_hours("%.2f" % entry.hours) %></td>
Chris@1464 37 <td class="buttons">
Chris@0 38 <% if entry.editable_by?(@user) -%>
Chris@0 39 <%= link_to image_tag('edit.png'), {:controller => 'timelog', :action => 'edit', :id => entry},
Chris@0 40 :title => l(:button_edit) %>
Chris@0 41 <%= link_to image_tag('delete.png'), {:controller => 'timelog', :action => 'destroy', :id => entry},
Chris@1115 42 :data => {:confirm => l(:text_are_you_sure)},
chris@37 43 :method => :delete,
Chris@0 44 :title => l(:button_delete) %>
Chris@0 45 <% end -%>
Chris@0 46 </td>
Chris@0 47 </tr>
Chris@0 48 <% end -%>
Chris@0 49 <% end -%>
Chris@0 50 </tbody>
Chris@0 51 </table>
Chris@0 52 <% end %>