mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-24 16:14:07 +01:00
fix editing a todo from tag view
saving worked, but the edit form did not disappear and the updated todo did not show up in the right place
This commit is contained in:
parent
49aac48616
commit
186fd5694d
3 changed files with 19 additions and 9 deletions
|
|
@ -542,11 +542,17 @@ class TodosController < ApplicationController
|
|||
end
|
||||
|
||||
def determine_remaining_in_context_count(context_id = @todo.context_id)
|
||||
if source_view_is :deferred
|
||||
@remaining_in_context = current_user.contexts.find(context_id).deferred_todo_count
|
||||
else
|
||||
@remaining_in_context = current_user.contexts.find(context_id).not_done_todo_count
|
||||
source_view do |from|
|
||||
from.deferred { @remaining_in_context = current_user.contexts.find(context_id).deferred_todo_count }
|
||||
from.tag {
|
||||
tag = Tag.find_by_name(params['_tag_name'])
|
||||
if tag.nil?
|
||||
tag = Tag.new(:name => params['tag'])
|
||||
end
|
||||
@remaining_in_context = current_user.contexts.find(context_id).not_done_todo_count({:tag => tag.id})
|
||||
}
|
||||
end
|
||||
@remaining_in_context = current_user.contexts.find(context_id).not_done_todo_count if @remaining_in_context.nil?
|
||||
end
|
||||
|
||||
def determine_completed_count
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue