mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-27 01:24:07 +01:00
add recurring_todos to done_overview and fix routes
This commit is contained in:
parent
aa3fbf0d1e
commit
c61238933c
5 changed files with 27 additions and 22 deletions
|
|
@ -1,6 +1,6 @@
|
|||
class StatsController < ApplicationController
|
||||
|
||||
helper :todos, :projects
|
||||
helper :todos, :projects, :recurring_todos
|
||||
|
||||
append_before_filter :init, :exclude => []
|
||||
|
||||
|
|
@ -646,13 +646,11 @@ class StatsController < ApplicationController
|
|||
def done
|
||||
@source_view = 'done'
|
||||
|
||||
@done_recently = current_user.todos.completed.all(:limit => 10, :order => 'completed_at DESC')
|
||||
|
||||
init_not_done_counts(['project'])
|
||||
@last_completed_projects = current_user.projects.completed.all(:limit => 10, :order => 'completed_at DESC')
|
||||
|
||||
@done_recently = current_user.todos.completed.all(:limit => 10, :order => 'completed_at DESC', :include => [:project, :context, :tags, :taggings])
|
||||
@last_completed_projects = current_user.projects.completed.all(:limit => 10, :order => 'completed_at DESC', :include => [:todos, :notes])
|
||||
@last_completed_contexts = []
|
||||
#@last_completed_contexts = current_user.contexts.completed.all(:limit => 10, :order => 'completed_at DESC')
|
||||
@last_completed_recurring_todos = current_user.recurring_todos.completed.all(:limit => 10, :order => 'completed_at DESC')
|
||||
#TODO: @last_completed_contexts = current_user.contexts.completed.all(:limit => 10, :order => 'completed_at DESC')
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
|||
|
|
@ -82,6 +82,8 @@ class Project < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def note_count
|
||||
# TODO: test this for eager and not eager loading!!!
|
||||
return 0 if notes.size == 0
|
||||
cached_note_count || notes.count
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@
|
|||
<li><a href="#"><%= t('layouts.navigation.view') %></a>
|
||||
<ul>
|
||||
<li><%= navigation_link( t('layouts.navigation.calendar'), calendar_path, :title => t('layouts.navigation.calendar_title')) %></li>
|
||||
<li><%= navigation_link( t('layouts.navigation.completed_tasks'), done_path, {:accesskey=>"d", :title=>t('layouts.navigation.completed_tasks_title')} ) %></li>
|
||||
<li><%= navigation_link( t('layouts.navigation.completed_tasks'), done_overview_path, {:accesskey=>"d", :title=>t('layouts.navigation.completed_tasks_title')} ) %></li>
|
||||
<li><%= navigation_link( t('layouts.navigation.feeds'), {:controller => "feedlist", :action => "index"}, :title => t('layouts.navigation.feeds_title')) %></li>
|
||||
<li><%= navigation_link( t('layouts.navigation.stats'), {:controller => "stats", :action => "index"}, :title => t('layouts.navigation.stats_title')) %></li>
|
||||
</ul>
|
||||
|
|
|
|||
|
|
@ -29,16 +29,17 @@
|
|||
</div>
|
||||
|
||||
<div class="container">
|
||||
<div class=add_note_link><%= link_to "Show all", done_contexts_path%></div>
|
||||
<div class=add_note_link><%= link_to "Show all", done_recurring_todos_path%></div>
|
||||
<h2>
|
||||
<%= t('common.last') %> <%= t('states.completed_plural' )%> <%= t('common.contexts') %>
|
||||
<%= t('common.last') %> <%= t('states.completed_plural' )%> <%= t('common.recurring_todos') %>
|
||||
</h2>
|
||||
<% if @last_completed_contexts.empty? -%>
|
||||
<div class="message"><p><%= t('projects.no_last_completed_contexts') %></p></div>
|
||||
<% if @last_completed_recurring_todos.empty? -%>
|
||||
<div class="message"><p><%= t('projects.no_last_completed_recurring_todos') %></p></div>
|
||||
<% else -%>
|
||||
TODO
|
||||
<%= render :partial => '/recurring_todos/recurring_todo', :collection => @last_completed_recurring_todos %>
|
||||
<% end -%>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div><!-- End of display_box -->
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue