chris@37:
<%= l(:label_details) %>: <%= select_tag 'columns', options_for_select([[l(:label_year), 'year'], chris@37: [l(:label_month), 'month'], chris@37: [l(:label_week), 'week'], chris@37: [l(:label_day_plural).titleize, 'day']], @columns), chris@37: :onchange => "this.form.onsubmit();" %> chris@37: chris@37: <%= l(:button_add) %>: <%= select_tag('criterias[]', options_for_select([[]] + (@available_criterias.keys - @criterias).collect{|k| [l_or_humanize(@available_criterias[k][:label]), k]}), chris@37: :onchange => "this.form.onsubmit();", chris@37: :style => 'width: 200px', chris@37: :id => nil, chris@37: :disabled => (@criterias.length >= 3)) %> chris@37: <%= link_to_remote l(:button_clear), {:url => {:project_id => @project, :period_type => params[:period_type], :period => params[:period], :from => @from, :to => @to, :columns => @columns}, chris@37: :method => :get, chris@37: :update => 'content' chris@37: }, :class => 'icon icon-reload' %>
chris@37: <% end %> chris@37: chris@37: <% unless @criterias.empty? %> chris@37:<%= l(:label_total) %>: <%= html_hours(l_hours(@total_hours)) %>
chris@37:<%= l_or_humanize(@available_criterias[criteria][:label]) %> | chris@37: <% end %> chris@37: <% columns_width = (40 / (@periods.length+1)).to_i %> chris@37: <% @periods.each do |period| %> chris@37:<%= period %> | chris@37: <% end %> chris@37:<%= l(:label_total) %> | chris@37:|
---|---|---|---|
<%= l(:label_total) %> | chris@37: <%= '' * (@criterias.size - 1) %> chris@37: <% total = 0 -%> chris@37: <% @periods.each do |period| -%> chris@37: <% sum = sum_hours(select_hours(@hours, @columns, period.to_s)); total += sum -%> chris@37: | <%= html_hours("%.2f" % sum) if sum > 0 %> | chris@37: <% end -%> chris@37:<%= html_hours("%.2f" % total) if total > 0 %> | chris@37: