mirror of
https://github.com/TracksApp/tracks.git
synced 2026-03-16 01:06:32 +01:00
fix #1255. Context view now has seperate container for pending and deferred todos
This commit is contained in:
parent
e1c0ff0683
commit
dd957f0feb
10 changed files with 475 additions and 431 deletions
|
|
@ -277,10 +277,13 @@ class ContextsController < ApplicationController
|
|||
# search manually until I can work out a way to do the same thing using
|
||||
# not_done_todos acts_as_todo_container method Hides actions in hidden
|
||||
# projects from context.
|
||||
@not_done_todos = @context.todos.not_completed(
|
||||
@not_done_todos = @context.todos.active(
|
||||
:order => "todos.due IS NULL, todos.due ASC, todos.created_at ASC",
|
||||
:include => Todo::DEFAULT_INCLUDES)
|
||||
|
||||
@deferred = @context.todos.deferred(:include => Todo::DEFAULT_INCLUDES)
|
||||
@pending = @context.todos.pending(:include => Todo::DEFAULT_INCLUDES)
|
||||
|
||||
@projects = current_user.projects
|
||||
|
||||
@count = @not_done_todos.size
|
||||
|
|
|
|||
|
|
@ -529,7 +529,7 @@ class TodosController < ApplicationController
|
|||
format.js do
|
||||
if @saved
|
||||
determine_down_count
|
||||
if source_view_is_one_of(:todo, :deferred, :project)
|
||||
if source_view_is_one_of(:todo, :deferred, :project, :context)
|
||||
determine_remaining_in_context_count(@context_id)
|
||||
elsif source_view_is :calendar
|
||||
@original_item_due_id = get_due_id_for_calendar(@original_item_due)
|
||||
|
|
@ -1136,13 +1136,18 @@ class TodosController < ApplicationController
|
|||
}
|
||||
from.context {
|
||||
context = current_user.contexts.find(context_id)
|
||||
@remaining_deferred_or_pending_count = context.todos.deferred_or_blocked.count
|
||||
|
||||
remaining_actions_in_context = context.todos(true).active
|
||||
remaining_actions_in_context = remaining_actions_in_context.not_hidden if !context.hide?
|
||||
@remaining_in_context = remaining_actions_in_context.count
|
||||
|
||||
actions_in_target = current_user.contexts.find(@todo.context_id).todos(true).active
|
||||
actions_in_target = actions_in_target.not_hidden if !context.hide?
|
||||
if @todo_was_deferred_or_blocked
|
||||
actions_in_target = current_user.contexts.find(@todo.context_id).todos(true).active
|
||||
actions_in_target = actions_in_target.not_hidden if !context.hide?
|
||||
else
|
||||
actions_in_target = @todo.context.todos.deferred_or_blocked
|
||||
end
|
||||
@target_context_count = actions_in_target.count
|
||||
}
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue