diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2011-04-03 12:02:56 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2011-04-03 12:02:56 +0000 |
commit | 4ab4c21890255354368f628e80401d8ea911605d (patch) | |
tree | 72cb95a30b89a23e79c1d1df026d6aa6eb358949 /app/views/timelog | |
parent | 70ec78d013a141b86cef329e5e2daecf3f1b66a8 (diff) | |
download | redmine-4ab4c21890255354368f628e80401d8ea911605d.tar.gz redmine-4ab4c21890255354368f628e80401d8ea911605d.zip |
Disable unused fields when switching the period type.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5299 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views/timelog')
-rw-r--r-- | app/views/timelog/_date_range.rhtml | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/app/views/timelog/_date_range.rhtml b/app/views/timelog/_date_range.rhtml index 42ea53b71..e916bc187 100644 --- a/app/views/timelog/_date_range.rhtml +++ b/app/views/timelog/_date_range.rhtml @@ -2,16 +2,17 @@ <legend onclick="toggleFieldset(this);"><%= l(:label_date_range) %></legend> <div> <p> -<%= radio_button_tag 'period_type', '1', !@free_period %> +<%= radio_button_tag 'period_type', '1', !@free_period, :onclick => 'Form.Element.disable("from");Form.Element.disable("to");Form.Element.enable("period");' %> <%= select_tag 'period', options_for_period_select(params[:period]), :onchange => 'this.form.submit();', - :onfocus => '$("period_type_1").checked = true;' %> + :onfocus => '$("period_type_1").checked = true;', + :disabled => @free_period %> </p> <p> -<%= radio_button_tag 'period_type', '2', @free_period %> +<%= radio_button_tag 'period_type', '2', @free_period, :onclick => 'Form.Element.enable("from");Form.Element.enable("to");Form.Element.disable("period");' %> <span onclick="$('period_type_2').checked = true;"> -<%= l(:label_date_from_to, :start => (text_field_tag('from', @from, :size => 10) + calendar_for('from')), - :end => (text_field_tag('to', @to, :size => 10) + calendar_for('to'))) %> +<%= l(:label_date_from_to, :start => (text_field_tag('from', @from, :size => 10, :disabled => !@free_period) + calendar_for('from')), + :end => (text_field_tag('to', @to, :size => 10, :disabled => !@free_period) + calendar_for('to'))) %> </span> </p> </div> |