2007-03-30 04:36:52 +00:00
|
|
|
if @saved
|
|
|
|
|
page.hide 'status'
|
|
|
|
|
status_message = 'Added new next action'
|
|
|
|
|
status_message += ' to tickler' if @todo.deferred?
|
|
|
|
|
status_message = 'Added new project / ' + status_message if @new_project_created
|
|
|
|
|
status_message = 'Added new context / ' + status_message if @new_context_created
|
|
|
|
|
page.notify :notice, status_message, 5.0
|
|
|
|
|
page['badge_count'].replace_html @down_count
|
|
|
|
|
page.send :record, "Form.reset('todo-form-new-action');Form.focusFirstElement('todo-form-new-action')"
|
2008-03-20 19:04:07 +00:00
|
|
|
page['todo_context_name'].value = @initial_context_name
|
2007-09-10 00:55:11 +00:00
|
|
|
page << "updateContextNamesForAutoComplete(#{context_names_for_autocomplete})" if @new_context_created
|
2007-03-30 04:36:52 +00:00
|
|
|
page << "projectAutoCompleter.options.array = #{project_names_for_autocomplete}" if @new_project_created
|
|
|
|
|
if should_show_new_item()
|
|
|
|
|
if @new_context_created
|
|
|
|
|
page.insert_html :top, 'display_box', :partial => 'contexts/context', :locals => { :context => @todo.context, :collapsible => true }
|
|
|
|
|
else
|
2008-04-28 05:53:24 +00:00
|
|
|
page.call "todoItems.ensureVisibleWithEffectAppear", "c#{@todo.context_id}" if source_view_is_one_of(:todo, :deferred)
|
2008-07-19 20:27:45 +02:00
|
|
|
page.insert_html :bottom, item_container_id(@todo) + 'items', :partial => 'todos/todo', :locals => { :parent_container_type => parent_container_type, :source_view => @source_view }
|
2008-04-10 18:17:48 +00:00
|
|
|
page.visual_effect :highlight, dom_id(@todo), :duration => 3
|
2008-04-28 05:53:24 +00:00
|
|
|
page[empty_container_msg_div_id].hide unless empty_container_msg_div_id.nil?
|
2007-03-30 04:36:52 +00:00
|
|
|
end
|
2007-11-05 05:42:43 +00:00
|
|
|
page['tickler-empty-nd'].hide if source_view_is :deferred
|
2007-03-30 04:36:52 +00:00
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
page.show 'status'
|
2007-06-08 04:17:37 +00:00
|
|
|
page.replace_html 'status', "#{error_messages_for('todo', :object_name => 'action')}"
|
2007-03-30 04:36:52 +00:00
|
|
|
end
|