diff --git a/tracks/app/controllers/feed_controller.rb b/tracks/app/controllers/feed_controller.rb index 24bb9f31..aebf2158 100644 --- a/tracks/app/controllers/feed_controller.rb +++ b/tracks/app/controllers/feed_controller.rb @@ -76,7 +76,11 @@ protected condition_builder = FindConditionBuilder.new options = Hash.new - condition_builder.add 'todos.done = ?', false + if params.key?('done') + condition_builder.add 'todos.done = ?', true + else + condition_builder.add 'todos.done = ?', false + end if params.key?('limit') options[:limit] = limit = params['limit'] @@ -94,6 +98,13 @@ protected @description << " with a due date #{due_within_date_s} or earlier" end + if params.key?('done') + done_in_last = params['done'].to_i + condition_builder.add('todos.completed >= ?', done_in_last.days.ago) + @title << " actions completed" + @description << " in the last #{done_in_last.to_s} days" + end + if params.key?('context') context = @user.contexts.find(params['context']) condition_builder.add('todos.context_id = ?', context.id) diff --git a/tracks/app/helpers/feed_helper.rb b/tracks/app/helpers/feed_helper.rb index ce07ee6c..b05f056d 100644 --- a/tracks/app/helpers/feed_helper.rb +++ b/tracks/app/helpers/feed_helper.rb @@ -11,8 +11,12 @@ module FeedHelper if item.context_id == context.id result_string << "\n" + context.name.upcase + ":\n" if result_string.empty? + if item.completed + result_string << " [Completed: " + format_date(item.completed) + "] " + end + if item.due - result_string << " [" + format_date(item.due) + "] " + result_string << " [Due: " + format_date(item.due) + "] " result_string << item.description + " " else result_string << " " + item.description + " " diff --git a/tracks/app/views/feed/rss.rxml b/tracks/app/views/feed/rss.rxml index 7f4eee01..84470254 100644 --- a/tracks/app/views/feed/rss.rxml +++ b/tracks/app/views/feed/rss.rxml @@ -9,13 +9,14 @@ xml.rss("version" => "2.0", "xmlns:dc" => "http://purl.org/dc/elements/1.1/") do xml.link(url_for(:only_path => false, :controller => 'context', :action => 'show', :name => urlize(i.context.name))) item_notes = sanitize(markdown( i.notes )) if i.notes? due = "
Due: #{format_date(i.due)}
\n" if i.due? + done = "
Completed: #{format_date(i.completed)}
\n" if i.completed? context_link = link_to( i.context.name, { :only_path => false, :controller => "context", :action => "show", :name => urlize(i.context.name) } ) project_link = if i.project_id? link_to (i.project.name, { :only_path => false, :controller => "project", :action => "show", :name => urlize(i.project.name)} ) else "none" end - xml.description("#{due||''}#{item_notes||''}\n
Project: #{project_link}
\n
Context: #{context_link}
") + xml.description("#{done||''}#{due||''}#{item_notes||''}\n
Project: #{project_link}
\n
Context: #{context_link}
") end } end diff --git a/tracks/app/views/todo/feeds.rhtml b/tracks/app/views/todo/feeds.rhtml index fd446dc6..863d9247 100644 --- a/tracks/app/views/todo/feeds.rhtml +++ b/tracks/app/views/todo/feeds.rhtml @@ -41,6 +41,11 @@ <%= ical_feed_link({ :due => 6 }) %> Actions due in 7 days or earlier +
  • + <%= rss_feed_link({ :done => 7 }) %> + <%= text_feed_link({ :done => 7 }) %> + Actions completed in the last 7 days +
  • <%= rss_feed_link({ :action => 'list_contexts_only', :feedtype => 'rss' }) %> <%= text_feed_link({ :action => 'list_contexts_only', :feedtype => 'text' }) %>