diff --git a/tracks/app/controllers/context_controller.rb b/tracks/app/controllers/context_controller.rb index e8e0bd91..de66c031 100644 --- a/tracks/app/controllers/context_controller.rb +++ b/tracks/app/controllers/context_controller.rb @@ -4,8 +4,7 @@ class ContextController < ApplicationController helper :context model :project before_filter :login_required - # caches_action :list, :show - + caches_action :list layout "standard" @@ -22,6 +21,7 @@ class ContextController < ApplicationController # Parameters from form fields should be passed to create new context # def add_context + expire_action(:controller => "context", :action => "list") context = Context.new context.attributes = @params["new_context"] @@ -36,6 +36,7 @@ class ContextController < ApplicationController def edit + expire_action(:controller => "context", :action => "list") @context = Context.find(@params['id']) @page_title = "Edit context: #{@context.name.capitalize}" end @@ -70,6 +71,7 @@ class ContextController < ApplicationController # Parameters from form fields are passed to create new action # in the selected context. def add_item + expire_action(:controller => "context", :action => "list") item = Todo.new item.attributes = @params["new_item"] @@ -89,6 +91,7 @@ class ContextController < ApplicationController # If the context contains actions, you'll get a warning dialogue. # If you choose to go ahead, any actions in the context will also be deleted. def destroy + expire_action(:controller => "context", :action => "list") context = Context.find(@params['id']) if context.destroy flash["confirmation"] = "Succesfully deleted context" diff --git a/tracks/app/controllers/project_controller.rb b/tracks/app/controllers/project_controller.rb index 74706851..071f516f 100644 --- a/tracks/app/controllers/project_controller.rb +++ b/tracks/app/controllers/project_controller.rb @@ -5,7 +5,7 @@ class ProjectController < ApplicationController model :todo before_filter :login_required - # caches_action :list, :show + caches_action :list layout "standard" # Main method for listing projects @@ -30,6 +30,7 @@ class ProjectController < ApplicationController def edit + expire_action(:controller => "project", :action => "list") @project = Project.find(@params['id']) @page_title = "Edit project: #{@project.name.capitalize}" end @@ -52,6 +53,7 @@ class ProjectController < ApplicationController # Parameters from form fields should be passed to create new project # def add_project + expire_action(:controller => "project", :action => "list") project = Project.new project.name = @params["new_project"]["name"] @@ -69,6 +71,7 @@ class ProjectController < ApplicationController # Parameters from form fields should be passed to create new item # def add_item + expire_action(:controller => "project", :action => "list") item = Todo.new item.attributes = @params["new_item"] @@ -85,6 +88,7 @@ class ProjectController < ApplicationController def destroy + expire_action(:controller => "project", :action => "list") project = Project.find( @params['id'] ) if project.destroy flash["confirmation"] = "Succesfully deleted project" diff --git a/tracks/app/controllers/todo_controller.rb b/tracks/app/controllers/todo_controller.rb index fbf6df13..f93af164 100644 --- a/tracks/app/controllers/todo_controller.rb +++ b/tracks/app/controllers/todo_controller.rb @@ -4,7 +4,7 @@ class TodoController < ApplicationController model :context, :project before_filter :login_required - # caches_action :list, :completed + caches_action :list, :completed, :completed_archive layout "standard" # Main method for listing tasks @@ -54,6 +54,7 @@ class TodoController < ApplicationController # Parameters from form fields should be passed to create new item # def add_item + expire_action(:controller => "todo", :action => "list") @item = Todo.new @item.attributes = @params["item"] @@ -68,6 +69,7 @@ class TodoController < ApplicationController def edit + expire_action(:controller => "todo", :action => "list") @item = Todo.find(@params['id']) @belongs = @item.project_id @projects = Project.find_all @@ -77,6 +79,7 @@ class TodoController < ApplicationController def update + expire_action(:controller => "todo", :action => "list") @item = Todo.find(@params['item']['id']) @item.attributes = @params['item'] if @item.save @@ -90,6 +93,7 @@ class TodoController < ApplicationController def destroy + expire_action(:controller => "todo", :action => "list") item = Todo.find(@params['id']) if item.destroy flash["confirmation"] = "Next action was successfully deleted" @@ -103,6 +107,9 @@ class TodoController < ApplicationController # Toggles the 'done' status of the action # def toggle_check + expire_action(:controller => "todo", :action => "list") + expire_action(:controller => "todo", :action => "completed") + expire_action(:controller => "todo", :action => "completed_archive") item = Todo.find(@params['id']) item.toggle!('done') diff --git a/tracks/app/views/context/show.rhtml b/tracks/app/views/context/show.rhtml index d3d5f6cc..8d4aaed5 100644 --- a/tracks/app/views/context/show.rhtml +++ b/tracks/app/views/context/show.rhtml @@ -9,10 +9,9 @@