Completed projects no longer appear in the Projects drop down on all the forms. Fixes #66.

git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@105 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
bsag 2005-06-12 12:14:30 +00:00
parent 6c44e5231b
commit 3f90096bb8
3 changed files with 13 additions and 13 deletions

View file

@ -26,7 +26,7 @@ class ContextController < ApplicationController
def show
@context = Context.find_by_name(deurlize(@params["name"]))
@places = Context.find(:all, :order => "position ASC")
@projects = Project.find(:all, :order => "position ASC")
@projects = Project.find( :all, :conditions => "done=0", :order => "position ASC" )
@page_title = "TRACKS::Context: #{@context.name}"
@not_done = Todo.find(:all, :conditions => "done=0 AND context_id=#{@context.id}",
:order => "due IS NULL, due ASC, created ASC")
@ -64,7 +64,7 @@ class ContextController < ApplicationController
#
def update_action
@places = Context.find(:all, :order => "position ASC")
@projects = Project.find(:all, :order => "position ASC")
@projects = Project.find( :all, :conditions => "done=0", :order => "position ASC" )
action = Todo.find(params[:id])
action.attributes = @params["item"]
if action.due?
@ -85,7 +85,7 @@ class ContextController < ApplicationController
# Parameters from form fields are passed to create new action
#
def add_item
@projects = Project.find( :all, :order => "position ASC" )
@projects = Project.find( :all, :conditions => "done=0", :order => "position ASC" )
@places = Context.find( :all, :order => "position ASC" )
item = Todo.new
@ -134,7 +134,7 @@ class ContextController < ApplicationController
#
def toggle_check
@places = Context.find(:all, :order => "position ASC")
@projects = Project.find(:all, :order => "position ASC")
@projects = Project.find( :all, :conditions => "done=0", :order => "position ASC" )
item = Todo.find(params[:id])

View file

@ -17,7 +17,7 @@ class ProjectController < ApplicationController
#
def list
@page_title = "TRACKS::List Projects"
@projects = Project.find(:all, :conditions => nil, :order => "position ASC")
@projects = Project.find( :all, :conditions => "done=0", :order => "position ASC" )
end
# Filter the projects to show just the one passed in the URL
@ -26,7 +26,7 @@ class ProjectController < ApplicationController
def show
@project = Project.find_by_name(deurlize(@params["name"]))
@places = Context.find(:all, :order => "position ASC")
@projects = Project.find(:all, :order => "position ASC")
@projects = Project.find( :all, :conditions => "done=0", :order => "position ASC" )
@page_title = "TRACKS::Project: #{@project.name}"
@not_done = Todo.find(:all, :conditions => "done=0 AND project_id=#{@project.id}",
:order => "due IS NULL, due ASC, created ASC")
@ -62,7 +62,7 @@ class ProjectController < ApplicationController
#
def update_action
@places = Context.find(:all, :order => "position ASC")
@projects = Project.find(:all, :order => "position ASC")
@projects = Project.find( :all, :conditions => "done=0", :order => "position ASC" )
action = Todo.find(params[:id])
action.attributes = @params["item"]
@ -84,7 +84,7 @@ class ProjectController < ApplicationController
# Parameters from form fields are passed to create new action
#
def add_item
@projects = Project.find( :all, :order => "position ASC" )
@projects = Project.find( :all, :conditions => "done=0", :order => "position ASC" )
@places = Context.find( :all, :order => "position ASC" )
item = Todo.new
@ -134,7 +134,7 @@ class ProjectController < ApplicationController
#
def toggle_check
@places = Context.find(:all, :order => "position ASC")
@projects = Project.find(:all, :order => "position ASC")
@projects = Project.find( :all, :conditions => "done=0", :order => "position ASC" )
item = Todo.find(@params['id'])
item.toggle!('done')

View file

@ -17,7 +17,7 @@ class TodoController < ApplicationController
#
def list
@page_title = "TRACKS::List tasks"
@projects = Project.find( :all, :order => "position ASC" )
@projects = Project.find( :all, :conditions => "done=0", :order => "position ASC" )
@places = Context.find( :all, :order => "position ASC" )
@shown_places = Context.find( :all, :conditions => "hide=0", :order => "position ASC" )
@hidden_places = Context.find( :all, :conditions => "hide=1", :order => "position ASC" )
@ -71,7 +71,7 @@ class TodoController < ApplicationController
# Parameters from form fields are passed to create new action
# in the selected context.
def add_item
@projects = Project.find( :all, :order => "position ASC" )
@projects = Project.find( :all, :conditions => "done=0", :order => "position ASC" )
@places = Context.find( :all, :order => "position ASC" )
item = Todo.new
@ -95,7 +95,7 @@ class TodoController < ApplicationController
#
def update_action
@places = Context.find(:all, :order => "position ASC")
@projects = Project.find(:all, :order => "position ASC")
@projects = Project.find( :all, :conditions => "done=0", :order => "position ASC" )
action = Todo.find(params[:id])
action.attributes = @params["item"]
if action.due?
@ -127,7 +127,7 @@ class TodoController < ApplicationController
# Toggles the 'done' status of the action
#
def toggle_check
@projects = Project.find(:all, :order => "position ASC")
@projects = Project.find( :all, :conditions => "done=0", :order => "position ASC" )
@places = Context.find(:all, :order => "position ASC")
item = Todo.find(@params['id'])