mirror of
https://github.com/TracksApp/tracks.git
synced 2026-03-03 19:40:15 +01:00
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@9 a4c988fc-2ded-0310-b66e-134b36920a42
34 lines
1,006 B
Ruby
34 lines
1,006 B
Ruby
# Produces an feeds of the next actions, both RSS and plain text
|
|
#
|
|
class FeedController < ApplicationController
|
|
|
|
helper :feed
|
|
model :todo, :context, :project
|
|
before_filter :login_required
|
|
|
|
def index
|
|
end
|
|
|
|
# Builds an RSS feed for the latest 15 items
|
|
# This is fairly basic: it lists the action description as the title
|
|
# and the item context as the description
|
|
#
|
|
def na_feed
|
|
@not_done = Todo.find_all( "done=0", "created DESC" )
|
|
@headers["Content-Type"] = "text/xml; charset=utf-8"
|
|
end
|
|
|
|
# Builds a plain text page listing all the next actions,
|
|
# sorted by context. Showing notes doesn' make much sense here
|
|
# so they are omitted. You can use this with GeekTool to get your next actions
|
|
# on the desktop:
|
|
# curl http://url_for_the_app/feed/na_text
|
|
#
|
|
def na_text
|
|
@places = Context.find_all
|
|
@projects = Project.find_all
|
|
@not_done = Todo.find_all( "done=0", "context_id ASC" )
|
|
@headers["Content-Type"] = "text/plain; charset=utf-8"
|
|
end
|
|
|
|
end
|