tracks/app/views/todos/_text_todo.rhtml
Andreas Brandl f15017c972 Decode HTML entities when displaying todos formatted as TXT.
When rendering the text-feed for todos (_text_todo.rhtml) this
uses localized string 'as-is'. Those are html-encoded which
is not appropriate for TXT feeds (e.g. 'todos.due' is 'Fällig'
in German locale).
2011-09-27 01:07:02 +02:00

28 lines
626 B
Text

<%
require 'htmlentities'
htmlentities = HTMLEntities.new
todo = text_todo
if (todo.starred?)
result_string = " * "
else
result_string = " - "
end
if (todo.completed?) && todo.completed_at
result_string << "["+ htmlentities.decode(t('todos.completed')) +": " + format_date(todo.completed_at) + "] "
end
if todo.due
result_string << "[" + htmlentities.decode(t('todos.due')) + ": " + format_date(todo.due) + "] "
result_string << todo.description + " "
else
result_string << todo.description + " "
end
unless todo.project.nil?
result_string << "(" + todo.project.name + ")"
end
-%><%= result_string -%>