Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
iv
gitlab-ce
Commits
974b5a7b
Commit
974b5a7b
authored
Jul 25, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Most starred projects page for Explore area
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
76af5a1d
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
1 deletion
+25
-1
app/controllers/explore/projects_controller.rb
app/controllers/explore/projects_controller.rb
+6
-0
app/views/explore/projects/_project.html.haml
app/views/explore/projects/_project.html.haml
+6
-1
app/views/explore/projects/starred.html.haml
app/views/explore/projects/starred.html.haml
+10
-0
app/views/layouts/explore.html.haml
app/views/layouts/explore.html.haml
+2
-0
config/routes.rb
config/routes.rb
+1
-0
No files found.
app/controllers/explore/projects_controller.rb
View file @
974b5a7b
...
...
@@ -16,4 +16,10 @@ class Explore::ProjectsController < ApplicationController
@trending_projects
=
TrendingProjectsFinder
.
new
.
execute
(
current_user
)
@trending_projects
=
@trending_projects
.
page
(
params
[
:page
]).
per
(
10
)
end
def
starred
@starred_projects
=
ProjectsFinder
.
new
.
execute
(
current_user
)
@starred_projects
=
@starred_projects
.
order
(
'star_count DESC'
)
@starred_projects
=
@starred_projects
.
page
(
params
[
:page
]).
per
(
10
)
end
end
app/views/explore/projects/_project.html.haml
View file @
974b5a7b
...
...
@@ -4,6 +4,10 @@
=
visibility_level_icon
(
project
.
visibility_level
)
=
link_to
project
.
name_with_namespace
,
project
-
if
current_page?
(
starred_explore_projects_path
)
%strong
.pull-right
=
pluralize
project
.
star_count
,
'star'
-
if
project
.
description
.
present?
%p
.project-description.str-truncated
=
project
.
description
...
...
@@ -18,3 +22,4 @@
-
else
%i
.icon-warning-sign
Empty repository
app/views/explore/projects/starred.html.haml
0 → 100644
View file @
974b5a7b
.explore-trending-block
%p
.lead
%i
.icon-comments-alt
See most starred projects
%hr
.public-projects
%ul
.bordered-list
=
render
@starred_projects
=
paginate
@starred_projects
,
theme:
'gitlab'
app/views/layouts/explore.html.haml
View file @
974b5a7b
...
...
@@ -20,6 +20,8 @@
%ul
.nav.nav-tabs
=
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
...
...
config/routes.rb
View file @
974b5a7b
...
...
@@ -53,6 +53,7 @@ Gitlab::Application.routes.draw do
resources
:projects
,
only:
[
:index
]
do
collection
do
get
:trending
get
:starred
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment