tracks/app/views/notes/_notes.rhtml
Marcus Ilgner fd3f69d927 Changed code to support basic i18n.
Added RubyMine configuration and rvm setup to .gitignore.
2010-11-09 16:31:26 +08:00

36 lines
1.8 KiB
Text

<% note = notes -%>
<div id="<%= dom_id(note, 'container') %>">
<h2><%= link_to(t('notes.note_header', :id => note.id.to_s), note_path(note), :title => t('notes.note_link_title', :id => note.id.to_s)) %></h2>
<div class="project_notes" id="<%= dom_id(note) %>">
<%= format_note(note.body) %>
<div class="note_footer">
<%= link_to_remote(
image_tag("blank.png", :title =>t('notes.delete_note_title'), :class=>"delete_item", :id => "delete_note_"+note.id.to_s),
:url => note_path(note),
:html => {:class => 'delete_note', :title => "delete note"},
:method => :delete,
:confirm => t('notes.delete_confirmation', :id => note.id.to_s),
:before => visual_effect(:fade, dom_id(note, 'container'))) -%>&nbsp;
<%= link_to_function(image_tag( "blank.png", :title => t('notes.edit_item_title'), :class=>"edit_item"),
"$('##{dom_id(note)}').toggle(); $('##{dom_id(note, 'edit')}').show(); $('##{dom_id(note, 'edit_form')} textarea').focus();" ) + " | " %>
<%= link_to("In: " + note.project.name, project_path(note.project), :class=>"footer_link" ) %>&nbsp;|&nbsp;
<%= Note.human_attribute_name('created_at') %>: <%= format_date(note.created_at) %>
<% if note.updated_at? -%>
&nbsp;|&nbsp;<%= Note.human_attribute_name('updated_at') %>: <%= 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 => "notes/note_edit_form", :object => note %>
<% end -%>
</div>
</div>
<% note = nil -%>