tracks/tracks/app/helpers/feed_helper.rb
bsag ec3ee77797 Initial import
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@1 a4c988fc-2ded-0310-b66e-134b36920a42
2005-01-09 11:59:57 +00:00

34 lines
875 B
Ruby

module FeedHelper
# Build a nicely formatted text string for display
# Context forms the heading, then the items are
# indented underneath. If there is a due date
# and the item is in a project, these are also displayed
#
def build_text_page(list,contexts,projects)
result_string = ""
for @place in @places
result_string << "\n" + @place.name.upcase + ":\n"
list.each do |@item|
if @item.context_id == @place.id
if @item.due
result_string << " [" + format_date(@item.due) + "] "
result_string << @item.description + " "
else
result_string << " " + @item.description + " "
end
if @item.project_id
result_string << "(" + @item.project['name'] + ")"
end
result_string << "\n"
end
end
end
return result_string
end
end