tracks/app/views/recurring_todos/toggle_check.js.rjs

30 lines
1.2 KiB
Text
Raw Normal View History

2008-07-19 20:27:45 +02:00
if @saved
page[@recurring_todo].remove
page['badge_count'].replace_html @count
if @recurring_todo.completed?
# show completed recurring todo
page.insert_html :top, "completed_recurring_todos_container", :partial => 'recurring_todos/recurring_todo', :locals => { :recurring_todo => @recurring_todo }
2008-07-19 20:27:45 +02:00
page.visual_effect :highlight, dom_id(@recurring_todo), :duration => 3
# set empty messages
page.show 'recurring-todos-empty-nd' if @remaining == 0
page.hide 'completed-empty-nd'
else
# recurring_todo is activated
# show completed recurring todo
page.insert_html :top, "recurring_todos_container", :partial => 'recurring_todos/recurring_todo', :locals => { :recurring_todo => @recurring_todo }
2008-07-19 20:27:45 +02:00
page.visual_effect :highlight, dom_id(@recurring_todo), :duration => 3
# inform user if a new todo has been created because of the activation
page.notify :notice, t('todos.new_related_todo_created'), 3.0 unless @new_recurring_todo.nil?
2008-07-19 20:27:45 +02:00
# set empty messages
page.show 'completed-empty-nd' if @remaining == 0
page.hide 'recurring-todos-empty-nd'
end
else
page.notify :error, t('todos.error_completing_todo', :description => @recurring_todo.description), 8.0
2008-07-19 20:27:45 +02:00
end