fixes #726. Thanks Eric Pallen for the fix. The mobile view showed active todos from completed projects while the home page does not.

git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@867 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
lrbalt 2008-06-05 06:59:09 +00:00
parent d07d0c4f4d
commit b83a3b311c

View file

@ -461,7 +461,11 @@ class TodosController < ApplicationController
@todos = Todo.find(:all, :conditions => ['todos.user_id = ?', current_user.id], :include => [ :project, :context, :tags ])
# Exclude hidden projects from the home page
@not_done_todos = Todo.find(:all, :conditions => ['todos.user_id = ? AND contexts.hide = ? AND (projects.state = ? OR todos.project_id IS NULL)', current_user.id, false, 'active'], :order => "todos.due IS NULL, todos.due ASC, todos.created_at ASC", :include => [ :project, :context, :tags ])
@not_done_todos = Todo.find(:all,
:conditions => ['todos.user_id = ? AND contexts.hide = ? AND (projects.state = ? OR todos.project_id IS NULL)',
current_user.id, false, 'active'],
:order => "todos.due IS NULL, todos.due ASC, todos.created_at ASC",
:include => [ :project, :context, :tags ])
end
end
@ -475,8 +479,8 @@ class TodosController < ApplicationController
# Exclude hidden projects from the home page
@not_done_todos = Todo.find(:all,
:conditions => ['todos.user_id = ? AND todos.state = ? AND contexts.hide = ?',
current_user.id, 'active', false],
:conditions => ['todos.user_id = ? AND todos.state = ? AND contexts.hide = ? AND (projects.state = ? OR todos.project_id IS NULL)',
current_user.id, 'active', false, 'active'],
:order => "todos.due IS NULL, todos.due ASC, todos.created_at ASC",
:include => [ :project, :context ])
end