@@ -21,7 +21,7 class IssuesController < ApplicationController | |||||
21 |
|
21 | |||
22 | before_filter :find_issue, :only => [:show, :edit, :destroy_attachment] |
|
22 | before_filter :find_issue, :only => [:show, :edit, :destroy_attachment] | |
23 | before_filter :find_issues, :only => [:bulk_edit, :move, :destroy] |
|
23 | before_filter :find_issues, :only => [:bulk_edit, :move, :destroy] | |
24 | before_filter :find_project, :only => [:new, :update_form] |
|
24 | before_filter :find_project, :only => [:new, :update_form, :preview] | |
25 | before_filter :authorize, :except => [:index, :changes, :preview, :update_form, :context_menu] |
|
25 | before_filter :authorize, :except => [:index, :changes, :preview, :update_form, :context_menu] | |
26 | before_filter :find_optional_project, :only => [:index, :changes] |
|
26 | before_filter :find_optional_project, :only => [:index, :changes] | |
27 | accept_key_auth :index, :changes |
|
27 | accept_key_auth :index, :changes | |
@@ -311,7 +311,7 class IssuesController < ApplicationController | |||||
311 | end |
|
311 | end | |
312 |
|
312 | |||
313 | def preview |
|
313 | def preview | |
314 |
issue = |
|
314 | issue = @project.issues.find_by_id(params[:id]) | |
315 | @attachements = issue.attachments if issue |
|
315 | @attachements = issue.attachments if issue | |
316 | @text = params[:notes] || (params[:issue] ? params[:issue][:description] : nil) |
|
316 | @text = params[:notes] || (params[:issue] ? params[:issue][:description] : nil) | |
317 | render :partial => 'common/preview' |
|
317 | render :partial => 'common/preview' |
@@ -34,6 +34,7 private | |||||
34 | def find_journal |
|
34 | def find_journal | |
35 | @journal = Journal.find(params[:id]) |
|
35 | @journal = Journal.find(params[:id]) | |
36 | render_403 and return false unless @journal.editable_by?(User.current) |
|
36 | render_403 and return false unless @journal.editable_by?(User.current) | |
|
37 | @project = @journal.journalized.project | |||
37 | rescue ActiveRecord::RecordNotFound |
|
38 | rescue ActiveRecord::RecordNotFound | |
38 | render_404 |
|
39 | render_404 | |
39 | end |
|
40 | end |
@@ -28,7 +28,7 | |||||
28 | <%= f.hidden_field :lock_version %> |
|
28 | <%= f.hidden_field :lock_version %> | |
29 | <%= submit_tag l(:button_submit) %> |
|
29 | <%= submit_tag l(:button_submit) %> | |
30 | <%= link_to_remote l(:label_preview), |
|
30 | <%= link_to_remote l(:label_preview), | |
31 | { :url => { :controller => 'issues', :action => 'preview', :id => @issue }, |
|
31 | { :url => { :controller => 'issues', :action => 'preview', :project_id => @project, :id => @issue }, | |
32 | :method => 'post', |
|
32 | :method => 'post', | |
33 | :update => 'preview', |
|
33 | :update => 'preview', | |
34 | :with => 'Form.serialize("issue-form")', |
|
34 | :with => 'Form.serialize("issue-form")', |
@@ -8,7 +8,7 | |||||
8 | </div> |
|
8 | </div> | |
9 | <%= submit_tag l(:button_create) %> |
|
9 | <%= submit_tag l(:button_create) %> | |
10 | <%= link_to_remote l(:label_preview), |
|
10 | <%= link_to_remote l(:label_preview), | |
11 | { :url => { :controller => 'issues', :action => 'preview', :id => @issue }, |
|
11 | { :url => { :controller => 'issues', :action => 'preview', :project_id => @project, :id => @issue }, | |
12 | :method => 'post', |
|
12 | :method => 'post', | |
13 | :update => 'preview', |
|
13 | :update => 'preview', | |
14 | :with => "Form.serialize('issue-form')", |
|
14 | :with => "Form.serialize('issue-form')", |
General Comments 0
You need to be logged in to leave comments.
Login now