diff --git a/tracks/app/controllers/todos_controller.rb b/tracks/app/controllers/todos_controller.rb index faf75053..920ede02 100644 --- a/tracks/app/controllers/todos_controller.rb +++ b/tracks/app/controllers/todos_controller.rb @@ -255,9 +255,13 @@ class TodosController < ApplicationController def list_deferred @source_view = 'deferred' @page_title = "TRACKS::Tickler" + + @projects = @user.projects.find(:all, :include => [ :todos ]) + @contexts_to_show = @contexts = @user.contexts.find(:all, :include => [ :todos ]) + @user.deferred_todos.find_and_activate_ready - @tickles = @user.deferred_todos - @count = @tickles.size + @not_done_todos = @user.deferred_todos + @count = @not_done_todos.size @default_project_context_name_map = build_default_project_context_name_map(@projects).to_json end diff --git a/tracks/app/helpers/todos_helper.rb b/tracks/app/helpers/todos_helper.rb index 4fe8b52a..62e8bf94 100644 --- a/tracks/app/helpers/todos_helper.rb +++ b/tracks/app/helpers/todos_helper.rb @@ -71,7 +71,7 @@ module TodosHelper "(#{@todo.context.name}#{", " + @todo.project.name unless @todo.project.nil?})" else str = '' - if (['project', 'tickler', 'tag'].include?(parent_container_type)) + if (['project', 'tag'].include?(parent_container_type)) str << item_link_to_context( @todo ) end if (['context', 'tickler', 'tag'].include?(parent_container_type)) && @todo.project_id @@ -143,7 +143,6 @@ module TodosHelper end def item_container_id - return "tickler-items" if source_view_is :deferred if source_view_is :project return "p#{@todo.project_id}" if @todo.active? return "tickler" if @todo.deferred? diff --git a/tracks/app/views/todos/list_deferred.rhtml b/tracks/app/views/todos/list_deferred.rhtml index 32086a0e..907825b3 100644 --- a/tracks/app/views/todos/list_deferred.rhtml +++ b/tracks/app/views/todos/list_deferred.rhtml @@ -1,18 +1,8 @@
-
-

Deferred actions

+ <%= render :partial => "contexts/context", :collection => @contexts, + :locals => { :collapsible => true } %> -
-
-

Currently there are no deferred actions

-
- - <%= render :partial => "todos/todo", :collection => @tickles, :locals => { :parent_container_type => 'tickler' } %> - -
-
-
diff --git a/tracks/db/schema.rb b/tracks/db/schema.rb index ef2b3d84..5f0d0b46 100644 --- a/tracks/db/schema.rb +++ b/tracks/db/schema.rb @@ -5,10 +5,10 @@ ActiveRecord::Schema.define(:version => 32) do create_table "contexts", :force => true do |t| - t.column "name", :string, :default => "", :null => false - t.column "hide", :integer, :limit => 4, :default => 0, :null => false - t.column "position", :integer, :default => 0, :null => false - t.column "user_id", :integer, :default => 0, :null => false + t.column "name", :string, :default => "", :null => false + t.column "position", :integer, :null => false + t.column "hide", :boolean, :default => false + t.column "user_id", :integer, :default => 1 t.column "created_at", :datetime t.column "updated_at", :datetime end @@ -17,8 +17,8 @@ ActiveRecord::Schema.define(:version => 32) do add_index "contexts", ["user_id", "name"], :name => "index_contexts_on_user_id_and_name" create_table "notes", :force => true do |t| - t.column "user_id", :integer, :default => 0, :null => false - t.column "project_id", :integer, :default => 0, :null => false + t.column "user_id", :integer, :null => false + t.column "project_id", :integer, :null => false t.column "body", :text t.column "created_at", :datetime t.column "updated_at", :datetime @@ -44,7 +44,7 @@ ActiveRecord::Schema.define(:version => 32) do end create_table "preferences", :force => true do |t| - t.column "user_id", :integer, :default => 0, :null => false + t.column "user_id", :integer, :null => false t.column "date_format", :string, :limit => 40, :default => "%d/%m/%Y", :null => false t.column "week_starts", :integer, :default => 0, :null => false t.column "show_number_completed", :integer, :default => 5, :null => false @@ -66,8 +66,8 @@ ActiveRecord::Schema.define(:version => 32) do create_table "projects", :force => true do |t| t.column "name", :string, :default => "", :null => false - t.column "position", :integer, :default => 0, :null => false - t.column "user_id", :integer, :default => 0, :null => false + t.column "position", :integer, :null => false + t.column "user_id", :integer, :default => 1 t.column "description", :text t.column "state", :string, :limit => 20, :default => "active", :null => false t.column "created_at", :datetime @@ -84,7 +84,7 @@ ActiveRecord::Schema.define(:version => 32) do t.column "updated_at", :datetime end - add_index "sessions", ["session_id"], :name => "sessions_session_id_index" + add_index "sessions", ["session_id"], :name => "index_sessions_on_session_id" create_table "taggings", :force => true do |t| t.column "taggable_id", :integer @@ -104,16 +104,16 @@ ActiveRecord::Schema.define(:version => 32) do add_index "tags", ["name"], :name => "index_tags_on_name" create_table "todos", :force => true do |t| - t.column "context_id", :integer, :default => 0, :null => false - t.column "description", :string, :limit => 100, :default => "", :null => false + t.column "context_id", :integer, :null => false + t.column "project_id", :integer + t.column "description", :string, :default => "", :null => false t.column "notes", :text t.column "created_at", :datetime t.column "due", :date t.column "completed_at", :datetime - t.column "project_id", :integer - t.column "user_id", :integer, :default => 0, :null => false + t.column "user_id", :integer, :default => 1 t.column "show_from", :date - t.column "state", :string, :limit => 20, :default => "immediate", :null => false + t.column "state", :string, :limit => 20, :default => "immediate", :null => false end add_index "todos", ["user_id", "state"], :name => "index_todos_on_user_id_and_state" @@ -123,10 +123,10 @@ ActiveRecord::Schema.define(:version => 32) do add_index "todos", ["user_id", "context_id"], :name => "index_todos_on_user_id_and_context_id" create_table "users", :force => true do |t| - t.column "login", :string, :limit => 80 - t.column "password", :string, :limit => 40 + t.column "login", :string, :limit => 80, :default => "", :null => false + t.column "password", :string, :limit => 40, :default => "", :null => false t.column "word", :string - t.column "is_admin", :integer, :limit => 4, :default => 0, :null => false + t.column "is_admin", :boolean, :default => false, :null => false t.column "first_name", :string t.column "last_name", :string t.column "auth_type", :string, :default => "database", :null => false