<% note = notes -%>
<div id="<%= dom_id(note, 'container') %>">
  <h2><%= link_to("Note #{note.id}", note_path(note), :title => "Show note #{note.id}" ) %></h2>
  <div id="<%= dom_id(note) %>">
    <%= sanitize(textilize(note.body)) %>

    <div class="note_footer">
      <%= link_to_remote( image_tag("blank.png", :title =>"Delete this note", :class=>"delete_item"), 
                          :update => dom_id(note),
                          :loading => visual_effect(:fade, dom_id(note, 'container')),
                          :complete => "Element.remove('#{dom_id(note, 'container')}');",
                          :url => note_path(note),
                          :method => :delete,
                          :confirm => "Are you sure that you want to delete the note \'#{note.id.to_s}\'?" ) + "&nbsp;" -%>
<%= link_to_function(image_tag( "blank.png", :title => "Edit item", :class=>"edit_item"),
                     "Element.toggle('#{dom_id(note)}'); Element.toggle('#{dom_id(note, 'edit')}'); Effect.Appear('#{dom_id(note, 'edit')}'); Form.focusFirstElement('#{dom_id(note, 'edit_form')}');" ) + " | " %>
      <%= link_to("In: " + note.project.name, project_path(note.project), :class=>"footer_link" ) %>&nbsp;|&nbsp;
      Created: <%= format_date(note.created_at) %>
      <% if note.updated_at? -%>
        &nbsp;|&nbsp;Modified: <%= format_date(note.updated_at) %>
      <% end -%>
    </div>
  </div>
  
  <div id="<%= dom_id(note, 'edit') %>" class="edit-form" style="display:none;">
    <% form_remote_tag  :url => note_path(note),
                      :method => :put,
                 :html => { :id => dom_id(note, 'edit_form'), :class => "inline-form" },
                 :update => dom_id(note, 'container'),
                 :complete => visual_effect(:appear, dom_id(note, 'container')) do -%>
      <%= render :partial => "note_edit_form", :object => note %>
    <% end -%>
  </div>
</div>
<% note = nil -%>
