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
96d97c48
Commit
96d97c48
authored
Jan 22, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix routing. Finalize user show page
parent
70690e19
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
14 deletions
+31
-14
app/controllers/users_controller.rb
app/controllers/users_controller.rb
+1
-1
app/models/team.rb
app/models/team.rb
+4
-0
app/views/users/_projects.html.haml
app/views/users/_projects.html.haml
+20
-0
app/views/users/show.html.haml
app/views/users/show.html.haml
+5
-12
config/routes.rb
config/routes.rb
+1
-1
No files found.
app/controllers/users_controller.rb
View file @
96d97c48
class
UsersController
<
ApplicationController
def
show
@user
=
User
.
find_by_username
(
params
[
:username
])
@user
=
User
.
find_by_username
!
(
params
[
:username
])
@projects
=
@user
.
authorized_projects
.
where
(
'projects.id in (?)'
,
current_user
.
authorized_projects
.
map
(
&
:id
))
@events
=
@user
.
recent_events
.
where
(
project_id:
@projects
.
map
(
&
:id
)).
limit
(
20
)
end
...
...
app/models/team.rb
View file @
96d97c48
...
...
@@ -21,6 +21,10 @@ class Team
end
end
def
get_tm
user_id
project
.
users_projects
.
find_by_user_id
(
user_id
)
end
def
add_user
(
user
,
access
)
add_users_ids
([
user
.
id
],
access
)
end
...
...
app/views/users/_projects.html.haml
0 → 100644
View file @
96d97c48
.ui-box
%h5
.title
Projects
%ul
.well-list
-
@projects
.
each
do
|
project
|
%li
=
link_to
project_path
(
project
),
class:
dom_class
(
project
)
do
-
if
project
.
namespace
=
project
.
namespace
.
human_name
\/
%strong
.well-title
=
truncate
(
project
.
name
,
length:
45
)
%span
.right.light
-
if
project
.
owner
==
@user
%i
.icon-wrench
-
tm
=
project
.
team
.
get_tm
(
@user
.
id
)
-
if
tm
=
tm
.
project_access_human
%p
.light
%i
.icon-wrench
–
user is a project owner
app/views/users/show.html.haml
View file @
96d97c48
...
...
@@ -3,7 +3,10 @@
%h3
.page_title
=
image_tag
gravatar_icon
(
@user
.
email
,
90
),
class:
"avatar s90"
=
@user
.
name
%span
.light
(@
#{
@user
.
username
}
)
%br
%small
@
#{
@user
.
username
}
%br
%small
member since
#{
@user
.
created_at
.
stamp
(
"Nov 12, 2031"
)
}
.clearfix
%hr
%h5
Recent events
...
...
@@ -31,14 +34,4 @@
%li
%strong
Bio
%span
.right
=
@user
.
bio
.ui-box
%h5
.title
Projects
%ul
.well-list
-
@projects
.
each
do
|
project
|
%li
=
link_to
project_path
(
project
),
class:
dom_class
(
project
)
do
-
if
project
.
namespace
=
project
.
namespace
.
human_name
\/
%strong
.well-title
=
truncate
(
project
.
name
,
length:
45
)
=
render
'projects'
config/routes.rb
View file @
96d97c48
...
...
@@ -97,7 +97,7 @@ Gitlab::Application.routes.draw do
end
resources
:keys
match
"/u/:username"
=>
"users#show"
,
as: :user
match
"/u/:username"
=>
"users#show"
,
as: :user
,
constraints:
{
username:
/.*/
}
...
...
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