make sure toggle_check and deleting of todos, recurring_todos and projects work in the new done views

This commit is contained in:
Reinier Balt 2011-06-21 11:03:23 +02:00
parent 35f947ec57
commit 6e97541ab3
10 changed files with 88 additions and 41 deletions

View file

@ -7,7 +7,7 @@ class RecurringTodosController < ApplicationController
def index
@page_title = t('todos.recurring_actions_title')
@source_view = params['_source_view'] || 'recurring_todo'
find_and_inactivate
@recurring_todos = current_user.recurring_todos.active
@completed_recurring_todos = current_user.recurring_todos.completed.find(:all, :limit => 10)
@ -27,6 +27,7 @@ class RecurringTodosController < ApplicationController
def done
@page_title = t('todos.completed_recurring_actions_title')
@source_view = params['_source_view'] || 'recurring_todo'
items_per_page = 20
page = params[:page] || 1
@completed_recurring_todos = current_user.recurring_todos.completed.paginate :page => params[:page], :per_page => items_per_page
@ -141,7 +142,6 @@ class RecurringTodosController < ApplicationController
end
def destroy
# remove all references to this recurring todo
@todos = @recurring_todo.todos
@number_of_todos = @todos.size
@ -186,7 +186,6 @@ class RecurringTodosController < ApplicationController
@completed_remaining = current_user.recurring_todos.completed.count
# from completed back to active -> check if there is an active todo
# current_user.todos.count(:all, {:conditions => ["state = ? AND recurring_todo_id = ?", 'active',params[:id]]})
@active_todos = @recurring_todo.todos.active.count
# create todo if there is no active todo belonging to the activated
# recurring_todo