summaryrefslogtreecommitdiff
path: root/app/controllers/explore/groups_controller.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2017-03-01 15:31:56 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2017-03-01 15:39:59 +0200
commitb7c30cae4eedab5e8e41d9764ac08ca12361d054 (patch)
treee5a594dfd920a55a52a00b34e632dfb553de4c45 /app/controllers/explore/groups_controller.rb
parent11dd2348c410949c98adfc10cdcf5be787742179 (diff)
downloadgitlab-ce-b7c30cae4eedab5e8e41d9764ac08ca12361d054.tar.gz
Add filter and sorting to dashboard groups page
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/controllers/explore/groups_controller.rb')
-rw-r--r--app/controllers/explore/groups_controller.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/app/controllers/explore/groups_controller.rb b/app/controllers/explore/groups_controller.rb
index a962f9a0937..68228c095da 100644
--- a/app/controllers/explore/groups_controller.rb
+++ b/app/controllers/explore/groups_controller.rb
@@ -1,8 +1,17 @@
class Explore::GroupsController < Explore::ApplicationController
def index
@groups = GroupsFinder.new.execute(current_user)
- @groups = @groups.search(params[:search]) if params[:search].present?
+ @groups = @groups.search(params[:filter_groups]) if params[:filter_groups].present?
@groups = @groups.sort(@sort = params[:sort])
@groups = @groups.page(params[:page])
+
+ respond_to do |format|
+ format.html
+ format.json do
+ render json: {
+ html: view_to_html_string("explore/groups/_groups", locals: { groups: @groups })
+ }
+ end
+ end
end
end