diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2018-09-10 14:38:29 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2018-09-10 15:34:36 +0300 |
commit | 8d19f4b4a610d4c26c685c5069b91c6636590c76 (patch) | |
tree | b0256eab186c65f9c8b68c2b166acdfe4500f747 /app/controllers/groups | |
parent | a5517ada119a0e73e0a70fd18e11fda3932138e8 (diff) | |
download | gitlab-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.rb | 5 |
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 |