fix #867. deferring in tag view is now working

This commit is contained in:
Reinier Balt 2009-04-07 17:14:51 +02:00
parent c450182a21
commit 893288031d
3 changed files with 322 additions and 292 deletions

View file

@ -264,6 +264,8 @@ class TodosController < ApplicationController
@remaining_undone_in_project = current_user.projects.find(@original_item_project_id).not_done_todo_count
end
determine_down_count
determine_deferred_tag_count(params['_tag_name']) if @source_view == 'tag'
respond_to do |format|
format.js
format.xml { render :xml => @todo.to_xml( :except => :user_id ) }
@ -435,7 +437,7 @@ class TodosController < ApplicationController
@todo = Todo.find(params[:id])
@todo.show_from = (@todo.show_from || @todo.user.date) + numdays.days
@saved = @todo.save
determine_down_count
determine_remaining_in_context_count(@todo.context_id)
respond_to do |format|
@ -693,6 +695,13 @@ class TodosController < ApplicationController
end
end
def determine_deferred_tag_count(tag)
tag_collection = Tag.find_by_name(tag).todos
@deferred_tag_count = tag_collection.count(:all,
:conditions => ['todos.user_id = ? and state = ?', current_user.id, 'deferred'],
:order => 'show_from ASC, todos.created_at DESC')
end
def render_todos_html
lambda do
@page_title = "TRACKS::List tasks"