summaryrefslogtreecommitdiff
path: root/app/controllers/dashboard_controller.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-12-29 12:58:00 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-12-29 12:58:00 +0200
commit611c5f1d7cb0ae74d923499d01c2f30d5e8f9384 (patch)
tree6a7e1c03f93c80ad7f4474bbdfe4ddd9ddd59ddb /app/controllers/dashboard_controller.rb
parent231b91d0c819ef1e4fb1beb23c5decfa34876ec6 (diff)
downloadgitlab-ce-611c5f1d7cb0ae74d923499d01c2f30d5e8f9384.tar.gz
Sort dropdown for Dashboard#projects page
Be default it sorts by name now Respect filters like scope, label, visibility when do sort or another filter Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/controllers/dashboard_controller.rb')
-rw-r--r--app/controllers/dashboard_controller.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb
index 78456995b3b..27955c62488 100644
--- a/app/controllers/dashboard_controller.rb
+++ b/app/controllers/dashboard_controller.rb
@@ -41,13 +41,13 @@ class DashboardController < ApplicationController
@projects = @projects.where(namespace_id: Group.find_by_name(params[:group])) if params[:group].present?
@projects = @projects.where(visibility_level: params[:visibility_level]) if params[:visibility_level].present?
- @projects = @projects.includes(:namespace).sorted_by_activity
+ @projects = @projects.includes(:namespace)
+ @projects = @projects.tagged_with(params[:label]) if params[:label].present?
+ @projects = @projects.sort(@sort = params[:sort])
+ @projects = @projects.page(params[:page]).per(30)
@labels = current_user.authorized_projects.tags_on(:labels)
@groups = current_user.authorized_groups
-
- @projects = @projects.tagged_with(params[:label]) if params[:label].present?
- @projects = @projects.page(params[:page]).per(30)
end
def merge_requests