From 8998c7f520590b353e5a21c0a99153cb91981fc7 Mon Sep 17 00:00:00 2001 From: bsag Date: Sun, 3 Apr 2005 15:03:59 +0000 Subject: [PATCH] Added a count of next actions to the /projects page, showing how many uncompleted next actions remain for each project. Fixes #7. git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@58 a4c988fc-2ded-0310-b66e-134b36920a42 --- tracks/app/controllers/application.rb | 2 +- tracks/app/controllers/context_controller.rb | 2 +- tracks/app/views/project/list.rhtml | 9 ++++++++- tracks/doc/CHANGENOTES.txt | 1 + 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/tracks/app/controllers/application.rb b/tracks/app/controllers/application.rb index 62085a88..0122cea4 100644 --- a/tracks/app/controllers/application.rb +++ b/tracks/app/controllers/application.rb @@ -17,5 +17,5 @@ class ApplicationController < ActionController::Base end total = Todo.find_all("done=0").length - sub end - + end \ No newline at end of file diff --git a/tracks/app/controllers/context_controller.rb b/tracks/app/controllers/context_controller.rb index b83783fb..07d09a6b 100644 --- a/tracks/app/controllers/context_controller.rb +++ b/tracks/app/controllers/context_controller.rb @@ -93,7 +93,7 @@ class ContextController < ApplicationController expire_action(:controller => "context", :action => "list") item = Todo.new item.attributes = @params["new_item"] - # where = Context.find_by_id(item.context_id) + where = Context.find_by_id(item.context_id) back_to = urlize(where.name) diff --git a/tracks/app/views/project/list.rhtml b/tracks/app/views/project/list.rhtml index 164ae914..6120e2d3 100644 --- a/tracks/app/views/project/list.rhtml +++ b/tracks/app/views/project/list.rhtml @@ -1,6 +1,12 @@
+ + + + + + <% row = 1 %> <% for @project in @projects %> <% if row % 2 == 0 %> @@ -9,7 +15,8 @@ <% end %> - + +
IDNameNext actions
<%= @project.id.to_s %><%= link_to ( "#{@project.name}", :action => "show", :name => urlize(@project.name) ) %><%= link_to( "#{@project.name}", :action => "show", :name => urlize(@project.name) ) %><%= Todo.count( "project_id=#{@project.id} AND done=0" ).to_s %> <%= link_to(image_tag( "edit", :title => "Edit item", :width=>"10", :height=>"10", :border=>"0"), { :action => "edit", :id => @project.id } ) + " " + link_to(image_tag( "delete", :title => "Delete item", :width=>"10", :height=>"10", :border=>"0"), { :action => "destroy", :id => @project.id}, :confirm => "Are you sure you want to delete this entry: #{@project.name}" ) + " " diff --git a/tracks/doc/CHANGENOTES.txt b/tracks/doc/CHANGENOTES.txt index 40888730..45b8e25a 100644 --- a/tracks/doc/CHANGENOTES.txt +++ b/tracks/doc/CHANGENOTES.txt @@ -23,6 +23,7 @@ Project wiki: 8. I added a pop-up calendar to set the due date. This is entirely lifted from Michele's excellent tutorial on pxl8.com . It works well, but I need to make sure it doesn't break in postgresql or sqlite. 9. [Contributed by Nicholas Lee] Changes to the way that URLs are specified which should improve the situation for people using Tracks in a subdirectory. 10. [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] +11. Added a count of next actions to the /projects page, showing how many uncompleted next actions remain for each project. ## Version 1.02