mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-24 03:00:12 +01:00
truncate wants explicit :length => number and :omission calling a partial from a js requires to explicitly pass the variable i.e. :todo => @todo instead of rails doing it implicitly
30 lines
No EOL
1.3 KiB
Text
30 lines
No EOL
1.3 KiB
Text
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 }
|
|
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 }
|
|
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, "A new todo was added which belongs to this recurring todo", 3.0 unless @new_recurring_todo.nil?
|
|
|
|
# set empty messages
|
|
page.show 'completed-empty-nd' if @remaining == 0
|
|
page.hide 'recurring-todos-empty-nd'
|
|
end
|
|
|
|
else
|
|
page.notify :error, "There was an error completing / activating the recurring todo #{@recurring_todo.description}", 8.0
|
|
end |