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
Boxiang Sun
gitlab-ce
Commits
dba18fa4
Commit
dba18fa4
authored
Feb 17, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show contributed projects on user page and stars for it
parent
846c9310
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
14 deletions
+28
-14
app/controllers/users_controller.rb
app/controllers/users_controller.rb
+3
-0
app/views/explore/projects/_project.html.haml
app/views/explore/projects/_project.html.haml
+3
-5
app/views/users/_projects.html.haml
app/views/users/_projects.html.haml
+21
-6
app/views/users/show.html.haml
app/views/users/show.html.haml
+1
-3
No files found.
app/controllers/users_controller.rb
View file @
dba18fa4
...
@@ -8,6 +8,9 @@ class UsersController < ApplicationController
...
@@ -8,6 +8,9 @@ class UsersController < ApplicationController
visible_projects
=
ProjectsFinder
.
new
.
execute
(
current_user
)
visible_projects
=
ProjectsFinder
.
new
.
execute
(
current_user
)
authorized_projects_ids
=
visible_projects
.
pluck
(
:id
)
authorized_projects_ids
=
visible_projects
.
pluck
(
:id
)
@contributed_projects
=
Project
.
where
(
id:
authorized_projects_ids
).
in_group_namespace
@projects
=
@user
.
personal_projects
.
@projects
=
@user
.
personal_projects
.
where
(
id:
authorized_projects_ids
)
where
(
id:
authorized_projects_ids
)
...
...
app/views/explore/projects/_project.html.haml
View file @
dba18fa4
...
@@ -3,11 +3,9 @@
...
@@ -3,11 +3,9 @@
.project-access-icon
.project-access-icon
=
visibility_level_icon
(
project
.
visibility_level
)
=
visibility_level_icon
(
project
.
visibility_level
)
=
link_to
project
.
name_with_namespace
,
project
=
link_to
project
.
name_with_namespace
,
project
%span
.pull-right
-
if
current_page?
(
starred_explore_projects_path
)
%i
.fa.fa-star
%strong
.pull-right
=
project
.
star_count
%i
.fa.fa-star
=
pluralize
project
.
star_count
,
'star'
.project-info
.project-info
-
if
project
.
description
.
present?
-
if
project
.
description
.
present?
...
...
app/views/users/_projects.html.haml
View file @
dba18fa4
.panel.panel-default
-
if
@contributed_projects
.
present?
.panel-heading
Personal projects
.panel.panel-default
%ul
.well-list
.panel-heading
Projects contributed to
-
projects
.
each
do
|
project
|
%ul
.well-list
%li
-
@contributed_projects
.
sort_by
(
&
:star_count
).
reverse
.
each
do
|
project
|
=
link_to_project
project
%li
=
link_to_project
project
%span
.pull-right.light
%i
.fa.fa-star
=
project
.
star_count
-
if
@projects
.
present?
.panel.panel-default
.panel-heading
Personal projects
%ul
.well-list
-
@projects
.
sort_by
(
&
:star_count
).
reverse
.
each
do
|
project
|
%li
=
link_to_project
project
%span
.pull-right.light
%i
.fa.fa-star
=
project
.
star_count
app/views/users/show.html.haml
View file @
dba18fa4
...
@@ -35,9 +35,7 @@
...
@@ -35,9 +35,7 @@
=
render
@events
=
render
@events
.col-md-4
.col-md-4
=
render
'profile'
,
user:
@user
=
render
'profile'
,
user:
@user
-
if
@projects
.
present?
=
render
'projects'
=
render
'projects'
,
projects:
@projects
:coffeescript
:coffeescript
$ ->
$ ->
...
...
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