mirror of
https://github.com/TracksApp/tracks.git
synced 2026-03-01 10:30:15 +01:00
Adjust the routing and name for the periodically executed check for deferred items.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@407 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
parent
fedf029764
commit
f364b039d7
4 changed files with 7 additions and 5 deletions
|
|
@ -2,7 +2,7 @@ class TodosController < ApplicationController
|
||||||
|
|
||||||
helper :todos
|
helper :todos
|
||||||
|
|
||||||
append_before_filter :init, :except => [ :destroy, :completed, :completed_archive, :check_tickler ]
|
append_before_filter :init, :except => [ :destroy, :completed, :completed_archive, :check_deferred ]
|
||||||
layout 'standard'
|
layout 'standard'
|
||||||
|
|
||||||
# Main method for listing tasks
|
# Main method for listing tasks
|
||||||
|
|
@ -231,7 +231,7 @@ class TodosController < ApplicationController
|
||||||
|
|
||||||
# Check for any due tickler items, activate them
|
# Check for any due tickler items, activate them
|
||||||
# Called by periodically_call_remote
|
# Called by periodically_call_remote
|
||||||
def check_tickler
|
def check_deferred
|
||||||
@due_tickles = @user.deferred_todos.find_and_activate_ready
|
@due_tickles = @user.deferred_todos.find_and_activate_ready
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { redirect_to home_path }
|
format.html { redirect_to home_path }
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,8 @@
|
||||||
<%= periodically_call_remote( :url => {:controller => "login", :action => "check_expiry"},
|
<%= periodically_call_remote( :url => {:controller => "login", :action => "check_expiry"},
|
||||||
:frequency => (5*60)) %>
|
:frequency => (5*60)) %>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
<%= periodically_call_remote( :url => check_tickler_path,
|
<%= periodically_call_remote( :url => formatted_check_deferred_todos_path(:js),
|
||||||
|
:method => :post,
|
||||||
:frequency => (10*60)) %>
|
:frequency => (10*60)) %>
|
||||||
<%= yield %>
|
<%= yield %>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -29,11 +29,12 @@ ActionController::Routing::Routes.draw do |map|
|
||||||
map.connect 'signup', :controller => 'login', :action => 'signup'
|
map.connect 'signup', :controller => 'login', :action => 'signup'
|
||||||
|
|
||||||
# ToDo Routes
|
# ToDo Routes
|
||||||
map.resources :todos, :member => {:toggle_check => :post}
|
map.resources :todos,
|
||||||
|
:member => {:toggle_check => :post},
|
||||||
|
:collection => {:check_deferred => :post}
|
||||||
map.with_options :controller => "todos" do |todos|
|
map.with_options :controller => "todos" do |todos|
|
||||||
todos.home '', :action => "index"
|
todos.home '', :action => "index"
|
||||||
todos.tickler 'tickler', :action => "list_deferred"
|
todos.tickler 'tickler', :action => "list_deferred"
|
||||||
todos.check_tickler 'check_tickler', :action => "check_tickler"
|
|
||||||
todos.done 'done', :action => "completed"
|
todos.done 'done', :action => "completed"
|
||||||
todos.done_archive 'done/archive', :action => "completed_archive"
|
todos.done_archive 'done/archive', :action => "completed_archive"
|
||||||
todos.tag '/todos/tag/:name', :action => "tag"
|
todos.tag '/todos/tag/:name', :action => "tag"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue