do a big refactor of rendering collections of todos for home page, tag page, project page, context page

This commit is contained in:
Reinier Balt 2013-03-10 20:38:10 +01:00
parent f22dfc1f9b
commit 22b371ef8c
20 changed files with 910 additions and 816 deletions

View file

@ -43,13 +43,13 @@ class ContextsController < ApplicationController
@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)
@deferred = @context.todos.deferred.includes(Todo::DEFAULT_INCLUDES)
@pending = @context.todos.pending.includes(Todo::DEFAULT_INCLUDES)
@deferred_todos = @context.todos.deferred.includes(Todo::DEFAULT_INCLUDES)
@pending_todos = @context.todos.pending.includes(Todo::DEFAULT_INCLUDES)
@projects = current_user.projects
@contexts = current_user.contexts
@count = @not_done_todos.count + @deferred.count + @pending.count
@count = @not_done_todos.count + @deferred_todos.count + @pending_todos.count
@page_title = "TRACKS::Context: #{@context.name}"
respond_to do |format|
format.html