Project and context view can now be grouped by context and project (using view menu)

This commit is contained in:
Reinier Balt 2013-06-11 11:12:21 +02:00
parent 591e20c9f1
commit 0a57a68a87
10 changed files with 34 additions and 15 deletions

View file

@ -42,6 +42,7 @@ class ContextsController < ApplicationController
@max_completed = current_user.prefs.show_number_completed
@done = @context.todos.completed.limit(@max_completed).reorder("todos.completed_at DESC, todos.created_at DESC").includes(Todo::DEFAULT_INCLUDES)
@not_done_todos = @context.todos.active.reorder("todos.due IS NULL, todos.due ASC, todos.created_at ASC").includes(Todo::DEFAULT_INCLUDES)
@todos_without_project = @not_done_todos.select{|t| t.project.nil?}
@deferred_todos = @context.todos.deferred.includes(Todo::DEFAULT_INCLUDES)
@pending_todos = @context.todos.pending.includes(Todo::DEFAULT_INCLUDES)
@ -49,6 +50,9 @@ class ContextsController < ApplicationController
@projects = current_user.projects
@contexts = current_user.contexts
@projects_to_show = @projects.active
@contexts_to_show = [@context]
@count = @not_done_todos.count + @deferred_todos.count + @pending_todos.count
@page_title = "TRACKS::Context: #{@context.name}"
respond_to do |format|