Patch submitted by Sean Santry: this adds more useful information to the flash notifications when items are added, deleted or created, by giving you the name of the context, project or next action that you are acting on. Thanks Sean!

git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@44 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
bsag 2005-03-10 22:40:01 +00:00
parent eee3480918
commit 6f51118766
6 changed files with 27 additions and 27 deletions

View file

@ -59,10 +59,10 @@ class TodoController < ApplicationController
@item.attributes = @params["item"]
if @item.save
flash["confirmation"] = "Next action was successfully added"
flash["confirmation"] = "Next action \"#{@item.description}\" was successfully added"
redirect_to( :action => "list" )
else
flash["warning"] = "Couldn't add the action because of an error"
flash["warning"] = "Couldn't add the action \"#{@item.description}\""
redirect_to( :action => "list" )
end
end
@ -83,10 +83,10 @@ class TodoController < ApplicationController
@item = Todo.find(@params['item']['id'])
@item.attributes = @params['item']
if @item.save
flash["confirmation"] = 'Next action was successfully updated'
flash["confirmation"] = "Next action \"#{@item.description}\" was successfully updated"
redirect_to :action => 'list'
else
flash["warning"] = 'Next action could not be updated'
flash["warning"] = "Next action \"#{@item.description}\" could not be updated"
redirect_to :action => 'list'
end
end
@ -96,10 +96,10 @@ class TodoController < ApplicationController
expire_action(:controller => "todo", :action => "list")
item = Todo.find(@params['id'])
if item.destroy
flash["confirmation"] = "Next action was successfully deleted"
flash["confirmation"] = "Next action \"#{item.description}\" was successfully deleted"
redirect_to :action => "list"
else
flash["warning"] = "Couldn't delete next action"
flash["warning"] = "Couldn't delete next action \"#{item.description}\""
redirect_to :action => "list"
end
end
@ -115,10 +115,10 @@ class TodoController < ApplicationController
item.toggle!('done')
if item.save
flash["confirmation"] = "Next action marked as completed"
flash["confirmation"] = "Next action \"#{item.description}\" marked as completed"
redirect_to( :action => "list" )
else
flash["warning"] = "Couldn't mark action as completed"
flash["warning"] = "Couldn't mark action \"#{item.description}\" as completed"
redirect_to( :action => "list" )
end
end