Chris@1296
|
1 <fieldset id="date-range" class="collapsible">
|
Chris@1296
|
2 <legend onclick="toggleFieldset(this);"><%= l(:label_date_range) %></legend>
|
Chris@1296
|
3 <div>
|
Chris@1296
|
4 <p>
|
Chris@1296
|
5 <%= label_tag "period_type_list", l(:description_date_range_list), :class => "hidden-for-sighted" %>
|
Chris@1296
|
6 <%= radio_button_tag 'period_type', '1', !@free_period, :onclick => '$("#from,#to").attr("disabled", true);$("#period").removeAttr("disabled");', :id => "period_type_list"%>
|
Chris@1296
|
7 <%= select_tag 'period', options_for_period_select(params[:period]),
|
Chris@1296
|
8 :onchange => 'this.form.submit();',
|
Chris@1296
|
9 :onfocus => '$("#period_type_1").attr("checked", true);',
|
Chris@1296
|
10 :disabled => @free_period %>
|
Chris@1296
|
11 </p>
|
Chris@1296
|
12 <p>
|
Chris@1296
|
13 <%= label_tag "period_type_interval", l(:description_date_range_interval), :class => "hidden-for-sighted" %>
|
Chris@1296
|
14 <%= radio_button_tag 'period_type', '2', @free_period, :onclick => '$("#from,#to").removeAttr("disabled");$("#period").attr("disabled", true);', :id => "period_type_interval" %>
|
Chris@1296
|
15 <%= l(:label_date_from_to,
|
Chris@1296
|
16 :start => ((label_tag "from", l(:description_date_from), :class => "hidden-for-sighted") +
|
Chris@1296
|
17 text_field_tag('from', @from, :size => 10, :disabled => !@free_period) + calendar_for('from')),
|
Chris@1296
|
18 :end => ((label_tag "to", l(:description_date_to), :class => "hidden-for-sighted") +
|
Chris@1296
|
19 text_field_tag('to', @to, :size => 10, :disabled => !@free_period) + calendar_for('to'))).html_safe %>
|
Chris@1296
|
20 </p>
|
Chris@1296
|
21 </div>
|
Chris@1296
|
22 </fieldset>
|
Chris@1296
|
23 <p class="buttons">
|
Chris@1296
|
24 <%= link_to_function l(:button_apply), '$("#query_form").submit()', :class => 'icon icon-checked' %>
|
Chris@1296
|
25 <%= link_to l(:button_clear), {:controller => controller_name, :action => action_name, :project_id => @project, :issue_id => @issue}, :class => 'icon icon-reload' %>
|
Chris@1296
|
26 </p>
|
Chris@1296
|
27
|
Chris@1296
|
28 <div class="tabs">
|
Chris@1296
|
29 <% url_params = @free_period ? { :from => @from, :to => @to } : { :period => params[:period] } %>
|
Chris@1296
|
30 <ul>
|
Chris@1296
|
31 <li><%= link_to(l(:label_details), url_params.merge({:controller => 'timelog', :action => 'index', :project_id => @project, :issue_id => @issue }),
|
Chris@1296
|
32 :class => (action_name == 'index' ? 'selected' : nil)) %></li>
|
Chris@1296
|
33 <li><%= link_to(l(:label_report), url_params.merge({:controller => 'timelog', :action => 'report', :project_id => @project, :issue_id => @issue}),
|
Chris@1296
|
34 :class => (action_name == 'report' ? 'selected' : nil)) %></li>
|
Chris@1296
|
35 </ul>
|
Chris@1296
|
36 </div>
|
Chris@1296
|
37
|
Chris@1296
|
38 <%= javascript_tag do %>
|
Chris@1296
|
39 $('#from, #to').change(function(){
|
Chris@1296
|
40 $('#period_type_interval').attr('checked', true); $('#from,#to').removeAttr('disabled'); $('#period').attr('disabled', true);
|
Chris@1296
|
41 });
|
Chris@1296
|
42 <% end %>
|