diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-07-23 12:03:49 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-07-23 12:03:49 +0300 |
commit | 367445fdcde4d07a685610449a2ab4d43b1fc507 (patch) | |
tree | 5d720c3c76c02fe8539e5bdaca64f76a5549a043 /app/controllers/explore | |
parent | 1df0345e9e642ca7e9d73c12430921b0fe62d25e (diff) | |
download | gitlab-ce-367445fdcde4d07a685610449a2ab4d43b1fc507.tar.gz |
Refactor explore area
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/controllers/explore')
-rw-r--r-- | app/controllers/explore/groups_controller.rb | 14 | ||||
-rw-r--r-- | app/controllers/explore/projects_controller.rb | 19 |
2 files changed, 33 insertions, 0 deletions
diff --git a/app/controllers/explore/groups_controller.rb b/app/controllers/explore/groups_controller.rb new file mode 100644 index 00000000000..f8e1a31e0b3 --- /dev/null +++ b/app/controllers/explore/groups_controller.rb @@ -0,0 +1,14 @@ +class Explore::GroupsController < ApplicationController + skip_before_filter :authenticate_user!, + :reject_blocked, :set_current_user_for_observers, + :add_abilities + + layout "explore" + + def index + @groups = GroupsFinder.new.execute(current_user) + @groups = @groups.search(params[:search]) if params[:search].present? + @groups = @groups.sort(@sort = params[:sort]) + @groups = @groups.page(params[:page]).per(20) + end +end diff --git a/app/controllers/explore/projects_controller.rb b/app/controllers/explore/projects_controller.rb new file mode 100644 index 00000000000..05b3289682b --- /dev/null +++ b/app/controllers/explore/projects_controller.rb @@ -0,0 +1,19 @@ +class Explore::ProjectsController < ApplicationController + skip_before_filter :authenticate_user!, + :reject_blocked, + :add_abilities + + layout 'explore' + + def index + @projects = ProjectsFinder.new.execute(current_user) + @projects = @projects.search(params[:search]) if params[:search].present? + @projects = @projects.sort(@sort = params[:sort]) + @projects = @projects.includes(:namespace).page(params[:page]).per(20) + end + + def trending + @trending_projects = TrendingProjectsFinder.new.execute(current_user) + @trending_projects = @trending_projects.page(params[:page]).per(10) + end +end |