mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-24 03:00:12 +01:00
get the done view on a context and a project
This commit is contained in:
parent
35fe362b93
commit
a58e832945
10 changed files with 96 additions and 14 deletions
|
|
@ -215,6 +215,29 @@ class ProjectsController < ApplicationController
|
|||
@contexts = current_user.contexts
|
||||
end
|
||||
|
||||
def done_todos
|
||||
@source_view = 'project'
|
||||
@page_title = t('project.completed_tasks_title')
|
||||
|
||||
completed_todos = current_user.projects.find(params[:id]).todos.completed
|
||||
|
||||
@done_today = get_done_today(completed_todos)
|
||||
@done_this_week = get_done_this_week(completed_todos)
|
||||
@done_this_month = get_done_this_month(completed_todos)
|
||||
@count = @done_today.size + @done_this_week.size + @done_this_month.size
|
||||
|
||||
render :template => 'todos/done'
|
||||
end
|
||||
|
||||
def all_done_todos
|
||||
@source_view = 'project'
|
||||
@page_title = t('project.completed_tasks_title')
|
||||
|
||||
@done = current_user.projects.find(params[:id]).todos.completed.paginate :page => params[:page], :per_page => 20, :order => 'completed_at DESC', :include => Todo::DEFAULT_INCLUDES
|
||||
@count = @done.size
|
||||
render :template => 'todos/all_done'
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def update_state_counts
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue