diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-01-23 18:21:42 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-01-23 18:21:42 +0000 |
commit | 2d9e669e8541c591b488283416776378b8f69da9 (patch) | |
tree | 92f03258763edbd2a3798ab7497d4098ef3da677 | |
parent | d54ba39e7aced22dd352273ec4af4b345a827363 (diff) | |
download | redmine-2d9e669e8541c591b488283416776378b8f69da9.tar.gz redmine-2d9e669e8541c591b488283416776378b8f69da9.zip |
Added preview for issue notes.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1096 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | app/controllers/issues_controller.rb | 2 | ||||
-rw-r--r-- | app/views/issues/_update.rhtml | 14 | ||||
-rw-r--r-- | app/views/issues/show.rhtml | 1 |
3 files changed, 14 insertions, 3 deletions
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| %> <div class="box"> <% unless @status_options.empty? %> @@ -39,4 +41,14 @@ </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> 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 %> <div id="update" style="display:none;"> <h3><%= l(:button_update) %></h3> <%= render :partial => 'update' %> - <%= toggle_link l(:button_cancel), 'update' %> </div> <% end %> |