mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-18 13:18:09 +01:00
fix #1109 and do some small optimizations on home page
This commit is contained in:
parent
4cca813bc7
commit
e9d92438d6
5 changed files with 14 additions and 10 deletions
|
|
@ -59,7 +59,7 @@ class ApplicationController < ActionController::Base
|
|||
def set_session_expiration
|
||||
# http://wiki.rubyonrails.com/rails/show/HowtoChangeSessionOptions
|
||||
unless session == nil
|
||||
return if @controller_name == 'feed' or session['noexpiry'] == "on"
|
||||
return if self.controller_name == 'feed' or session['noexpiry'] == "on"
|
||||
# If the method is called by the feed controller (which we don't have
|
||||
# under session control) or if we checked the box to keep logged in on
|
||||
# login don't set the session expiry time.
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@ class TodosController < ApplicationController
|
|||
:completed_archive, :check_deferred, :toggle_check, :toggle_star,
|
||||
:edit, :update, :defer, :create, :calendar, :auto_complete_for_predecessor, :remove_predecessor, :add_predecessor]
|
||||
|
||||
protect_from_forgery :except => :check_deferred
|
||||
|
||||
def index
|
||||
@projects = current_user.projects.find(:all, :include => [:default_context])
|
||||
@contexts = current_user.contexts.find(:all)
|
||||
|
|
@ -823,13 +825,13 @@ class TodosController < ApplicationController
|
|||
# current_users.todos.find but that broke with_scope for :limit
|
||||
|
||||
# Exclude hidden projects from count on home page
|
||||
@todos = current_user.todos.find(:all, :include => [ :project, :context, :tags ])
|
||||
@todos = current_user.todos.find(:all, :include => [ :project, :context, :tags, :pending_successors, :recurring_todo ])
|
||||
|
||||
# Exclude hidden projects from the home page
|
||||
@not_done_todos = current_user.todos.find(:all,
|
||||
:conditions => ['contexts.hide = ? AND (projects.state = ? OR todos.project_id IS NULL)', false, 'active'],
|
||||
:order => "todos.due IS NULL, todos.due ASC, todos.created_at ASC",
|
||||
:include => [ :project, :context, :tags ])
|
||||
:include => [ :project, :context, :tags, :pending_successors, :recurring_todo ])
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue