diff --git a/app/controllers/todos_controller.rb b/app/controllers/todos_controller.rb
index b2f576af..f62e6b9b 100644
--- a/app/controllers/todos_controller.rb
+++ b/app/controllers/todos_controller.rb
@@ -685,7 +685,14 @@ class TodosController < ApplicationController
@down_count = @count = @not_done_todos.size
respond_to do |format|
- format.html
+ format.html do
+ init_not_done_counts
+ @active_projects = current_user.projects.active
+ @active_contexts = current_user.contexts.active
+ @hidden_projects = current_user.projects.hidden
+ @hidden_contexts = current_user.contexts.hidden
+ @completed_projects = current_user.projects.completed
+ end
format.m { render :action => 'mobile_list_deferred' }
format.xml { render :xml => @not_done_todos.to_xml( *to_xml_params ) }
end
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 38ee306d..05afee5b 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -192,7 +192,7 @@ module ApplicationHelper
end
def sidebar_html_for_titled_list (list, title)
- return content_tag(:h3, title+" (#{list.length})") + content_tag(:ul, sidebar_html_for_list(list))
+ return content_tag(:h3, title+" (#{list.size})") + content_tag(:ul, sidebar_html_for_list(list))
end
def sidebar_html_for_list(list)
diff --git a/app/views/todos/list_deferred.html.erb b/app/views/todos/list_deferred.html.erb
index be41cb31..4e68839e 100644
--- a/app/views/todos/list_deferred.html.erb
+++ b/app/views/todos/list_deferred.html.erb
@@ -9,5 +9,5 @@
<%= render :partial => "shared/add_new_item_form" %>
- <%= render :file => "sidebar/sidebar.html.erb" %>
+ <%= render :file => "sidebar/sidebar" %>
diff --git a/config/routes.rb b/config/routes.rb
index af591143..5c2f2392 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -118,6 +118,7 @@ Tracksapp::Application.routes.draw do
match 'todos/tag/:name' => 'todos#tag', :as => :tag
match 'todos/done/tag/:name' => "todos#done_tag", :as => :done_tag
match 'todos/all_done/tag/:name' => "todos#all_done_tag", :as => :all_done_tag
+ match 'auto_complete_for_predecessor' => 'todos#auto_complete_for_predecessor'
resources :recurring_todos do
member do
diff --git a/features/step_definitions/todo_create_steps.rb b/features/step_definitions/todo_create_steps.rb
index e91575e5..d3b560e5 100644
--- a/features/step_definitions/todo_create_steps.rb
+++ b/features/step_definitions/todo_create_steps.rb
@@ -63,8 +63,8 @@ Given /^I have ([0-9]+) todos$/ do |count|
end
Given /^I have a todo with description "([^"]*)" in project "([^"]*)" with tags "([^"]*)" in the context "([^"]*)"$/ do |action_description, project_name, tags, context_name|
- context = @current_user.contexts.find_or_create(:name => context_name)
- project = @current_user.projects.find_or_create(:name => project_name)
+ context = @current_user.contexts.find_or_create_by_name(context_name)
+ project = @current_user.projects.find_or_create_by_name(project_name)
@todo = @current_user.todos.create!(:context_id => context.id, :project_id => project.id, :description => action_description)
@todo.tag_with(tags)
@todo.save
diff --git a/features/step_definitions/todo_edit_steps.rb b/features/step_definitions/todo_edit_steps.rb
index e52614dd..6086892c 100644
--- a/features/step_definitions/todo_edit_steps.rb
+++ b/features/step_definitions/todo_edit_steps.rb
@@ -173,7 +173,7 @@ When /^I edit the tags of "([^"]*)" to "([^"]*)"$/ do |action_description, tags|
todo.should_not be_nil
open_edit_form_for(todo)
- fill_in "tag_list", :with => tags
+ fill_in "todo_tag_list", :with => tags
submit_edit_todo_form(todo)
end