diff --git a/tracks/app/helpers/application_helper.rb b/tracks/app/helpers/application_helper.rb index be708224..cd12a99f 100644 --- a/tracks/app/helpers/application_helper.rb +++ b/tracks/app/helpers/application_helper.rb @@ -111,4 +111,5 @@ module ApplicationHelper "" + format_date(due) + "" end end + end diff --git a/tracks/app/views/shared/_add_new_item_form.rhtml b/tracks/app/views/shared/_add_new_item_form.rhtml index 8c9c4916..4bb32da8 100644 --- a/tracks/app/views/shared/_add_new_item_form.rhtml +++ b/tracks/app/views/shared/_add_new_item_form.rhtml @@ -2,10 +2,16 @@ case controller.controller_name when "context" add_string = "Add a next action in this context »" + @selected_context = @context.id + @selected_project = nil when "project" add_string = "Add a next action in this project »" + @selected_context = @contexts[0].id + @selected_project = @project.id else add_string = "Add a next action »" + @selected_context = @contexts[0].id + @selected_project = nil end if @on_page == "tickler" @@ -41,27 +47,18 @@
<%= text_area( "todo", "notes", "cols" => 25, "rows" => 10, "tabindex" => 2) %>
-<% unless controller.controller_name == "context" -%> -
- <%= collection_select( "todo", "context_id", @contexts, "id", "name", - {}, {"tabindex" => 3}) %>
-<% end -%> +
+ <%= select("todo", "context_id", @contexts.collect {|c| [c.name, c.id] }, { :selected => @selected_context }, {"tabindex" => 3}) %> +
-<% unless controller.controller_name == "project" -%> -
- <%= collection_select( "todo", "project_id", @projects.reject{|p| p.done?}, "id", "name", - { :include_blank => true }, {"tabindex" => 4}) %>
-<% end -%> +
+ <%= select( "todo", "project_id", @projects.reject{|x| x.done? }.collect {|p| [p.name, p.id] }, + { :selected => @selected_project, :include_blank => true }, {"tabindex" => 4}) %> +

<%= text_field("todo", "due", "size" => 10, "class" => "Date", "onFocus" => "Calendar.setup", "tabindex" => 5, "autocomplete" => "off") %> -<% if controller.controller_name == "project" -%> - <%= hidden_field( "todo", "project_id", "value" => "#{@project.id}") %> -<% elsif controller.controller_name == "context" -%> - <%= hidden_field( "todo", "context_id", "value" => "#{@context.id}") %> -<% end -%> - <% if @on_page == "tickler" -%>

<%= text_field("todo", "show_from", "size" => 10, "class" => "Date", "onFocus" => "Calendar.setup", "tabindex" => 5, "autocomplete" => "off") %>
diff --git a/tracks/vendor/rails/actionpack/lib/action_view/helpers/form_options_helper.rb b/tracks/vendor/rails/actionpack/lib/action_view/helpers/form_options_helper.rb index 53b39305..3e0b6942 100644 --- a/tracks/vendor/rails/actionpack/lib/action_view/helpers/form_options_helper.rb +++ b/tracks/vendor/rails/actionpack/lib/action_view/helpers/form_options_helper.rb @@ -310,7 +310,7 @@ module ActionView "select", add_options(options_from_collection_for_select(collection, value_method, text_method, value), options, value), html_options ) end - + def to_country_select_tag(priority_countries, options, html_options) html_options = html_options.stringify_keys add_default_name_and_id(html_options)