Added preview on add/edit issue form.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@812 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2007-10-06 08:54:05 +00:00
parent 75c4c4f6b3
commit 5259dec061
7 changed files with 42 additions and 5 deletions
+8 -1
View File
@@ -17,7 +17,7 @@
class IssuesController < ApplicationController
layout 'base', :except => :export_pdf
before_filter :find_project, :authorize, :except => :index
before_filter :find_project, :authorize, :except => [:index, :preview]
accept_key_auth :index
cache_sweeper :issue_sweeper, :only => [ :edit, :change_status, :destroy ]
@@ -167,6 +167,13 @@ class IssuesController < ApplicationController
redirect_to :action => 'show', :id => @issue
end
def preview
issue = Issue.find_by_id(params[:id])
@attachements = issue.attachments if issue
@text = params[:issue][:description]
render :partial => 'common/preview'
end
private
def find_project
@issue = Issue.find(params[:id], :include => [:project, :tracker, :status, :author, :priority, :category])