From 49aac486166cac825f0a03b35d82a8e71ac06d23 Mon Sep 17 00:00:00 2001 From: Reinier Balt Date: Thu, 24 Jul 2008 21:06:10 +0200 Subject: [PATCH] add a txt ans rss feed for starred actions --- app/controllers/todos_controller.rb | 8 ++++++++ app/views/feedlist/index.html.erb | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/app/controllers/todos_controller.rb b/app/controllers/todos_controller.rb index a74146a8..ae745ab6 100644 --- a/app/controllers/todos_controller.rb +++ b/app/controllers/todos_controller.rb @@ -416,6 +416,14 @@ class TodosController < ApplicationController @title << " actions completed" @description << " in the last #{done_in_last.to_s} days" end + + if params.key?('tag') + tag = Tag.find_by_name(params['tag']) + if tag.nil? + tag = Tag.new(:name => params['tag']) + end + condition_builder.add('taggings.tag_id = ?', tag.id) + end Todo.send :with_scope, :find => {:conditions => condition_builder.to_conditions} do yield diff --git a/app/views/feedlist/index.html.erb b/app/views/feedlist/index.html.erb index 7c9ed482..8beace82 100644 --- a/app/views/feedlist/index.html.erb +++ b/app/views/feedlist/index.html.erb @@ -54,6 +54,11 @@ <%= text_formatted_link({:controller => 'projects', :action => 'index', :only_active_with_no_next_actions => true}) %> Active projects with no next actions +
  • + <%= rss_formatted_link({:controller => 'todos', :action => 'index', :tag => 'starred'}) %> + <%= text_formatted_link({:controller => 'todos', :action => 'index', :tag => 'starred'}) %> + All starred, active actions +
  • <%= text_formatted_link({:controller => 'projects', :action => 'index', :projects_and_actions => true}) %> Active projects with their actions