mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-17 20:58:09 +01:00
fix #1268. The default context in the new todo form on the home page is now the first active context
Instead of the first context that could be hidden and thus appear random. Also fix setting the default context based on the project you select.
This commit is contained in:
parent
90c80c4330
commit
c7637053e1
3 changed files with 7 additions and 5 deletions
|
|
@ -1,4 +1,5 @@
|
|||
module TodosHelper
|
||||
|
||||
|
||||
def remote_star_icon(todo=@todo)
|
||||
link_to( image_tag_for_star(todo),
|
||||
|
|
@ -272,7 +273,7 @@ module TodosHelper
|
|||
end
|
||||
|
||||
def default_contexts_for_autocomplete
|
||||
projects = current_user.uncompleted.projects.find(:all, :include => [:context], :conditions => ['default_context_id is not null'])
|
||||
projects = current_user.projects.uncompleted.find(:all, :include => [:default_context], :conditions => ['NOT(default_context_id IS NULL)'])
|
||||
Hash[*projects.map{ |p| [escape_javascript(p.name), escape_javascript(p.default_context.name)] }.flatten].to_json
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue