diff --git a/tracks/app/views/shared/_add_new_item_form.rhtml b/tracks/app/views/shared/_add_new_item_form.rhtml
index 425e4ab9..93c902f4 100644
--- a/tracks/app/views/shared/_add_new_item_form.rhtml
+++ b/tracks/app/views/shared/_add_new_item_form.rhtml
@@ -49,7 +49,7 @@
<% unless controller.controller_name == "project" -%>
- <%= collection_select( "todo", "project_id", @projects, "id", "name",
+ <%= collection_select( "todo", "project_id", @projects.reject{|p| p.done}, "id", "name",
{ :include_blank => true }, {"tabindex" => 4}) %>
<% end -%>
diff --git a/tracks/app/views/shared/sidebar.rhtml b/tracks/app/views/shared/sidebar.rhtml
index 4164b3a0..f15c090f 100644
--- a/tracks/app/views/shared/sidebar.rhtml
+++ b/tracks/app/views/shared/sidebar.rhtml
@@ -1,6 +1,6 @@
Active Projects:
- <% for project in @projects.collect { |x| x.done? ? nil:x }.compact -%>
+ <% for project in @projects.reject{|p| p.done } -%>
- <%= link_to( sanitize(project.name), { :controller => "project", :action => "show",
:name => urlize(project.name) } ) + " (" + project.count_undone_todos("actions") + ")" %>
<% end -%>
@@ -8,7 +8,7 @@
Completed Projects:
- <% for project in @projects.collect { |x| x.done? ? x:nil }.compact -%>
+ <% for project in @projects.reject{|p| !p.done } -%>
- <%= link_to( sanitize(project.name), { :controller => "project", :action => "show",
:name => urlize(project.name) } ) + " (" + project.count_undone_todos("actions") + ")" %>
<% end -%>
@@ -16,7 +16,7 @@
Active Contexts:
- <% for context in @contexts.collect { |x| x.hide? ? nil:x }.compact -%>
+ <% for context in @contexts.reject{|c| c.hide } -%>
- <%= link_to( sanitize(context.name), { :controller => "context", :action => "show",
:name => urlize(context.name) } ) + " (" + context.count_undone_todos("actions") + ")" %>
<% end -%>
@@ -24,7 +24,7 @@
Hidden Contexts:
- <% for context in @contexts.collect { |x| x.hide? ? x:nil }.compact -%>
+ <% for context in @contexts.reject{|c| !c.hide } -%>
- <%= link_to( sanitize(context.name), { :controller => "context", :action => "show",
:name => urlize(context.name) } ) + " (" + context.count_undone_todos("actions") + ")" %>
<% end -%>