diff options
| author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-02 18:12:13 +0000 |
|---|---|---|
| committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-02 18:12:13 +0000 |
| commit | 23f57fb31fe83ea8666753f94118f6d834517dfb (patch) | |
| tree | 0055fc79e5fe1bbb43afcbbce71c745df01f3f6c /app/controllers/explore | |
| parent | 125c8a6a81c1c09911c09183c66768571cfd95b4 (diff) | |
| download | gitlab-ce-23f57fb31fe83ea8666753f94118f6d834517dfb.tar.gz | |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/controllers/explore')
| -rw-r--r-- | app/controllers/explore/projects_controller.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/app/controllers/explore/projects_controller.rb b/app/controllers/explore/projects_controller.rb index 3dc6a16cbc1..81e1643a8f8 100644 --- a/app/controllers/explore/projects_controller.rb +++ b/app/controllers/explore/projects_controller.rb @@ -68,6 +68,15 @@ class Explore::ProjectsController < Explore::ApplicationController end # rubocop: enable CodeReuse/ActiveRecord + def topic + load_topic + + return render_404 unless @topic + + params[:topic] = @topic.name + @projects = load_projects + end + private def load_project_counts @@ -86,6 +95,10 @@ class Explore::ProjectsController < Explore::ApplicationController prepare_projects_for_rendering(projects) end + def load_topic + @topic = Projects::Topic.find_by_name(params[:topic_name]) + end + # rubocop: disable CodeReuse/ActiveRecord def preload_associations(projects) projects.includes(:route, :creator, :group, :project_feature, :topics, namespace: [:route, :owner]) |
