Added preview for issue notes.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1096 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2008-01-23 18:21:42 +00:00
parent d54ba39e7a
commit 2d9e669e85
3 changed files with 14 additions and 3 deletions

View File

@ -242,7 +242,7 @@ class IssuesController < ApplicationController
def preview def preview
issue = Issue.find_by_id(params[:id]) issue = Issue.find_by_id(params[:id])
@attachements = issue.attachments if issue @attachements = issue.attachments if issue
@text = params[:issue][:description] @text = (params[:issue] ? params[:issue][:description] : nil) || params[:notes]
render :partial => 'common/preview' render :partial => 'common/preview'
end end

View File

@ -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"> <div class="box">
<% unless @status_options.empty? %> <% unless @status_options.empty? %>
@ -39,4 +41,14 @@
</div> </div>
<%= submit_tag l(:button_submit) %> <%= 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 %> <% end %>
<div id="preview" class="wiki"></div>

View File

@ -94,7 +94,6 @@ end %>
<div id="update" style="display:none;"> <div id="update" style="display:none;">
<h3><%= l(:button_update) %></h3> <h3><%= l(:button_update) %></h3>
<%= render :partial => 'update' %> <%= render :partial => 'update' %>
<%= toggle_link l(:button_cancel), 'update' %>
</div> </div>
<% end %> <% end %>