Refactor: move method, ProjectsController#add_file to FilesController#new.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4052 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Eric Davis
2010-09-01 15:17:45 +00:00
parent daa8eaa9ae
commit b5e90972d8
9 changed files with 60 additions and 59 deletions
-16
View File
@@ -18,7 +18,6 @@
class ProjectsController < ApplicationController
menu_item :overview
menu_item :roadmap, :only => :roadmap
menu_item :files, :only => [:add_file]
menu_item :settings, :only => :settings
before_filter :find_project, :except => [ :index, :list, :add, :copy ]
@@ -239,21 +238,6 @@ class ProjectsController < ApplicationController
@project = nil
end
def add_file
if request.post?
container = (params[:version_id].blank? ? @project : @project.versions.find_by_id(params[:version_id]))
attachments = Attachment.attach_files(container, params[:attachments])
render_attachment_warning_if_needed(container)
if !attachments.empty? && Setting.notified_events.include?('file_added')
Mailer.deliver_attachments_added(attachments[:files])
end
redirect_to :controller => 'files', :action => 'index', :id => @project
return
end
@versions = @project.versions.sort
end
def save_activities
if request.post? && params[:enumerations]
Project.transaction do