mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-23 18:50:12 +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 -->
|
||||
|
|
|
|||
|
|
@ -13,15 +13,15 @@ ActionController::Routing::Routes.draw do |map|
|
|||
end
|
||||
|
||||
map.with_options :controller => :contexts do |contexts|
|
||||
contexts.done 'contexts/done', :action => 'completed'
|
||||
contexts.done_contexts 'contexts/done', :action => 'done'
|
||||
end
|
||||
|
||||
map.resources :projects, :collection => {:order => :post, :alphabetize => :post, :actionize => :post, :done => :get} do |projects|
|
||||
map.resources :projects, :collection => {:order => :post, :alphabetize => :post, :actionize => :post} do |projects|
|
||||
projects.resources :todos, :name_prefix => "project_"
|
||||
end
|
||||
|
||||
map.with_options :controller => :projects do |projects|
|
||||
projects.done 'projects/done', :action => 'completed'
|
||||
projects.done_projects 'projects/done', :action => 'done'
|
||||
end
|
||||
|
||||
map.resources :notes
|
||||
|
|
@ -29,7 +29,7 @@ ActionController::Routing::Routes.draw do |map|
|
|||
map.resources :todos,
|
||||
:member => {:toggle_check => :put, :toggle_star => :put},
|
||||
:collection => {:check_deferred => :post, :filter_to_context => :post, :filter_to_project => :post,
|
||||
:done => :get, :all_done => :get}
|
||||
}
|
||||
|
||||
map.with_options :controller => :todos do |todos|
|
||||
todos.home '', :action => "index"
|
||||
|
|
@ -56,14 +56,19 @@ ActionController::Routing::Routes.draw do |map|
|
|||
|
||||
todos.mobile_todo_show_notes 'todos/notes/:id.m', :action => "show_notes", :format => 'm'
|
||||
todos.todo_show_notes 'todos/notes/:id', :action => "show_notes"
|
||||
todos.done_todos 'todos/done', :action => :done
|
||||
todos.all_done_todos 'todos/all_done', :action => :all_done
|
||||
end
|
||||
map.root :controller => 'todos' # Make OpenID happy because it needs #root_url defined
|
||||
|
||||
map.resources :recurring_todos,
|
||||
:member => {:toggle_check => :put, :toggle_star => :put}
|
||||
map.recurring_todos 'recurring_todos', :controller => 'recurring_todos', :action => 'index'
|
||||
map.with_options :controller => :recurring_todos do |rt|
|
||||
rt.recurring_todos 'recurring_todos', :action => 'index'
|
||||
rt.done_recurring_todos 'recurring_todos/done', :action => 'done'
|
||||
end
|
||||
|
||||
map.with_options :controller => 'login' do |login|
|
||||
map.with_options :controller => :login do |login|
|
||||
login.login 'login', :action => 'login'
|
||||
login.login_cas 'login_cas', :action => 'login_cas'
|
||||
login.formatted_login 'login.:format', :action => 'login'
|
||||
|
|
@ -71,12 +76,12 @@ ActionController::Routing::Routes.draw do |map|
|
|||
login.formatted_logout 'logout.:format', :action => 'logout'
|
||||
end
|
||||
|
||||
map.with_options :controller => "feedlist" do |fl|
|
||||
map.with_options :controller => :feedlist do |fl|
|
||||
fl.mobile_feeds 'feeds.m', :action => 'index', :format => 'm'
|
||||
fl.feeds 'feeds', :action => 'index'
|
||||
end
|
||||
|
||||
map.with_options :controller => "integrations" do |i|
|
||||
map.with_options :controller => :integrations do |i|
|
||||
i.integrations 'integrations', :action => 'index'
|
||||
i.rest_api_docs 'integrations/rest_api', :action => "rest_api"
|
||||
i.search_plugin 'integrations/search_plugin.xml', :controller => 'integrations', :action => 'search_plugin', :format => 'xml'
|
||||
|
|
@ -92,7 +97,6 @@ ActionController::Routing::Routes.draw do |map|
|
|||
|
||||
map.search 'search', :controller => 'search', :action => 'index'
|
||||
map.data 'data', :controller => 'data', :action => 'index'
|
||||
map.done 'done', :controller => 'todos', :action => 'completed_overview'
|
||||
|
||||
map.connect '/selenium_helper/login', :controller => 'selenium_helper', :action => 'login' if Rails.env == 'test'
|
||||
Translate::Routes.translation_ui(map) if Rails.env != "production"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue