diff --git a/app/controllers/todos_controller.rb b/app/controllers/todos_controller.rb index c64441f7..1fc60680 100644 --- a/app/controllers/todos_controller.rb +++ b/app/controllers/todos_controller.rb @@ -783,6 +783,7 @@ class TodosController < ApplicationController unless @todo.project_id == nil @down_count = current_user.projects.find(@todo.project_id).not_done_todos_including_hidden.count @deferred_count = current_user.projects.find(@todo.project_id).deferred_todos.count + @pending_count = current_user.projects.find(@todo.project_id).pending_todos.count end end from.deferred do diff --git a/app/views/todos/create.js.rjs b/app/views/todos/create.js.rjs index b82a7b24..f4e750b6 100644 --- a/app/views/todos/create.js.rjs +++ b/app/views/todos/create.js.rjs @@ -22,7 +22,9 @@ if @saved page[empty_container_msg_div_id].hide unless empty_container_msg_div_id.nil? end # make sure the behavior of the new/updated todo is enabled - page['tickler-empty-nd'].hide if source_view_is :deferred + if (source_view_is :project and @todo.pending?) or (source_view_is :deferred) + page['tickler-empty-nd'].hide # For some reason this does not work: page['tickler-empty-nd'].hide if (@todo.pending? or (source_view_is :deferred)) + end end else page.show 'status' diff --git a/app/views/todos/update.js.rjs b/app/views/todos/update.js.rjs index 8a535028..a1d0cfab 100644 --- a/app/views/todos/update.js.rjs +++ b/app/views/todos/update.js.rjs @@ -87,7 +87,14 @@ if @saved page["p#{@todo.project_id}empty-nd"].hide page.replace_html "badge_count", @down_count else - page.replace dom_id(@todo), :partial => 'todos/todo', :locals => { :todo => @todo, :parent_container_type => parent_container_type } + page.replace_html "p#{@todo.project_id}items", :partial => 'todos/todo', :collection => @todo.project.not_done_todos, + :locals => { :parent_container_type => parent_container_type } + page.replace "tickler", :partial => 'todos/deferred', :locals => { :deferred => @todo.project.deferred_todos, + :collapsible => false, + :append_descriptor => "in this project", + :parent_container_type => 'project', + :pending => @todo.project.pending_todos } + page['tickler-empty-nd'].show if (@deferred_count == 0 and @pending_count == 0) page.visual_effect :highlight, dom_id(@todo), :duration => 3 end elsif source_view_is :deferred