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

View file

@ -28,6 +28,7 @@ Wiki (deprecated - please use Trac): http://www.rousette.org.uk/projects/wiki/
11. Included a new rake task. Call it with <tt>rake setup_tracks</tt> at the command line. This automates a lot of the work of setting up tracks, like renaming the template files (*.tmpl). However, you need to make sure that you've copied database.yml.tmpl to database.yml before you run it (and added the correct settings to the file), because rake can't run without that file in place. The task is safe to run if you're upgrading, because it ignores already converted files.
12. Changed the shebang lines to <tt>#!/usr/bin/env ruby</tt>. This should work for all *nix based setups (Linux or Mac OS X), but Windows users will probably have to change it. Try this command at the command line, run inside the Tracks directory:
ruby -i.bak -pe 'gsub!("#!/usr/bin/env ruby", "#!c:/ruby/bin/ruby")' public/dispatch.* script/*
13. The TXT view is now sorted by position, just as the home page is.
== Version 1.03