<% @todo = nil @initial_context_name = @context.name unless @context.nil? @initial_context_name ||= @project.default_context.name unless @project.nil? || @project.default_context.nil? @initial_context_name ||= current_user.contexts.first.name unless current_user.contexts.first.nil? @initial_project_name = @project.name unless @project.nil? -%>
« Hide form <% apply_behavior '#toggle_action_new a:click', :prevent_default => true do |page| page << "TracksForm.toggle('toggle_action_new', 'todo_new_action', 'todo-form-new-action', '« Hide form', 'Hide next action form', 'Add a next action »', 'Add a next action');" end -%>
<% form_remote_tag( :url => todos_path, :method => :post, :html=> { :id=>'todo-form-new-action', :name=>'todo', :class => 'inline-form' }, :before => "$('todo_new_action_submit').startWaiting()", :complete => "$('todo_new_action_submit').stopWaiting()", :condition => "!$('todo_new_action_submit').isWaiting() && askIfNewContextProvided()") do -%>
<%= error_messages_for("item", :object_name => 'action') %>
<%= text_field( "todo", "description", "size" => 30, "tabindex" => 1, "maxlength" => 100, "autocomplete" => "off") %> <%= text_area( "todo", "notes", "cols" => 29, "rows" => 6, "tabindex" => 2) %> <%= text_field_tag "tag_list", nil, :size => 30, :tabindex => 5 %>
<%= text_field("todo", "due", "size" => 12, "class" => "Date", "onfocus" => "Calendar.setup", "tabindex" => 6, "autocomplete" => "off") %>
<%= text_field("todo", "show_from", "size" => 12, "class" => "Date", "onfocus" => "Calendar.setup", "tabindex" => 7, "autocomplete" => "off") %>
<%= source_view_tag( @source_view ) %>
<% end -%> <%= calendar_setup( "todo_due" ) %> <%= calendar_setup( "todo_show_from" ) %>