Commit 8734a9cd authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Merge branch 'most-starred' into 'master'

Most starred projects page

Fixes #1461

See merge request !996
......@@ -16,4 +16,10 @@ def trending
@trending_projects =
@trending_projects =[:page]).per(10)
def starred
@starred_projects =
@starred_projects = @starred_projects.order('star_count DESC')
@starred_projects =[:page]).per(10)
......@@ -4,6 +4,10 @@
= visibility_level_icon(project.visibility_level)
= link_to project.name_with_namespace, project
- if current_page?(starred_explore_projects_path)
= pluralize project.star_count, 'star'
- if project.description.present?
= project.description
......@@ -18,3 +22,4 @@
- else
Empty repository
See most starred projects
= render @starred_projects
= paginate @starred_projects, theme: 'gitlab'
......@@ -20,6 +20,8 @@
= nav_link(path: 'projects#trending') do
= link_to 'Trending Projects', explore_root_path
= nav_link(path: 'projects#starred') do
= link_to 'Most Starred Projects', starred_explore_projects_path
= nav_link(path: 'projects#index') do
= link_to 'All Projects', explore_projects_path
= nav_link(controller: :groups) do
......@@ -53,6 +53,7 @@
resources :projects, only: [:index] do
collection do
get :trending
get :starred
......@@ -100,3 +100,17 @@ Feature: Explore Projects Feature
And I visit "Internal" merge requests page
And project "Internal" has "Feature implemented" open merge request
Then I should see list of merge requests for "Internal" project
Scenario: Trending page
Given I sign in as a user
And project "Community" has comments
When I visit the explore trending projects
Then I should see project "Community"
And I should not see project "Internal"
And I should not see project "Enterprise"
Scenario: Most starred page
Given I sign in as a user
When I visit the explore starred projects
Then I should see project "Community"
And I should see project "Internal"
......@@ -355,9 +355,13 @@ module SharedPaths
visit explore_projects_path
# ----------------------------------------
# Public Groups
# ----------------------------------------
step 'I visit the explore trending projects' do
visit trending_explore_projects_path
step 'I visit the explore starred projects' do
visit starred_explore_projects_path
step 'I visit the public groups area' do
visit explore_groups_path
......@@ -130,4 +130,9 @@ def current_project
step 'public empty project "Empty Public Project"' do
create :empty_project, :public, name: "Empty Public Project"
step 'project "Community" has comments' do
project = Project.find_by(name: "Community")
2.times { create(:note_on_issue, project: project) }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment