diff app/views/journals/_notes_form.rhtml @ 441:cbce1fd3b1b7 redmine-1.2

Update to Redmine 1.2-stable branch (Redmine SVN rev 6000)
author Chris Cannam
date Mon, 06 Jun 2011 14:24:13 +0100
parents 513646585e45
children
line wrap: on
line diff
--- a/app/views/journals/_notes_form.rhtml	Thu Mar 03 11:42:28 2011 +0000
+++ b/app/views/journals/_notes_form.rhtml	Mon Jun 06 14:24:13 2011 +0100
@@ -1,8 +1,21 @@
 <% form_remote_tag(:url => {}, :html => { :id => "journal-#{@journal.id}-form" }) do %>
-    <%= text_area_tag :notes, @journal.notes, :class => 'wiki-edit', 
-                                              :rows => (@journal.notes.blank? ? 10 : [[10, @journal.notes.length / 50].max, 100].min) %>
+    <%= text_area_tag :notes, @journal.notes,
+          :id => "journal_#{@journal.id}_notes",
+          :class => 'wiki-edit', 
+          :rows => (@journal.notes.blank? ? 10 : [[10, @journal.notes.length / 50].max, 100].min) %>
     <%= call_hook(:view_journals_notes_form_after_notes, { :journal => @journal}) %>
     <p><%= submit_tag l(:button_save) %>
+    <%= link_to_remote l(:label_preview), 
+                       { :url => preview_issue_path(:project_id => @project, :id => @journal.issue),
+                         :method => 'post',
+                         :update => "journal_#{@journal.id}_preview",
+                         :with => "Form.serialize('journal-#{@journal.id}-form')",
+                         :complete => "Element.scrollTo('journal_#{@journal.id}_preview')"
+                       }, :accesskey => accesskey(:preview) %>
+    |
     <%= link_to l(:button_cancel), '#', :onclick => "Element.remove('journal-#{@journal.id}-form'); " +
                                                     "Element.show('journal-#{@journal.id}-notes'); return false;" %></p>
+
+    <div id="journal_<%= @journal.id %>_preview" class="wiki"></div>
 <% end %>
+<%= wikitoolbar_for "journal_#{@journal.id}_notes" %>