annotate .svn/pristine/d3/d3e27074b1c8e68e7fc9b011232521222829c722.svn-base @ 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 <div class="contextual">
Chris@1464 2 <%= link_to_if_authorized l(:button_log_time), {:controller => 'timelog', :action => 'new', :project_id => @project, :issue_id => @issue}, :class => 'icon icon-time-add' %>
Chris@1464 3 </div>
Chris@1464 4
Chris@1464 5 <%= render_timelog_breadcrumb %>
Chris@1464 6
Chris@1464 7 <h2><%= l(:label_spent_time) %></h2>
Chris@1464 8
Chris@1464 9 <%= form_tag({:controller => 'timelog', :action => 'report',
Chris@1464 10 :project_id => @project, :issue_id => @issue},
Chris@1464 11 :method => :get, :id => 'query_form') do %>
Chris@1464 12 <% @report.criteria.each do |criterion| %>
Chris@1464 13 <%= hidden_field_tag 'criteria[]', criterion, :id => nil %>
Chris@1464 14 <% end %>
Chris@1464 15 <%= render :partial => 'timelog/date_range' %>
Chris@1464 16
Chris@1464 17 <p><label for='columns'><%= l(:label_details) %></label>: <%= select_tag 'columns', options_for_select([[l(:label_year), 'year'],
Chris@1464 18 [l(:label_month), 'month'],
Chris@1464 19 [l(:label_week), 'week'],
Chris@1464 20 [l(:label_day_plural).titleize, 'day']], @report.columns),
Chris@1464 21 :onchange => "this.form.submit();" %>
Chris@1464 22
Chris@1464 23 <label for='criterias'><%= l(:button_add) %></label>: <%= select_tag('criteria[]', options_for_select([[]] + (@report.available_criteria.keys - @report.criteria).collect{|k| [l_or_humanize(@report.available_criteria[k][:label]), k]}),
Chris@1464 24 :onchange => "this.form.submit();",
Chris@1464 25 :style => 'width: 200px',
Chris@1464 26 :id => nil,
Chris@1464 27 :disabled => (@report.criteria.length >= 3), :id => "criterias") %>
Chris@1464 28 <%= link_to l(:button_clear), {:project_id => @project, :issue_id => @issue, :period_type => params[:period_type], :period => params[:period], :from => @from, :to => @to, :columns => @report.columns}, :class => 'icon icon-reload' %></p>
Chris@1464 29 <% end %>
Chris@1464 30
Chris@1464 31 <% unless @report.criteria.empty? %>
Chris@1464 32 <div class="total-hours">
Chris@1464 33 <p><%= l(:label_total_time) %>: <%= html_hours(l_hours(@report.total_hours)) %></p>
Chris@1464 34 </div>
Chris@1464 35
Chris@1464 36 <% unless @report.hours.empty? %>
Chris@1464 37 <div class="autoscroll">
Chris@1464 38 <table class="list" id="time-report">
Chris@1464 39 <thead>
Chris@1464 40 <tr>
Chris@1464 41 <% @report.criteria.each do |criteria| %>
Chris@1464 42 <th><%= l_or_humanize(@report.available_criteria[criteria][:label]) %></th>
Chris@1464 43 <% end %>
Chris@1464 44 <% columns_width = (40 / (@report.periods.length+1)).to_i %>
Chris@1464 45 <% @report.periods.each do |period| %>
Chris@1464 46 <th class="period" style="width:<%= columns_width %>%;"><%= period %></th>
Chris@1464 47 <% end %>
Chris@1464 48 <th class="total" style="width:<%= columns_width %>%;"><%= l(:label_total_time) %></th>
Chris@1464 49 </tr>
Chris@1464 50 </thead>
Chris@1464 51 <tbody>
Chris@1464 52 <%= render :partial => 'report_criteria', :locals => {:criterias => @report.criteria, :hours => @report.hours, :level => 0} %>
Chris@1464 53 <tr class="total">
Chris@1464 54 <td><%= l(:label_total_time) %></td>
Chris@1464 55 <%= ('<td></td>' * (@report.criteria.size - 1)).html_safe %>
Chris@1464 56 <% total = 0 -%>
Chris@1464 57 <% @report.periods.each do |period| -%>
Chris@1464 58 <% sum = sum_hours(select_hours(@report.hours, @report.columns, period.to_s)); total += sum -%>
Chris@1464 59 <td class="hours"><%= html_hours("%.2f" % sum) if sum > 0 %></td>
Chris@1464 60 <% end -%>
Chris@1464 61 <td class="hours"><%= html_hours("%.2f" % total) if total > 0 %></td>
Chris@1464 62 </tr>
Chris@1464 63 </tbody>
Chris@1464 64 </table>
Chris@1464 65 </div>
Chris@1464 66
Chris@1464 67 <% other_formats_links do |f| %>
Chris@1464 68 <%= f.link_to 'CSV', :url => params %>
Chris@1464 69 <% end %>
Chris@1464 70 <% end %>
Chris@1464 71 <% end %>
Chris@1464 72
Chris@1464 73 <% html_title l(:label_spent_time), l(:label_report) %>
Chris@1464 74