##// END OF EJS Templates
[#9489] linked labels to their elements...
Toshi MARUYAMA -
r7571:b8637aaf76d2
parent child
Show More
@@ -1,70 +1,70
1 1 <div class="contextual">
2 2 <%= link_to_if_authorized l(:button_log_time), {:controller => 'timelog', :action => 'new', :project_id => @project, :issue_id => @issue}, :class => 'icon icon-time-add' %>
3 3 </div>
4 4
5 5 <%= render_timelog_breadcrumb %>
6 6
7 7 <h2><%= l(:label_spent_time) %></h2>
8 8
9 9 <% form_tag({:controller => 'time_entry_reports', :action => 'report', :project_id => @project, :issue_id => @issue}, :method => :get, :id => 'query_form') do %>
10 10 <% @criterias.each do |criteria| %>
11 11 <%= hidden_field_tag 'criterias[]', criteria, :id => nil %>
12 12 <% end %>
13 13 <%= render :partial => 'timelog/date_range' %>
14 14
15 <p><%= l(:label_details) %>: <%= select_tag 'columns', options_for_select([[l(:label_year), 'year'],
15 <p><label for='columns'><%= l(:label_details) %></label>: <%= select_tag 'columns', options_for_select([[l(:label_year), 'year'],
16 16 [l(:label_month), 'month'],
17 17 [l(:label_week), 'week'],
18 18 [l(:label_day_plural).titleize, 'day']], @columns),
19 19 :onchange => "this.form.onsubmit();" %>
20 20
21 <%= l(:button_add) %>: <%= select_tag('criterias[]', options_for_select([[]] + (@available_criterias.keys - @criterias).collect{|k| [l_or_humanize(@available_criterias[k][:label]), k]}),
21 <label for='criterias'><%= l(:button_add) %></label>: <%= select_tag('criterias[]', options_for_select([[]] + (@available_criterias.keys - @criterias).collect{|k| [l_or_humanize(@available_criterias[k][:label]), k]}),
22 22 :onchange => "this.form.submit();",
23 23 :style => 'width: 200px',
24 24 :id => nil,
25 :disabled => (@criterias.length >= 3)) %>
25 :disabled => (@criterias.length >= 3), :id => "criterias") %>
26 26 <%= link_to l(:button_clear), {:project_id => @project, :issue_id => @issue, :period_type => params[:period_type], :period => params[:period], :from => @from, :to => @to, :columns => @columns}, :class => 'icon icon-reload' %></p>
27 27 <% end %>
28 28
29 29 <% unless @criterias.empty? %>
30 30 <div class="total-hours">
31 31 <p><%= l(:label_total) %>: <%= html_hours(l_hours(@total_hours)) %></p>
32 32 </div>
33 33
34 34 <% unless @hours.empty? %>
35 35 <table class="list" id="time-report">
36 36 <thead>
37 37 <tr>
38 38 <% @criterias.each do |criteria| %>
39 39 <th><%= l_or_humanize(@available_criterias[criteria][:label]) %></th>
40 40 <% end %>
41 41 <% columns_width = (40 / (@periods.length+1)).to_i %>
42 42 <% @periods.each do |period| %>
43 43 <th class="period" width="<%= columns_width %>%"><%= period %></th>
44 44 <% end %>
45 45 <th class="total" width="<%= columns_width %>%"><%= l(:label_total) %></th>
46 46 </tr>
47 47 </thead>
48 48 <tbody>
49 49 <%= render :partial => 'report_criteria', :locals => {:criterias => @criterias, :hours => @hours, :level => 0} %>
50 50 <tr class="total">
51 51 <td><%= l(:label_total) %></td>
52 52 <%= '<td></td>' * (@criterias.size - 1) %>
53 53 <% total = 0 -%>
54 54 <% @periods.each do |period| -%>
55 55 <% sum = sum_hours(select_hours(@hours, @columns, period.to_s)); total += sum -%>
56 56 <td class="hours"><%= html_hours("%.2f" % sum) if sum > 0 %></td>
57 57 <% end -%>
58 58 <td class="hours"><%= html_hours("%.2f" % total) if total > 0 %></td>
59 59 </tr>
60 60 </tbody>
61 61 </table>
62 62
63 63 <% other_formats_links do |f| %>
64 64 <%= f.link_to 'CSV', :url => params %>
65 65 <% end %>
66 66 <% end %>
67 67 <% end %>
68 68
69 69 <% html_title l(:label_spent_time), l(:label_report) %>
70 70
General Comments 0
You need to be logged in to leave comments. Login now