diff --git a/tracks/app/controllers/context_controller.rb b/tracks/app/controllers/context_controller.rb index de66c031..f1e9acee 100644 --- a/tracks/app/controllers/context_controller.rb +++ b/tracks/app/controllers/context_controller.rb @@ -26,10 +26,10 @@ class ContextController < ApplicationController context.attributes = @params["new_context"] if context.save - flash["confirmation"] = "Succesfully created context" + flash["confirmation"] = "Succesfully created context \"#{context.name}\"" redirect_to( :action => "list" ) else - flash["warning"] = "Couldn't add new context" + flash["warning"] = "Couldn't add new context \"#{context.name}\"" redirect_to( :action => "list" ) end end @@ -46,10 +46,10 @@ class ContextController < ApplicationController @context = Context.find(@params['context']['id']) @context.attributes = @params['context'] if @context.save - flash["confirmation"] = 'Context was successfully updated' + flash["confirmation"] = "Context \"#{@context.name}\" was successfully updated" redirect_to :action => 'list' else - flash["warning"] = 'Context could not be updated' + flash["warning"] = "Context \"#{@context.name}\" could not be updated" redirect_to :action => 'list' end end @@ -78,10 +78,10 @@ class ContextController < ApplicationController back_to = item.context_id if item.save - flash["confirmation"] = "Succesfully added action to context" + flash["confirmation"] = "Succesfully added action \"#{item.description}\" to context" redirect_to( :controller => "context", :action => "show", :id => "#{back_to}" ) else - flash["warning"] = "Could not add action to context" + flash["warning"] = "Could not add action \"#{item.description}\" to context" redirect_to( :controller => "context", :action => "show", :id => "#{back_to}" ) end end @@ -94,10 +94,10 @@ class ContextController < ApplicationController expire_action(:controller => "context", :action => "list") context = Context.find(@params['id']) if context.destroy - flash["confirmation"] = "Succesfully deleted context" + flash["confirmation"] = "Succesfully deleted context \"#{context.name}\"" redirect_to( :action => "list" ) else - flash["warning"] = "Couldn't delete context" + flash["warning"] = "Couldn't delete context \"#{context.name}\"" redirect_to( :action => "list" ) end end diff --git a/tracks/app/controllers/project_controller.rb b/tracks/app/controllers/project_controller.rb index 071f516f..4f462a3d 100644 --- a/tracks/app/controllers/project_controller.rb +++ b/tracks/app/controllers/project_controller.rb @@ -40,10 +40,10 @@ class ProjectController < ApplicationController @project = Project.find(@params['project']['id']) @project.attributes = @params['project'] if @project.save - flash["confirmation"] = 'Project was successfully updated' + flash["confirmation"] = "Project \"#{@project.name}\" was successfully updated" redirect_to :action => 'list' else - flash["warning"] = 'Project could not be updated' + flash["warning"] = "Project \"#{@project.name}\" could not be updated" redirect_to :action => 'list' end end @@ -58,10 +58,10 @@ class ProjectController < ApplicationController project.name = @params["new_project"]["name"] if project.save - flash["confirmation"] = "Succesfully added project" + flash["confirmation"] = "Succesfully added project \"#{project.name}\"" redirect_to( :action => "list" ) else - flash["warning"] = "Couldn't add project" + flash["warning"] = "Couldn't add project \"#{project.name}\"" redirect_to( :action => "list" ) end end @@ -78,10 +78,10 @@ class ProjectController < ApplicationController back_to = item.project_id if item.save - flash["confirmation"] = "Successfully added next action to project" + flash["confirmation"] = "Successfully added next action \"#{item.description}\" to project" redirect_to( :controller => "project", :action => "show", :id => "#{back_to}" ) else - flash["warning"] = "Couldn't add next action to project" + flash["warning"] = "Couldn't add next action \"#{item.description}\" to project" redirect_to( :controller => "project", :action => "show", :id => "#{back_to}" ) end end @@ -91,10 +91,10 @@ class ProjectController < ApplicationController expire_action(:controller => "project", :action => "list") project = Project.find( @params['id'] ) if project.destroy - flash["confirmation"] = "Succesfully deleted project" + flash["confirmation"] = "Succesfully deleted project \"#{project.name}\"" redirect_to( :action => "list" ) else - flash["warning"] = "Couldn't delete project" + flash["warning"] = "Couldn't delete project \"#{project.name}\"" redirect_to( :action => "list" ) end end diff --git a/tracks/app/controllers/todo_controller.rb b/tracks/app/controllers/todo_controller.rb index bcbd9326..85d763be 100644 --- a/tracks/app/controllers/todo_controller.rb +++ b/tracks/app/controllers/todo_controller.rb @@ -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 diff --git a/tracks/app/views/context/list.rhtml b/tracks/app/views/context/list.rhtml index 77cf3def..1c87caf2 100644 --- a/tracks/app/views/context/list.rhtml +++ b/tracks/app/views/context/list.rhtml @@ -17,7 +17,7 @@ shown <% end %> -