Fixed: wiki and changeset links not displayed when previewing issue description or notes.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1138 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2008-02-12 18:31:15 +00:00
parent c5d998528f
commit 30a7314b86
4 changed files with 5 additions and 4 deletions

View File

@ -21,7 +21,7 @@ class IssuesController < ApplicationController
before_filter :find_issue, :only => [:show, :edit, :destroy_attachment] before_filter :find_issue, :only => [:show, :edit, :destroy_attachment]
before_filter :find_issues, :only => [:bulk_edit, :move, :destroy] before_filter :find_issues, :only => [:bulk_edit, :move, :destroy]
before_filter :find_project, :only => [:new, :update_form] before_filter :find_project, :only => [:new, :update_form, :preview]
before_filter :authorize, :except => [:index, :changes, :preview, :update_form, :context_menu] before_filter :authorize, :except => [:index, :changes, :preview, :update_form, :context_menu]
before_filter :find_optional_project, :only => [:index, :changes] before_filter :find_optional_project, :only => [:index, :changes]
accept_key_auth :index, :changes accept_key_auth :index, :changes
@ -311,7 +311,7 @@ class IssuesController < ApplicationController
end end
def preview def preview
issue = Issue.find_by_id(params[:id]) issue = @project.issues.find_by_id(params[:id])
@attachements = issue.attachments if issue @attachements = issue.attachments if issue
@text = params[:notes] || (params[:issue] ? params[:issue][:description] : nil) @text = params[:notes] || (params[:issue] ? params[:issue][:description] : nil)
render :partial => 'common/preview' render :partial => 'common/preview'

View File

@ -34,6 +34,7 @@ private
def find_journal def find_journal
@journal = Journal.find(params[:id]) @journal = Journal.find(params[:id])
render_403 and return false unless @journal.editable_by?(User.current) render_403 and return false unless @journal.editable_by?(User.current)
@project = @journal.journalized.project
rescue ActiveRecord::RecordNotFound rescue ActiveRecord::RecordNotFound
render_404 render_404
end end

View File

@ -28,7 +28,7 @@
<%= f.hidden_field :lock_version %> <%= f.hidden_field :lock_version %>
<%= submit_tag l(:button_submit) %> <%= submit_tag l(:button_submit) %>
<%= link_to_remote l(:label_preview), <%= link_to_remote l(:label_preview),
{ :url => { :controller => 'issues', :action => 'preview', :id => @issue }, { :url => { :controller => 'issues', :action => 'preview', :project_id => @project, :id => @issue },
:method => 'post', :method => 'post',
:update => 'preview', :update => 'preview',
:with => 'Form.serialize("issue-form")', :with => 'Form.serialize("issue-form")',

View File

@ -8,7 +8,7 @@
</div> </div>
<%= submit_tag l(:button_create) %> <%= submit_tag l(:button_create) %>
<%= link_to_remote l(:label_preview), <%= link_to_remote l(:label_preview),
{ :url => { :controller => 'issues', :action => 'preview', :id => @issue }, { :url => { :controller => 'issues', :action => 'preview', :project_id => @project, :id => @issue },
:method => 'post', :method => 'post',
:update => 'preview', :update => 'preview',
:with => "Form.serialize('issue-form')", :with => "Form.serialize('issue-form')",