From 5259dec0611a00c84b4ae7f460202c761abec5f9 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 6 Oct 2007 08:54:05 +0000 Subject: Added preview on add/edit issue form. git-svn-id: http://redmine.rubyforge.org/svn/trunk@812 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/issues_controller.rb | 9 ++++++++- app/controllers/wiki_controller.rb | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'app/controllers') diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index d8fd95b6a..1f983419f 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -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]) diff --git a/app/controllers/wiki_controller.rb b/app/controllers/wiki_controller.rb index e3c9ed202..fe53e63f2 100644 --- a/app/controllers/wiki_controller.rb +++ b/app/controllers/wiki_controller.rb @@ -144,7 +144,7 @@ class WikiController < ApplicationController page = @wiki.find_page(params[:page]) @attachements = page.attachments if page @text = params[:content][:text] - render :partial => 'preview' + render :partial => 'common/preview' end def add_attachment -- cgit v1.2.3