The TXT view now sorts contexts by position (hidden contexts are hidden), just as on the home page.

Fixes #118.


git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@144 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
bsag 2005-09-27 17:25:54 +00:00
parent e392123933
commit a8c7c73428
2 changed files with 6 additions and 3 deletions

View file

@ -20,13 +20,15 @@ class FeedController < ApplicationController
end
# Builds a plain text page listing all the next actions,
# sorted by context. Showing notes doesn't make much sense here
# so they are omitted. You can use this with GeekTool to get your next actions
# sorted by context (contexts are sorted by position, as on the home page).
# Showing notes doesn't make much sense here so they are omitted.
# Hidden contexts are also hidden in the text view
# You can use this with GeekTool to get your next actions
# on the desktop:
# curl [url from "TXT" link on todo/list]
#
def na_text
@contexts = @user.contexts
@contexts = @user.contexts.collect { |x| x.hide? ? nil:x }.compact.sort! { |x,y| x.position <=> y.position }
@not_done = @user.todos.collect { |x| x.done? ? nil:x }.compact.sort! {|x,y| x.context_id <=> y.context_id }
@headers["Content-Type"] = "text/plain; charset=utf-8"
end