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
This commit is contained in:
Jean-Philippe Lang
2007-01-31 21:18:43 +00:00
parent 671a0fa101
commit fa688d48e6
10 changed files with 45 additions and 12 deletions

View File

@@ -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?