def preview
issue = Issue.find_by_id(params[:id])
@attachements = issue.attachments if issue
- @text = params[:issue][:description]
+ @text = (params[:issue] ? params[:issue][:description] : nil) || params[:notes]
render :partial => 'common/preview'
end
-<% labelled_tabular_form_for(:issue, @issue, :url => {:action => 'update', :id => @issue}, :html => {:multipart => true}) do |f| %>
+<% labelled_tabular_form_for(:issue, @issue, :url => {:action => 'update', :id => @issue},
+ :html => {:multipart => true,
+ :id => 'issue-form'}) do |f| %>
<div class="box">
<% unless @status_options.empty? %>
</div>
<%= submit_tag l(:button_submit) %>
+<%= link_to_remote l(:label_preview),
+ { :url => { :controller => 'issues', :action => 'preview', :id => @issue },
+ :method => 'post',
+ :update => 'preview',
+ :with => "Form.serialize('issue-form')",
+ :complete => "window.location.hash='preview'"
+ }, :accesskey => accesskey(:preview) %> |
+<%= toggle_link l(:button_cancel), 'update' %>
<% end %>
+
+<div id="preview" class="wiki"></div>
<div id="update" style="display:none;">
<h3><%= l(:button_update) %></h3>
<%= render :partial => 'update' %>
- <%= toggle_link l(:button_cancel), 'update' %>
</div>
<% end %>