diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-03-10 15:59:14 -0700 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-03-10 15:59:14 -0700 |
commit | 83f7e98d9a672158d5c754307ab471fd50c5b2a3 (patch) | |
tree | a1e87bec3ef83aa3ae987a3452be71bccefdc4ed /app/controllers/explore | |
parent | 8527e8d5996bb5543cb5a13e857b864b466a31f2 (diff) | |
download | gitlab-ce-83f7e98d9a672158d5c754307ab471fd50c5b2a3.tar.gz |
Add project filter by visibility and tag to explore page
Diffstat (limited to 'app/controllers/explore')
-rw-r--r-- | app/controllers/explore/projects_controller.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/app/controllers/explore/projects_controller.rb b/app/controllers/explore/projects_controller.rb index 0e5891ae807..d664624fa69 100644 --- a/app/controllers/explore/projects_controller.rb +++ b/app/controllers/explore/projects_controller.rb @@ -6,6 +6,9 @@ class Explore::ProjectsController < ApplicationController def index @projects = ProjectsFinder.new.execute(current_user) + @tags = @projects.tags_on(:tags) + @projects = @projects.tagged_with(params[:tag]) if params[:tag].present? + @projects = @projects.where(visibility_level: params[:visibility_level]) if params[:visibility_level].present? @projects = @projects.search(params[:search]) if params[:search].present? @projects = @projects.sort(@sort = params[:sort]) @projects = @projects.includes(:namespace).page(params[:page]).per(20) |