From: Jean-Philippe Lang Date: Wed, 23 Jan 2008 18:21:42 +0000 (+0000) Subject: Added preview for issue notes. X-Git-Tag: 0.7.0-RC1~190 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2d9e669e8541c591b488283416776378b8f69da9;p=redmine.git Added preview for issue notes. git-svn-id: http://redmine.rubyforge.org/svn/trunk@1096 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 643a4e0ef..fdece9e1a 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -242,7 +242,7 @@ class IssuesController < ApplicationController 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 diff --git a/app/views/issues/_update.rhtml b/app/views/issues/_update.rhtml index 3cf593806..49d1473d9 100644 --- a/app/views/issues/_update.rhtml +++ b/app/views/issues/_update.rhtml @@ -1,4 +1,6 @@ -<% 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| %>
<% unless @status_options.empty? %> @@ -39,4 +41,14 @@
<%= 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 %> + +
diff --git a/app/views/issues/show.rhtml b/app/views/issues/show.rhtml index 45423a2e0..d29b1b88f 100644 --- a/app/views/issues/show.rhtml +++ b/app/views/issues/show.rhtml @@ -94,7 +94,6 @@ end %> <% end %>