summaryrefslogtreecommitdiff
path: root/app/controllers/groups
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2018-09-10 14:38:29 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2018-09-10 15:34:36 +0300
commit8d19f4b4a610d4c26c685c5069b91c6636590c76 (patch)
treeb0256eab186c65f9c8b68c2b166acdfe4500f747 /app/controllers/groups
parenta5517ada119a0e73e0a70fd18e11fda3932138e8 (diff)
downloadgitlab-ce-8d19f4b4a610d4c26c685c5069b91c6636590c76.tar.gz
Add sort dropdown to project labels page and group labels page
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/controllers/groups')
-rw-r--r--app/controllers/groups/labels_controller.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/controllers/groups/labels_controller.rb b/app/controllers/groups/labels_controller.rb
index e95123c0933..059cf160fa2 100644
--- a/app/controllers/groups/labels_controller.rb
+++ b/app/controllers/groups/labels_controller.rb
@@ -12,6 +12,7 @@ class Groups::LabelsController < Groups::ApplicationController
format.html do
@labels = @group.labels
.optionally_search(params[:search])
+ .order_by(sort)
.page(params[:page])
end
format.json do
@@ -117,4 +118,8 @@ class Groups::LabelsController < Groups::ApplicationController
include_descendant_groups: params[:include_descendant_groups],
search: params[:search]).execute
end
+
+ def sort
+ @sort ||= params[:sort] || 'name_asc'
+ end
end