tracks/tracks/app/views/note/_notes.rhtml
lukemelia a65e66168c Consolidate list and index actions in project and context controllers.
Use simply_helpful methods to simplify DOM IDs.
Improve CSS rendering on IE7. (didn't get to test these changes on Safari!)
Make new contexts appear automatically when added with new action on home page.


git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@384 a4c988fc-2ded-0310-b66e-134b36920a42
2006-12-30 08:51:49 +00:00

34 lines
2 KiB
Text

<% note = notes -%>
<div id="note-<%= note.id.to_s %>-container">
<h2><%= link_to("Note #{note.id.to_s}", {:action => "show", :id => note.id}, :title => "Show note #{note.id.to_s}" ) %></h2>
<div id="note-<%= note.id.to_s %>">
<%= sanitize(textilize(note.body)) %>
<div class="note_footer">
<%= link_to_remote( image_tag("blank.png", :title =>"Delete this note", :class=>"delete_item"),
:update => "note-#{note.id}",
:loading => visual_effect(:fade, "note-#{note.id}-container"),
:complete => "Element.remove('note-#{note.id}-wrapper');",
:url => { :controller => "note", :action => "delete", :id => note.id },
: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('note-#{note.id}'); Element.toggle('note-#{note.id}-edit-form'); Effect.Appear('note-#{note.id}-edit-form'); Form.focusFirstElement('form-note-#{note.id}');" ) + " | " %>
<%= link_to("In: " + note.project.name, {:controller => "project", :action => "show", :url_friendly_name => note.project.url_friendly_name}, :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><!-- [end.note.id] -->
<div id="note-<%= note.id %>-edit-form" class="edit-form" style="display:none;">
<% form_remote_tag :url => { :action => 'update', :id => note.id },
:html => { :id => "form-note-#{note.id}", :class => "inline-form" },
:update => "note-#{note.id}-container",
:complete => visual_effect(:appear, "note-#{note.id}-container") do -%>
<%= render :partial => "note_edit_form", :object => note %>
<% end -%>
</div><!-- [end:note-note.id-edit-form] -->
</div><!-- [end.note-note.id-container] -->
<% note = nil -%>