From cc001264fc2ede9c92c49ca5556a05287af87a95 Mon Sep 17 00:00:00 2001 From: bsag Date: Wed, 12 Oct 2005 12:51:14 +0000 Subject: [PATCH] Deleted projects and contexts now properly disappear in the Ajax 'fade' style when the delete button is clicked. References to context.reset and project.reset are replaced by the correct Form.reset. Also replaced all instances of Form.focus_first with the correct Form.focusFirstElement. Tidied up the edit forms on the projects and contexts pages. There's a weird visual bug in Safari (doesn't happen in Firefox), where the selected input box appears to be empty and unselected. However, if you type, your input will replace the previous text, and if you tab immediately to another field, you'll see that the input field was '''not''' actually empty. git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@150 a4c988fc-2ded-0310-b66e-134b36920a42 --- tracks/app/views/context/_context_form.rhtml | 17 +++++------ .../app/views/context/_context_listing.rhtml | 16 +++++----- tracks/app/views/context/list.rhtml | 2 +- tracks/app/views/context/show.rhtml | 2 +- tracks/app/views/project/_project_form.rhtml | 29 ++++++++----------- .../app/views/project/_project_listing.rhtml | 14 +++++---- tracks/app/views/project/list.rhtml | 2 +- tracks/app/views/project/show.rhtml | 2 +- tracks/doc/CHANGELOG | 1 + 9 files changed, 42 insertions(+), 43 deletions(-) diff --git a/tracks/app/views/context/_context_form.rhtml b/tracks/app/views/context/_context_form.rhtml index 20c22733..76ed4f3b 100644 --- a/tracks/app/views/context/_context_form.rhtml +++ b/tracks/app/views/context/_context_form.rhtml @@ -2,13 +2,12 @@ @context = context_form %> <%= error_messages_for 'context' %> -
- <%= @context.position %> -
-
- -<%= text_field 'context', 'name', :class => 'context-name' %> - -<%= check_box 'context', 'hide', :class => 'context-hide' %> -
+ + + <%= text_field 'context', 'name', :class => 'context-name' %> + + + + <%= check_box 'context', 'hide', :class => 'context-hide' %> + <% @context = nil %> \ No newline at end of file diff --git a/tracks/app/views/context/_context_listing.rhtml b/tracks/app/views/context/_context_listing.rhtml index af17241b..727797e7 100644 --- a/tracks/app/views/context/_context_listing.rhtml +++ b/tracks/app/views/context/_context_listing.rhtml @@ -19,10 +19,10 @@ <%= link_to_remote( image_tag("blank", :title =>"Delete context", :class=>"delete_item"), :update => "container_#{context.id}", - :loading => visual_effect(:fade, 'container_#{context.id}'), + :loading => visual_effect(:fade, "container_#{context.id}"), :url => { :controller => "context", :action => "destroy", :id => context.id }, :confirm => "Are you sure that you want to delete the context \'#{context.name}\'?" ) + " " + - link_to_function( image_tag( "blank", :title => "Edit context", :class=>"edit_item"), "Element.toggle('context-#{context.id}','context-#{context.id}-edit-form'); new Effect.Appear('context-#{context.id}-edit-form'); Form.focus_first('form-context-#{context.id}');" ) %> + link_to_function( image_tag( "blank", :title => "Edit context", :class=>"edit_item"), "Element.toggle('context-#{context.id}','context-#{context.id}-edit-form'); new Effect.Appear('context-#{context.id}-edit-form'); Form.focusFirstElement('form-context-#{context.id}');" ) %> @@ -31,14 +31,16 @@ :html => { :id => "form-context-#{context.id}", :class => "inline-form" }, :update => "container_#{context.id}", :complete => visual_effect(:appear, 'container_#{context.id}') %> + <%= render_partial 'context_form', context %> -
- - Cancel -
+ + + + +
  Cancel
<%= end_form_tag %> - + <% if controller.action_name == 'new_context' %>