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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
fa9a8c38
Commit
fa9a8c38
authored
Mar 13, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove team_member show page -> use user_path instead
parent
366bc320
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
34 additions
and
178 deletions
+34
-178
app/controllers/team_members_controller.rb
app/controllers/team_members_controller.rb
+0
-5
app/decorators/commit_decorator.rb
app/decorators/commit_decorator.rb
+5
-4
app/helpers/projects_helper.rb
app/helpers/projects_helper.rb
+1
-11
app/views/milestones/show.html.haml
app/views/milestones/show.html.haml
+1
-1
app/views/team_members/_team_member.html.haml
app/views/team_members/_team_member.html.haml
+4
-5
app/views/team_members/show.html.haml
app/views/team_members/show.html.haml
+0
-59
app/views/teams/members/_show.html.haml
app/views/teams/members/_show.html.haml
+1
-1
app/views/teams/members/new.html.haml
app/views/teams/members/new.html.haml
+1
-1
app/views/teams/members/show.html.haml
app/views/teams/members/show.html.haml
+0
-60
app/views/users/_profile.html.haml
app/views/users/_profile.html.haml
+10
-10
app/views/users/show.html.haml
app/views/users/show.html.haml
+1
-1
features/project/team_management.feature
features/project/team_management.feature
+1
-6
features/steps/project/project_team_management.rb
features/steps/project/project_team_management.rb
+9
-14
No files found.
app/controllers/team_members_controller.rb
View file @
fa9a8c38
...
@@ -11,11 +11,6 @@ class TeamMembersController < ProjectResourceController
...
@@ -11,11 +11,6 @@ class TeamMembersController < ProjectResourceController
@assigned_teams
=
@project
.
user_team_project_relationships
@assigned_teams
=
@project
.
user_team_project_relationships
end
end
def
show
@user_project_relation
=
project
.
users_projects
.
find_by_user_id
(
member
)
@events
=
member
.
recent_events
.
in_projects
(
project
).
limit
(
7
)
end
def
new
def
new
@user_project_relation
=
project
.
users_projects
.
new
@user_project_relation
=
project
.
users_projects
.
new
end
end
...
...
app/decorators/commit_decorator.rb
View file @
fa9a8c38
...
@@ -81,12 +81,13 @@ class CommitDecorator < ApplicationDecorator
...
@@ -81,12 +81,13 @@ class CommitDecorator < ApplicationDecorator
else
else
source_name
source_name
end
end
team_member
=
@project
.
try
(
:team_member_by_name_or_email
,
source_name
,
source_email
)
if
team_member
.
nil?
user
=
User
.
where
(
'name like ? or email like ?'
,
source_name
,
source_email
).
first
h
.
mail_to
source_email
,
text
.
html_safe
,
class:
"commit-
#{
options
[
:source
]
}
-link"
if
user
.
nil?
h
.
mail_to
(
source_email
,
text
.
html_safe
,
class:
"commit-
#{
options
[
:source
]
}
-link"
)
else
else
h
.
link_to
text
,
h
.
project_team_member_path
(
@project
,
team_member
),
class:
"commit-
#{
options
[
:source
]
}
-link"
h
.
link_to
(
text
.
html_safe
,
h
.
user_path
(
user
),
class:
"commit-
#{
options
[
:source
]
}
-link"
)
end
end
end
end
end
end
app/helpers/projects_helper.rb
View file @
fa9a8c38
...
@@ -32,17 +32,7 @@ module ProjectsHelper
...
@@ -32,17 +32,7 @@ module ProjectsHelper
author_html
=
author_html
.
html_safe
author_html
=
author_html
.
html_safe
tm
=
project
.
team_member_by_id
(
author
)
link_to
(
author_html
,
user_path
(
author
),
class:
"author_link"
).
html_safe
if
tm
link_to
author_html
,
project_team_member_path
(
project
,
tm
.
user_username
),
class:
"author_link"
else
author_html
end
.
html_safe
end
def
tm_path
team_member
project_team_member_path
(
@project
,
team_member
)
end
end
def
project_title
project
def
project_title
project
...
...
app/views/milestones/show.html.haml
View file @
fa9a8c38
...
@@ -87,7 +87,7 @@
...
@@ -87,7 +87,7 @@
%h6
Participants:
%h6
Participants:
%div
%div
-
@users
.
each
do
|
user
|
-
@users
.
each
do
|
user
|
=
link_to
tm_path
(
user
.
tm_of
(
@project
))
,
class:
'float-link'
do
=
link_to
user
,
class:
'float-link'
do
=
user
.
avatar_image
=
user
.
avatar_image
=
user
.
name
=
user
.
name
...
...
app/views/team_members/_team_member.html.haml
View file @
fa9a8c38
...
@@ -3,12 +3,11 @@
...
@@ -3,12 +3,11 @@
%li
{
id:
dom_id
(
user
),
class:
"team_member_row user_#{user.id}"
}
%li
{
id:
dom_id
(
user
),
class:
"team_member_row user_#{user.id}"
}
.row
.row
.span4
.span4
=
link_to
project_team_member_path
(
@project
,
user
),
title:
user
.
name
,
class:
"dark"
do
=
link_to
user
,
title:
user
.
name
,
class:
"dark"
do
=
image_tag
gravatar_icon
(
user
.
email
,
40
),
class:
"avatar s32"
=
image_tag
gravatar_icon
(
user
.
email
,
32
),
class:
"avatar s32"
=
link_to
project_team_member_path
(
@project
,
user
),
title:
user
.
name
,
class:
"dark"
do
%strong
=
truncate
(
user
.
name
,
lenght:
40
)
%strong
=
truncate
(
user
.
name
,
lenght:
40
)
%br
%br
%small
.cgray
=
user
.
email
%small
.cgray
=
user
.
username
.span4.pull-right
.span4.pull-right
-
if
allow_admin
-
if
allow_admin
...
@@ -23,6 +22,6 @@
...
@@ -23,6 +22,6 @@
-
elsif
user
.
blocked?
-
elsif
user
.
blocked?
%span
.label
Blocked
%span
.label
Blocked
-
elsif
allow_admin
-
elsif
allow_admin
=
link_to
project_team_member_path
(
@project
,
user
),
confirm:
remove_from_project_team_message
(
@project
,
user
),
method: :delete
,
class:
"btn-tiny btn btn-remove"
do
=
link_to
project_team_member_path
(
@project
,
user
),
confirm:
remove_from_project_team_message
(
@project
,
user
),
method: :delete
,
class:
"btn-tiny btn btn-remove"
,
title:
'Remove user from team'
do
%i
.icon-minus.icon-white
%i
.icon-minus.icon-white
app/views/team_members/show.html.haml
deleted
100644 → 0
View file @
366bc320
-
allow_admin
=
can?
current_user
,
:admin_project
,
@project
.team_member_show
-
if
can?
current_user
,
:admin_project
,
@project
=
link_to
'Remove from team'
,
project_team_member_path
(
@project
,
@member
),
confirm:
'Are you sure?'
,
method: :delete
,
class:
"btn btn-remove pull-right"
.profile_avatar_holder
=
image_tag
gravatar_icon
(
@member
.
email
,
60
),
class:
"borders"
%h3
.page_title
=
@member
.
name
%small
(@
#{
@member
.
username
}
)
%hr
.back_link
%br
=
link_to
project_team_index_path
(
@project
),
class:
""
do
←
To team list
%br
.row
.span6
%table
.lite
%tr
%td
Email
%td
=
mail_to
@member
.
email
%tr
%td
Skype
%td
=
@member
.
skype
-
unless
@member
.
linkedin
.
blank?
%tr
%td
LinkedIn
%td
=
@member
.
linkedin
-
unless
@member
.
twitter
.
blank?
%tr
%td
Twitter
%td
=
@member
.
twitter
-
unless
@member
.
bio
.
blank?
%tr
%td
Bio
%td
=
@member
.
bio
.span6
%table
.lite
%tr
%td
Member since
%td
=
@user_project_relation
.
created_at
.
stamp
(
"Aug 21, 2011"
)
%tr
%td
Project Access:
%small
(
#{
link_to
"read more"
,
help_permissions_path
,
class:
"vlink"
}
)
%td
=
form_for
(
@user_project_relation
,
as: :team_member
,
url:
project_team_member_path
(
@project
,
@member
))
do
|
f
|
=
f
.
select
:project_access
,
options_for_select
(
Project
.
access_options
,
@user_project_relation
.
project_access
),
{},
class:
"project-access-select"
,
disabled:
!
allow_admin
%hr
=
render
@events
:javascript
$
(
function
(){
$
(
'
.repo-access-select, .project-access-select
'
).
live
(
"
change
"
,
function
()
{
$
(
this
.
form
).
submit
();
});
})
app/views/teams/members/_show.html.haml
View file @
fa9a8c38
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
=
link_to
user_path
(
user
.
username
),
title:
user
.
name
,
class:
"dark"
do
=
link_to
user_path
(
user
.
username
),
title:
user
.
name
,
class:
"dark"
do
%strong
=
truncate
(
user
.
name
,
lenght:
40
)
%strong
=
truncate
(
user
.
name
,
lenght:
40
)
%br
%br
%small
.cgray
=
user
.
email
%small
.cgray
=
user
.
username
.span4
.span4
-
if
allow_admin
-
if
allow_admin
...
...
app/views/teams/members/new.html.haml
View file @
fa9a8c38
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
%tr
.member
%tr
.member
%td
%td
=
member
.
name
=
member
.
name
%small
=
"(
#{
member
.
email
}
)"
%small
=
"(
#{
member
.
username
}
)"
%td
=
@team
.
human_default_projects_access
(
member
)
%td
=
@team
.
human_default_projects_access
(
member
)
%td
=
@team
.
admin?
(
member
)
?
"Admin"
:
"Member"
%td
=
@team
.
admin?
(
member
)
?
"Admin"
:
"Member"
%td
%td
...
...
app/views/teams/members/show.html.haml
deleted
100644 → 0
View file @
366bc320
-
allow_admin
=
can?
current_user
,
:admin_project
,
@project
-
user
=
@team_member
.
user
.team_member_show
-
if
can?
current_user
,
:admin_project
,
@project
=
link_to
'Remove from team'
,
project_team_member_path
(
project_id:
@project
,
id:
@team_member
.
id
),
confirm:
'Are you sure?'
,
method: :delete
,
class:
"pull-right btn btn-remove"
.profile_avatar_holder
=
image_tag
gravatar_icon
(
user
.
email
,
60
),
class:
"borders"
%h3
.page_title
=
user
.
name
%small
(@
#{
user
.
username
}
)
%hr
.back_link
%br
=
link_to
project_team_index_path
(
@project
),
class:
""
do
←
To team list
%br
.row
.span6
%table
.lite
%tr
%td
Email
%td
=
mail_to
user
.
email
%tr
%td
Skype
%td
=
user
.
skype
-
unless
user
.
linkedin
.
blank?
%tr
%td
LinkedIn
%td
=
user
.
linkedin
-
unless
user
.
twitter
.
blank?
%tr
%td
Twitter
%td
=
user
.
twitter
-
unless
user
.
bio
.
blank?
%tr
%td
Bio
%td
=
user
.
bio
.span6
%table
.lite
%tr
%td
Member since
%td
=
@team_member
.
created_at
.
stamp
(
"Aug 21, 2011"
)
%tr
%td
Project Access:
%small
(
#{
link_to
"read more"
,
help_permissions_path
,
class:
"vlink"
}
)
%td
=
form_for
(
@team_member
,
as: :team_member
,
url:
project_team_member_path
(
@project
,
@team_member
))
do
|
f
|
=
f
.
select
:project_access
,
options_for_select
(
Project
.
access_options
,
@team_member
.
project_access
),
{},
class:
"project-access-select"
,
disabled:
!
allow_admin
%hr
=
render
@events
:javascript
$
(
function
(){
$
(
'
.repo-access-select, .project-access-select
'
).
live
(
"
change
"
,
function
()
{
$
(
this
.
form
).
submit
();
});
})
app/views/users/_profile.html.haml
View file @
fa9a8c38
...
@@ -3,21 +3,21 @@
...
@@ -3,21 +3,21 @@
Profile
Profile
%ul
.well-list
%ul
.well-list
%li
%li
%s
trong
Email
%s
pan
.light
Member since
%s
pan
.pull-right
=
mail_to
user
.
email
%s
trong
=
user
.
created_at
.
stamp
(
"Aug 21, 2011"
)
-
unless
user
.
skype
.
blank?
-
unless
user
.
skype
.
blank?
%li
%li
%s
trong
Skype
%s
pan
.light
Skype:
%s
pan
.pull-right
=
user
.
skype
%s
trong
=
user
.
skype
-
unless
user
.
linkedin
.
blank?
-
unless
user
.
linkedin
.
blank?
%li
%li
%s
trong
LinkedIn
%s
pan
.light
LinkedIn:
%s
pan
.pull-right
=
user
.
linkedin
%s
trong
=
user
.
linkedin
-
unless
user
.
twitter
.
blank?
-
unless
user
.
twitter
.
blank?
%li
%li
%s
trong
Twitter
%s
pan
.light
Twitter:
%s
pan
.pull-right
=
user
.
twitter
%s
trong
=
user
.
twitter
-
unless
user
.
bio
.
blank?
-
unless
user
.
bio
.
blank?
%li
%li
%s
trong
Bio
%s
pan
.light
Bio:
%span
.pull-right
=
user
.
bio
%span
=
user
.
bio
app/views/users/show.html.haml
View file @
fa9a8c38
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
%i
.icon-edit
%i
.icon-edit
Edit Profile
Edit Profile
%br
%br
%small
@
#{
@user
.
username
}
%small
#{
@user
.
username
}
%br
%br
%small
member since
#{
@user
.
created_at
.
stamp
(
"Nov 12, 2031"
)
}
%small
member since
#{
@user
.
created_at
.
stamp
(
"Nov 12, 2031"
)
}
.clearfix
.clearfix
...
...
features/project/team_management.feature
View file @
fa9a8c38
...
@@ -23,13 +23,8 @@ Feature: Project Team management
...
@@ -23,13 +23,8 @@ Feature: Project Team management
Then
I visit project
"Shop"
team page
Then
I visit project
"Shop"
team page
And
I should see
"Sam"
in team list as
"Reporter"
And
I should see
"Sam"
in team list as
"Reporter"
Scenario
:
View team member profile
Given
I click link
"Sam"
Then
I should see
"Sam"
team profile
Scenario
:
Cancel team member
Scenario
:
Cancel team member
Given
I click link
"Sam"
Given
I click cancel link for
"Sam"
And
I click link
"Remove from team"
Then
I visit project
"Shop"
team page
Then
I visit project
"Shop"
team page
And
I should not see
"Sam"
in team list
And
I should not see
"Sam"
in team list
...
...
features/steps/project/project_team_management.rb
View file @
fa9a8c38
...
@@ -5,13 +5,13 @@ class ProjectTeamManagement < Spinach::FeatureSteps
...
@@ -5,13 +5,13 @@ class ProjectTeamManagement < Spinach::FeatureSteps
Then
'I should be able to see myself in team'
do
Then
'I should be able to see myself in team'
do
page
.
should
have_content
(
@user
.
name
)
page
.
should
have_content
(
@user
.
name
)
page
.
should
have_content
(
@user
.
email
)
page
.
should
have_content
(
@user
.
username
)
end
end
And
'I should see "Sam" in team list'
do
And
'I should see "Sam" in team list'
do
user
=
User
.
find_by_name
(
"Sam"
)
user
=
User
.
find_by_name
(
"Sam"
)
page
.
should
have_content
(
user
.
name
)
page
.
should
have_content
(
user
.
name
)
page
.
should
have_content
(
user
.
email
)
page
.
should
have_content
(
user
.
username
)
end
end
Given
'I click link "New Team Member"'
do
Given
'I click link "New Team Member"'
do
...
@@ -52,17 +52,6 @@ class ProjectTeamManagement < Spinach::FeatureSteps
...
@@ -52,17 +52,6 @@ class ProjectTeamManagement < Spinach::FeatureSteps
role_id
.
should
==
UsersProject
.
access_roles
[
"Reporter"
].
to_s
role_id
.
should
==
UsersProject
.
access_roles
[
"Reporter"
].
to_s
end
end
Given
'I click link "Sam"'
do
first
(
:link
,
"Sam"
).
click
end
Then
'I should see "Sam" team profile'
do
user
=
User
.
find_by_name
(
"Sam"
)
page
.
should
have_content
(
user
.
name
)
page
.
should
have_content
(
user
.
email
)
page
.
should
have_content
(
"To team list"
)
end
And
'I click link "Remove from team"'
do
And
'I click link "Remove from team"'
do
click_link
"Remove from team"
click_link
"Remove from team"
end
end
...
@@ -70,7 +59,7 @@ class ProjectTeamManagement < Spinach::FeatureSteps
...
@@ -70,7 +59,7 @@ class ProjectTeamManagement < Spinach::FeatureSteps
And
'I should not see "Sam" in team list'
do
And
'I should not see "Sam" in team list'
do
user
=
User
.
find_by_name
(
"Sam"
)
user
=
User
.
find_by_name
(
"Sam"
)
page
.
should_not
have_content
(
user
.
name
)
page
.
should_not
have_content
(
user
.
name
)
page
.
should_not
have_content
(
user
.
email
)
page
.
should_not
have_content
(
user
.
username
)
end
end
And
'gitlab user "Mike"'
do
And
'gitlab user "Mike"'
do
...
@@ -106,4 +95,10 @@ class ProjectTeamManagement < Spinach::FeatureSteps
...
@@ -106,4 +95,10 @@ class ProjectTeamManagement < Spinach::FeatureSteps
select
'Website'
,
from:
'source_project_id'
select
'Website'
,
from:
'source_project_id'
click_button
'Import'
click_button
'Import'
end
end
step
'I click cancel link for "Sam"'
do
within
"#user_
#{
User
.
find_by_name
(
'Sam'
).
id
}
"
do
click_link
(
'Remove user from team'
)
end
end
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