Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-03-11 01:59:14 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-03-11 01:59:14 +0300
commit83f7e98d9a672158d5c754307ab471fd50c5b2a3 (patch)
treea1e87bec3ef83aa3ae987a3452be71bccefdc4ed /app/controllers/explore/projects_controller.rb
parent8527e8d5996bb5543cb5a13e857b864b466a31f2 (diff)
Add project filter by visibility and tag to explore page
Diffstat (limited to 'app/controllers/explore/projects_controller.rb')
-rw-r--r--app/controllers/explore/projects_controller.rb3
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)