##// END OF EJS Templates
replace tabs to spaces at app/views/my/blocks/_timelog.html.erb...
Toshi MARUYAMA -
r7207:aff6fe1f7a83
parent child
Show More
@@ -1,52 +1,52
1 1 <h3><%=l(:label_spent_time)%> (<%= l(:label_last_n_days, 7) %>)</h3>
2 2 <%
3 3 entries = TimeEntry.find(:all,
4 :conditions => ["#{TimeEntry.table_name}.user_id = ? AND #{TimeEntry.table_name}.spent_on BETWEEN ? AND ?", @user.id, Date.today - 6, Date.today],
5 :include => [:activity, :project, {:issue => [:tracker, :status]}],
6 :order => "#{TimeEntry.table_name}.spent_on DESC, #{Project.table_name}.name ASC, #{Tracker.table_name}.position ASC, #{Issue.table_name}.id ASC")
4 :conditions => ["#{TimeEntry.table_name}.user_id = ? AND #{TimeEntry.table_name}.spent_on BETWEEN ? AND ?", @user.id, Date.today - 6, Date.today],
5 :include => [:activity, :project, {:issue => [:tracker, :status]}],
6 :order => "#{TimeEntry.table_name}.spent_on DESC, #{Project.table_name}.name ASC, #{Tracker.table_name}.position ASC, #{Issue.table_name}.id ASC")
7 7 entries_by_day = entries.group_by(&:spent_on)
8 8 %>
9 9
10 10 <div class="total-hours">
11 11 <p><%= l(:label_total) %>: <%= html_hours("%.2f" % entries.sum(&:hours).to_f) %></p>
12 12 </div>
13 13
14 14 <% if entries.any? %>
15 15 <table class="list time-entries">
16 16 <thead><tr>
17 17 <th><%= l(:label_activity) %></th>
18 18 <th><%= l(:label_project) %></th>
19 19 <th><%= l(:field_comments) %></th>
20 20 <th><%= l(:field_hours) %></th>
21 21 <th></th>
22 22 </tr></thead>
23 23 <tbody>
24 24 <% entries_by_day.keys.sort.reverse.each do |day| %>
25 25 <tr class="odd">
26 26 <td><strong><%= day == Date.today ? l(:label_today).titleize : format_date(day) %></strong></td>
27 27 <td colspan="2"></td>
28 28 <td class="hours"><em><%= html_hours("%.2f" % entries_by_day[day].sum(&:hours).to_f) %></em></td>
29 29 <td></td>
30 30 </tr>
31 31 <% entries_by_day[day].each do |entry| -%>
32 32 <tr class="time-entry" style="border-bottom: 1px solid #f5f5f5;">
33 33 <td class="activity"><%=h entry.activity %></td>
34 34 <td class="subject"><%=h entry.project %> <%= ' - ' + link_to_issue(entry.issue, :truncate => 50) if entry.issue %></td>
35 35 <td class="comments"><%=h entry.comments %></td>
36 36 <td class="hours"><%= html_hours("%.2f" % entry.hours) %></td>
37 37 <td align="center">
38 38 <% if entry.editable_by?(@user) -%>
39 39 <%= link_to image_tag('edit.png'), {:controller => 'timelog', :action => 'edit', :id => entry},
40 40 :title => l(:button_edit) %>
41 41 <%= link_to image_tag('delete.png'), {:controller => 'timelog', :action => 'destroy', :id => entry},
42 42 :confirm => l(:text_are_you_sure),
43 43 :method => :delete,
44 44 :title => l(:button_delete) %>
45 45 <% end -%>
46 46 </td>
47 47 </tr>
48 48 <% end -%>
49 49 <% end -%>
50 50 </tbody>
51 51 </table>
52 52 <% end %>
General Comments 0
You need to be logged in to leave comments. Login now