mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-23 10:40:13 +01:00
Project and context view can now be grouped by context and project (using view menu)
This commit is contained in:
parent
591e20c9f1
commit
0a57a68a87
10 changed files with 34 additions and 15 deletions
|
|
@ -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|
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue