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 @@
-

Add next action to this context

<%= form_tag( :controller => "context", :action => "add_item") %> <%= hidden_field( "new_item", "context_id", "value" => "#{@context.id}") %> -
+
<%= text_field( "new_item", "description" ) %>

diff --git a/tracks/app/views/layouts/standard.rhtml b/tracks/app/views/layouts/standard.rhtml index e6d9cf9a..9d080d2f 100644 --- a/tracks/app/views/layouts/standard.rhtml +++ b/tracks/app/views/layouts/standard.rhtml @@ -31,6 +31,5 @@ border-color: #FC9 #630 #330 #F96; padding:0px 3px 0px 3px; margin:0px;\">TXT
<%= @content_for_layout %> - diff --git a/tracks/app/views/project/show.rhtml b/tracks/app/views/project/show.rhtml index 146c58be..52a77f52 100644 --- a/tracks/app/views/project/show.rhtml +++ b/tracks/app/views/project/show.rhtml @@ -16,10 +16,9 @@
-

Add next action to this project

<%= form_tag( :controller => "project", :action => "add_item") %> <%= hidden_field( "new_item", "project_id", "value" => "#{@project.id}") %> -
+
<%= text_field( "new_item", "description" ) %>

diff --git a/tracks/config/environments/development.rb b/tracks/config/environments/development.rb index d3681e28..3d2c0be3 100644 --- a/tracks/config/environments/development.rb +++ b/tracks/config/environments/development.rb @@ -1,4 +1,5 @@ Dependencies.mechanism = :load ActionController::Base.consider_all_requests_local = true ActionController::Base.perform_caching = false -BREAKPOINT_SERVER_PORT = 42531 \ No newline at end of file +BREAKPOINT_SERVER_PORT = 42531 +ActionController::Base.fragment_cache_store = ActionController::Caching::Fragments::MemoryStore.new \ No newline at end of file diff --git a/tracks/config/environments/production.rb b/tracks/config/environments/production.rb index b464250b..8b673937 100644 --- a/tracks/config/environments/production.rb +++ b/tracks/config/environments/production.rb @@ -1,3 +1,4 @@ Dependencies.mechanism = :require ActionController::Base.consider_all_requests_local = false -ActionController::Base.perform_caching = true \ No newline at end of file +ActionController::Base.perform_caching = true +ActionController::Base.fragment_cache_store = ActionController::Caching::Fragments::MemoryStore.new \ No newline at end of file