diff --git a/tracks/app/views/context/show.rhtml b/tracks/app/views/context/show.rhtml
index ceb33fdb..bafd2b5c 100644
--- a/tracks/app/views/context/show.rhtml
+++ b/tracks/app/views/context/show.rhtml
@@ -32,35 +32,7 @@
diff --git a/tracks/app/views/project/_show_items.rhtml b/tracks/app/views/project/_show_items.rhtml
index f25af32d..bdb7ea81 100644
--- a/tracks/app/views/project/_show_items.rhtml
+++ b/tracks/app/views/project/_show_items.rhtml
@@ -51,7 +51,6 @@
:update => "item-#{item.id}-container",
:complete => "new Effect.Appear('item-#{item.id}-container', true);" %>
<%= render_partial 'todo/action_edit_form', item %>
-
<%= end_form_tag %>
diff --git a/tracks/app/views/project/show.rhtml b/tracks/app/views/project/show.rhtml
index 1d3c64f8..68496e35 100644
--- a/tracks/app/views/project/show.rhtml
+++ b/tracks/app/views/project/show.rhtml
@@ -64,35 +64,7 @@
diff --git a/tracks/app/views/shared/add_new_item_form.rhtml b/tracks/app/views/shared/add_new_item_form.rhtml
index 4e4a9ae2..4a216ea5 100644
--- a/tracks/app/views/shared/add_new_item_form.rhtml
+++ b/tracks/app/views/shared/add_new_item_form.rhtml
@@ -2,10 +2,13 @@
case controller.controller_name
when "context"
add_string = "Add a next action in this context »"
+ update_div = "next_actions"
when "project"
add_string = "Add a next action in this project »"
+ update_div = "next_actions"
else
add_string = "Add a next action »"
+ update_div = "new_actions"
end
%>
@@ -18,7 +21,7 @@
<%= form_remote_tag(
:url => { :controller => "todo", :action => "add_item" },
- :update => "new_actions",
+ :update => update_div,
:position=> "bottom",
:complete => "Form.focusFirstElement('todo-form-new-action');Form.reset('todo-form-new-action');",
:html=> { :id=>'todo-form-new-action', :name=>'todo', :class => 'inline-form' }) %>
@@ -29,16 +32,27 @@
Notes
<%= text_area( "new_item", "notes", "cols" => 25, "rows" => 10, "tabindex" => 2) %>
- Context
- <%= collection_select( "new_item", "context_id", @contexts, "id", "name",
- {}, {"tabindex" => 3}) %>
+ <% unless controller.controller_name == "context" -%>
+ Context
+ <%= collection_select( "new_item", "context_id", @contexts, "id", "name",
+ {}, {"tabindex" => 3}) %>
+ <% end -%>
- Project
- <%= collection_select( "new_item", "project_id", @projects, "id", "name",
- { :include_blank => true }, {"tabindex" => 4}) %>
+ <% unless controller.controller_name == "project" -%>
+ Project
+ <%= collection_select( "new_item", "project_id", @projects, "id", "name",
+ { :include_blank => true }, {"tabindex" => 4}) %>
+ <% end -%>
Due
<%= text_field("new_item", "due", "size" => 10, "class" => "Date", "onFocus" => "Calendar.setup", "tabindex" => 5) %>
+
+ <% if controller.controller_name == "project" -%>
+ <%= hidden_field( "new_item", "project_id", "value" => "#{@project.id}") %>
+
+ <% elsif controller.controller_name == "context" -%>
+ <%= hidden_field( "new_item", "context_id", "value" => "#{@context.id}") %>
+ <% end -%>
<%= end_form_tag %>
diff --git a/tracks/app/views/todo/_action_edit_form.rhtml b/tracks/app/views/todo/_action_edit_form.rhtml
index e9053865..643f26dd 100644
--- a/tracks/app/views/todo/_action_edit_form.rhtml
+++ b/tracks/app/views/todo/_action_edit_form.rhtml
@@ -48,6 +48,9 @@
+ <% if controller.controller_name == "project" %>
+
+ <% end -%>
Cancel
diff --git a/tracks/app/views/todo/_item.rhtml b/tracks/app/views/todo/_item.rhtml
index c3ef0f56..b31636b9 100644
--- a/tracks/app/views/todo/_item.rhtml
+++ b/tracks/app/views/todo/_item.rhtml
@@ -17,7 +17,7 @@
<%= due_date( item.due ) %>
<%= sanitize(item.description) %>
- <% if @params["project"] == true %>
+ <% if @params["project"] == "true" %>
<%= link_to( "[C]", { :controller => "context", :action => "show", :name => urlize(item.context.name) }, :title => "View context: #{item.context.name}" ) %>
<% else %>
<% if item.project_id %>
diff --git a/tracks/config/environment.rb b/tracks/config/environment.rb
index eaed51a4..8d879ef3 100644
--- a/tracks/config/environment.rb
+++ b/tracks/config/environment.rb
@@ -34,7 +34,7 @@ Rails::Initializer.run do |config|
# Use Active Record's schema dumper instead of SQL when creating the test database
# (enables use of different database adapters for development and test environments)
- # config.active_record.schema_format = :ruby
+ config.active_record.schema_format = :ruby
# See Rails::Configuration for more options
end