<%- reset_tab_index %>
<% form_for(@new_recurring_todo, :html=> { :id=>'recurring-todo-form-new-action', :name=>'recurring_todo', :class => 'inline-form' }) do -%>
<%= error_messages_for("item", :object_name => 'action') %>
<%= text_field_tag( "recurring_todo[description]", "", "size" => 30, "tabindex" => next_tab_index, "maxlength" => 100) -%> <%= text_area_tag( "recurring_todo[notes]", nil, {:cols => 29, :rows => 6, :tabindex => next_tab_index}) -%> <%= text_field_tag "tag_list", nil, :size => 30, :tabindex => next_tab_index -%>

<%= radio_button_tag('recurring_todo[recurring_period]', 'daily', true, {:tabindex => next_tab_index})%> <%= t('todos.recurrence.daily') %>
<%= radio_button_tag('recurring_todo[recurring_period]', 'weekly', false, {:tabindex => next_tab_index})%> <%= t('todos.recurrence.weekly') %>
<%= radio_button_tag('recurring_todo[recurring_period]', 'monthly', false, {:tabindex => next_tab_index})%> <%= t('todos.recurrence.monthly') %>
<%= radio_button_tag('recurring_todo[recurring_period]', 'yearly', false, {:tabindex => next_tab_index})%> <%= t('todos.recurrence.yearly') %>

<%= text_field(:recurring_todo, :start_from, "value" => format_date(current_user.time), "size" => 12, "class" => "Date", "tabindex" => next_tab_index, "autocomplete" => "off") %>


<%= radio_button_tag('recurring_todo[ends_on]', 'no_end_date', true, {:tabindex => next_tab_index})%> <%= t('todos.recurrence.no_end_date') %>
<%= radio_button_tag('recurring_todo[ends_on]', 'ends_on_number_of_times', false, {:tabindex => next_tab_index})%> <%= t('todos.recurrence.ends_on_number_times', :number => text_field( :recurring_todo, :number_of_occurences, "size" => 3, "tabindex" => next_tab_index)) %>
<%= radio_button_tag('recurring_todo[ends_on]', 'ends_on_end_date', false, {:tabindex => next_tab_index})%> <%= t('todos.recurrence.ends_on_date', :date => text_field(:recurring_todo, :end_date, "size" => 12, "class" => "Date", "tabindex" => next_tab_index, "autocomplete" => "off", "value" => "")) %>

<%= radio_button_tag('recurring_todo[daily_selector]', 'daily_every_x_day', true, {:tabindex => next_tab_index})%> <%= t('todos.recurrence.daily_every_number_day', :number=> text_field_tag( 'recurring_todo[daily_every_x_days]', "1", {"size" => 3, "tabindex" => next_tab_index})) %>
<%= radio_button_tag('recurring_todo[daily_selector]', 'daily_every_work_day', false, {:tabindex => next_tab_index})%> <%= t('todos.recurrence.every_work_day') %>

<%= radio_button_tag('recurring_todo[recurring_target]', 'due_date', true, {:tabindex => next_tab_index})%> <%= t('todos.recurrence.recurrence_on_due_date') %>. <%= t('todos.recurrence.show_options') %>: <%= radio_button_tag('recurring_todo[recurring_show_always]', '1', true, {:tabindex => next_tab_index})%> <%= t('todos.recurrence.show_option_always') %> <%= radio_button_tag('recurring_todo[recurring_show_always]', '0', false, {:tabindex => next_tab_index})%> <%= t('todos.recurrence.show_days_before', :days => text_field_tag( 'recurring_todo[recurring_show_days_before]', "0", {"size" => 3, "tabindex" => next_tab_index})) %>
<%= radio_button_tag('recurring_todo[recurring_target]', 'show_from_date', false, {:tabindex => next_tab_index})%> <%= t('todos.recurrence.from_tickler') %>

<% end %>