diff options
author | Eric Davis <edavis@littlestreamsoftware.com> | 2010-08-31 15:12:58 +0000 |
---|---|---|
committer | Eric Davis <edavis@littlestreamsoftware.com> | 2010-08-31 15:12:58 +0000 |
commit | daa8eaa9aebcc284e2904d1258cbfdd78ea23876 (patch) | |
tree | bf0238ae2199c787134a9f3bfdee2468c8832b82 /app/controllers/projects_controller.rb | |
parent | a188abbe2813372d426afd2ab05841f0503f00c1 (diff) | |
download | redmine-daa8eaa9aebcc284e2904d1258cbfdd78ea23876.tar.gz redmine-daa8eaa9aebcc284e2904d1258cbfdd78ea23876.zip |
Refactor: move method, ProjectsController#list_files to FilesController#index.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4051 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/projects_controller.rb')
-rw-r--r-- | app/controllers/projects_controller.rb | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 845ab3c15..05c8d969d 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -18,7 +18,7 @@ class ProjectsController < ApplicationController menu_item :overview menu_item :roadmap, :only => :roadmap - menu_item :files, :only => [:list_files, :add_file] + menu_item :files, :only => [:add_file] menu_item :settings, :only => :settings before_filter :find_project, :except => [ :index, :list, :add, :copy ] @@ -248,7 +248,7 @@ class ProjectsController < ApplicationController if !attachments.empty? && Setting.notified_events.include?('file_added') Mailer.deliver_attachments_added(attachments[:files]) end - redirect_to :controller => 'projects', :action => 'list_files', :id => @project + redirect_to :controller => 'files', :action => 'index', :id => @project return end @versions = @project.versions.sort @@ -275,18 +275,6 @@ class ProjectsController < ApplicationController redirect_to :controller => 'projects', :action => 'settings', :tab => 'activities', :id => @project end - def list_files - sort_init 'filename', 'asc' - sort_update 'filename' => "#{Attachment.table_name}.filename", - 'created_on' => "#{Attachment.table_name}.created_on", - 'size' => "#{Attachment.table_name}.filesize", - 'downloads' => "#{Attachment.table_name}.downloads" - - @containers = [ Project.find(@project.id, :include => :attachments, :order => sort_clause)] - @containers += @project.versions.find(:all, :include => :attachments, :order => sort_clause).sort.reverse - render :layout => !request.xhr? - end - private def find_optional_project return true unless params[:id] |