[Contributed by Arnaud Limbourg, ticket:18] A new entry in settings.yml allows you to choose the number of completed actions you want to see on the /todo/list home page. Also sorts by due date (ascending) first, then creation date (descending) on /todo/list, /context/show/[name], and /project/show/[name]

git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@57 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
bsag 2005-04-03 11:45:05 +00:00
parent 8fba2bebc6
commit 0577e850f6
8 changed files with 13 additions and 9 deletions

View file

@ -9,6 +9,7 @@ class TodoController < ApplicationController
# Main method for listing tasks
# Set page title, and fill variables with contexts and done and not-done tasks
# Number of completed actions to show is determined by a setting in settings.yml
#
def index
@ -18,11 +19,12 @@ class TodoController < ApplicationController
def list
@page_title = "TRACKS::List tasks"
@no_of_actions = app_configurations["formats"]["hp_completed"]
@projects = Project.find_all
@places = Context.find_all
@shown_places = Context.find_all_by_hide( "0", "position ASC")
@hidden_places = Context.find_all_by_hide( "1", "position ASC" )
@done = Todo.find_all_by_done( 1, "completed DESC", 5 )
@done = Todo.find_all_by_done( 1, "completed DESC", @no_of_actions )
# Set count badge to number of not-done, not hidden context items
@count = count_shown_items(@hidden_places)