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
72b29525
Commit
72b29525
authored
May 30, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show only personal projects on profile page
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
d54d3324
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
3 deletions
+6
-3
app/controllers/users_controller.rb
app/controllers/users_controller.rb
+3
-1
app/views/users/_projects.html.haml
app/views/users/_projects.html.haml
+1
-1
app/views/users/show.html.haml
app/views/users/show.html.haml
+2
-1
No files found.
app/controllers/users_controller.rb
View file @
72b29525
...
@@ -4,10 +4,12 @@ class UsersController < ApplicationController
...
@@ -4,10 +4,12 @@ class UsersController < ApplicationController
def
show
def
show
@user
=
User
.
find_by_username!
(
params
[
:username
])
@user
=
User
.
find_by_username!
(
params
[
:username
])
@projects
=
@user
.
authorized_projects
.
accessible_to
(
current_user
)
@projects
=
Project
.
personal
(
@user
).
accessible_to
(
current_user
)
if
!
current_user
&&
@projects
.
empty?
if
!
current_user
&&
@projects
.
empty?
return
authenticate_user!
return
authenticate_user!
end
end
@groups
=
@user
.
groups
.
accessible_to
(
current_user
)
@groups
=
@user
.
groups
.
accessible_to
(
current_user
)
@events
=
@user
.
recent_events
.
where
(
project_id:
@projects
.
pluck
(
:id
)).
limit
(
20
)
@events
=
@user
.
recent_events
.
where
(
project_id:
@projects
.
pluck
(
:id
)).
limit
(
20
)
@title
=
@user
.
name
@title
=
@user
.
name
...
...
app/views/users/_projects.html.haml
View file @
72b29525
.panel.panel-default
.panel.panel-default
.panel-heading
Projects
.panel-heading
P
ersonal p
rojects
%ul
.well-list
%ul
.well-list
-
@projects
.
each
do
|
project
|
-
@projects
.
each
do
|
project
|
%li
%li
...
...
app/views/users/show.html.haml
View file @
72b29525
...
@@ -20,4 +20,5 @@
...
@@ -20,4 +20,5 @@
=
render
@events
=
render
@events
.col-md-4
.col-md-4
=
render
'profile'
,
user:
@user
=
render
'profile'
,
user:
@user
=
render
'projects'
-
if
@projects
.
present?
=
render
'projects'
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