diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-01-31 21:18:43 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-01-31 21:18:43 +0000 |
commit | fa688d48e673abfa8711beb69995aaf3d41069d1 (patch) | |
tree | b86c5494839673b615cb2d99aac8a861067fd10d /app/controllers/trackers_controller.rb | |
parent | 671a0fa10161ead2ec0fef888710cf7d872b2f61 (diff) | |
download | redmine-fa688d48e673abfa8711beb69995aaf3d41069d1.tar.gz redmine-fa688d48e673abfa8711beb69995aaf3d41069d1.zip |
added the ability to set the sort order for trackers
git-svn-id: http://redmine.rubyforge.org/svn/trunk@209 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/trackers_controller.rb')
-rw-r--r-- | app/controllers/trackers_controller.rb | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/app/controllers/trackers_controller.rb b/app/controllers/trackers_controller.rb index 186f8b7ae..173f63c48 100644 --- a/app/controllers/trackers_controller.rb +++ b/app/controllers/trackers_controller.rb @@ -28,7 +28,7 @@ class TrackersController < ApplicationController verify :method => :post, :only => [ :destroy ], :redirect_to => { :action => :list } def list - @tracker_pages, @trackers = paginate :trackers, :per_page => 10
+ @tracker_pages, @trackers = paginate :trackers, :per_page => 10, :order => 'position'
render :action => "list", :layout => false if request.xhr? end @@ -47,7 +47,22 @@ class TrackersController < ApplicationController redirect_to :action => 'list' end end - +
+ def move
+ @tracker = Tracker.find(params[:id])
+ case params[:position]
+ when 'highest'
+ @tracker.move_to_top
+ when 'higher'
+ @tracker.move_higher
+ when 'lower'
+ @tracker.move_lower
+ when 'lowest'
+ @tracker.move_to_bottom
+ end if params[:position]
+ redirect_to :action => 'list'
+ end
+ def destroy @tracker = Tracker.find(params[:id])
unless @tracker.issues.empty?
|