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