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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
2a1d4255
Commit
2a1d4255
authored
Apr 10, 2015
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correctly render invite members without user.
parent
cee98f22
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
74 additions
and
33 deletions
+74
-33
app/helpers/groups_helper.rb
app/helpers/groups_helper.rb
+6
-2
app/helpers/projects_helper.rb
app/helpers/projects_helper.rb
+6
-2
app/views/admin/groups/show.html.haml
app/views/admin/groups/show.html.haml
+9
-4
app/views/admin/projects/show.html.haml
app/views/admin/projects/show.html.haml
+8
-3
app/views/admin/users/show.html.haml
app/views/admin/users/show.html.haml
+2
-2
app/views/groups/group_members/_group_member.html.haml
app/views/groups/group_members/_group_member.html.haml
+21
-10
app/views/projects/project_members/_project_member.html.haml
app/views/projects/project_members/_project_member.html.haml
+22
-10
No files found.
app/helpers/groups_helper.rb
View file @
2a1d4255
module
GroupsHelper
def
remove_user_from_group_message
(
group
,
user
)
"Are you sure you want to remove
\"
#{
user
.
name
}
\"
from
\"
#{
group
.
name
}
\"
?"
def
remove_user_from_group_message
(
group
,
member
)
if
member
.
user
"Are you sure you want to remove
\"
#{
member
.
user
.
name
}
\"
from
\"
#{
group
.
name
}
\"
?"
else
"Are you sure you want to cancel invitation for
\"
#{
member
.
invite_email
}
\"
to join
\"
#{
group
.
name
}
\"
?"
end
end
def
leave_group_message
(
group
)
...
...
app/helpers/projects_helper.rb
View file @
2a1d4255
module
ProjectsHelper
def
remove_from_project_team_message
(
project
,
user
)
"You are going to remove
#{
user
.
name
}
from
#{
project
.
name
}
project team. Are you sure?"
def
remove_from_project_team_message
(
project
,
member
)
if
member
.
user
"You are going to remove
#{
member
.
user
.
name
}
from
#{
project
.
name
}
project team. Are you sure?"
else
"You are going to cancel invitation for
#{
member
.
invite_email
}
to join
#{
project
.
name
}
project team. Are you sure?"
end
end
def
link_to_project
(
project
)
...
...
app/views/admin/groups/show.html.haml
View file @
2a1d4255
...
...
@@ -74,13 +74,18 @@
%ul
.well-list.group-users-list
-
@members
.
each
do
|
member
|
-
user
=
member
.
user
%li
{
class:
dom_class
(
member
),
id:
dom_id
(
user
)}
%li
{
class:
dom_class
(
member
),
id:
(
dom_id
(
user
)
if
user
)}
.list-item-name
-
if
user
%strong
=
link_to
user
.
name
,
admin_user_path
(
user
)
-
else
%strong
=
member
.
invite_email
(invited)
%span
.pull-right.light
=
member
.
human_access
=
link_to
group_group_member_path
(
@group
,
member
),
data:
{
confirm:
remove_user_from_group_message
(
@group
,
us
er
)
},
method: :delete
,
remote:
true
,
class:
"btn-xs btn btn-remove"
,
title:
'Remove user from group'
do
=
link_to
group_group_member_path
(
@group
,
member
),
data:
{
confirm:
remove_user_from_group_message
(
@group
,
memb
er
)
},
method: :delete
,
remote:
true
,
class:
"btn-xs btn btn-remove"
,
title:
'Remove user from group'
do
%i
.fa.fa-minus.fa-inverse
.panel-footer
=
paginate
@members
,
param_name:
'members_page'
,
theme:
'gitlab'
app/views/admin/projects/show.html.haml
View file @
2a1d4255
...
...
@@ -124,14 +124,19 @@
-
user
=
project_member
.
user
%li
.project_member
.list-item-name
-
if
user
%strong
=
link_to
user
.
name
,
admin_user_path
(
user
)
-
else
%strong
=
project_member
.
invite_email
(invited)
.pull-right
-
if
project_member
.
owner?
%span
.light
Owner
-
else
%span
.light
=
project_member
.
human_access
=
link_to
namespace_project_project_member_path
(
@project
.
namespace
,
@project
,
project_member
),
data:
{
confirm:
remove_from_project_team_message
(
@project
,
us
er
)},
method: :delete
,
remote:
true
,
class:
"btn btn-sm btn-remove"
do
=
link_to
namespace_project_project_member_path
(
@project
.
namespace
,
@project
,
project_member
),
data:
{
confirm:
remove_from_project_team_message
(
@project
,
project_memb
er
)},
method: :delete
,
remote:
true
,
class:
"btn btn-sm btn-remove"
do
%i
.fa.fa-times
.panel-footer
=
paginate
@project_members
,
param_name:
'project_members_page'
,
theme:
'gitlab'
app/views/admin/users/show.html.haml
View file @
2a1d4255
...
...
@@ -182,7 +182,7 @@
.pull-right
%span
.light
=
group_member
.
human_access
-
unless
group_member
.
owner?
=
link_to
group_group_member_path
(
group
,
group_member
),
data:
{
confirm:
remove_user_from_group_message
(
group
,
@us
er
)
},
method: :delete
,
remote:
true
,
class:
"btn-xs btn btn-remove"
,
title:
'Remove user from group'
do
=
link_to
group_group_member_path
(
group
,
group_member
),
data:
{
confirm:
remove_user_from_group_message
(
group
,
group_memb
er
)
},
method: :delete
,
remote:
true
,
class:
"btn-xs btn btn-remove"
,
title:
'Remove user from group'
do
%i
.fa.fa-times.fa-inverse
-
else
.nothing-here-block
This user has no groups.
...
...
@@ -221,7 +221,7 @@
%span
.light
=
member
.
human_access
-
if
member
.
respond_to?
:project
=
link_to
namespace_project_project_member_path
(
project
.
namespace
,
project
,
@user
),
data:
{
confirm:
remove_from_project_team_message
(
project
,
@us
er
)
},
remote:
true
,
method: :delete
,
class:
"btn-xs btn btn-remove"
,
title:
'Remove user from project'
do
=
link_to
namespace_project_project_member_path
(
project
.
namespace
,
project
,
member
),
data:
{
confirm:
remove_from_project_team_message
(
project
,
memb
er
)
},
remote:
true
,
method: :delete
,
class:
"btn-xs btn btn-remove"
,
title:
'Remove user from project'
do
%i
.fa.fa-times
#ssh-keys
.tab-pane
=
render
'profiles/keys/key_table'
,
admin:
true
app/views/groups/group_members/_group_member.html.haml
View file @
2a1d4255
-
user
=
member
.
user
-
return
unless
user
-
return
unless
user
||
member
.
invite?
-
show_roles
=
true
if
show_roles
.
nil?
%li
{
class:
"#{dom_class(member)} js-toggle-container"
,
id:
dom_id
(
member
)}
%span
{
class:
(
"list-item-name"
if
show_controls
)}
-
if
member
.
user
=
image_tag
avatar_icon
(
user
.
email
,
16
),
class:
"avatar s16"
,
alt:
''
%strong
=
user
.
name
%span
.cgray
=
user
.
username
...
...
@@ -12,6 +13,16 @@
-
if
user
.
blocked?
%label
.label.label-danger
%strong
Blocked
-
else
=
image_tag
avatar_icon
(
member
.
invite_email
,
16
),
class:
"avatar s16"
,
alt:
''
%strong
=
member
.
invite_email
%span
.cgray
invited
-
if
member
.
created_by
by
=
link_to
member
.
created_by
.
name
,
user_path
(
member
.
created_by
)
=
time_ago_with_tooltip
(
member
.
created_at
)
-
if
show_roles
%span
.pull-right
...
...
@@ -27,7 +38,7 @@
=
link_to
leave_group_group_members_path
(
@group
),
data:
{
confirm:
leave_group_message
(
@group
.
name
)},
method: :delete
,
class:
"btn-xs btn btn-remove"
,
title:
'Remove user from group'
do
%i
.fa.fa-minus.fa-inverse
-
else
=
link_to
group_group_member_path
(
@group
,
member
),
data:
{
confirm:
remove_user_from_group_message
(
@group
,
us
er
)
},
method: :delete
,
remote:
true
,
class:
"btn-xs btn btn-remove"
,
title:
'Remove user from group'
do
=
link_to
group_group_member_path
(
@group
,
member
),
data:
{
confirm:
remove_user_from_group_message
(
@group
,
memb
er
)
},
method: :delete
,
remote:
true
,
class:
"btn-xs btn btn-remove"
,
title:
'Remove user from group'
do
%i
.fa.fa-minus.fa-inverse
.edit-member.hide.js-toggle-content
...
...
app/views/projects/project_members/_project_member.html.haml
View file @
2a1d4255
-
user
=
member
.
user
-
return
unless
user
-
return
unless
user
||
member
.
invite?
%li
{
class:
"#{dom_class(member)} js-toggle-container project_member_row access-#{member.human_access.downcase}"
,
id:
dom_id
(
member
)}
%span
.list-item-name
-
if
member
.
user
=
image_tag
avatar_icon
(
user
.
email
,
16
),
class:
"avatar s16"
,
alt:
''
%strong
=
user
.
name
%strong
=
link_to
user
.
name
,
user_path
(
user
)
%span
.cgray
=
user
.
username
-
if
user
==
current_user
%span
.label.label-success
It's you
-
if
user
.
blocked?
%label
.label.label-danger
%strong
Blocked
-
else
=
image_tag
avatar_icon
(
member
.
invite_email
,
16
),
class:
"avatar s16"
,
alt:
''
%strong
=
member
.
invite_email
%span
.cgray
invited
-
if
member
.
created_by
by
=
link_to
member
.
created_by
.
name
,
user_path
(
member
.
created_by
)
=
time_ago_with_tooltip
(
member
.
created_at
)
-
if
current_user_can_admin_project
-
unless
@project
.
personal?
&&
user
==
current_user
...
...
@@ -25,7 +37,7 @@
=
link_to
leave_namespace_project_project_members_path
(
@project
.
namespace
,
@project
),
data:
{
confirm:
"Leave project?"
},
method: :delete
,
class:
"btn-xs btn btn-remove"
,
title:
'Leave project'
do
%i
.fa.fa-minus.fa-inverse
-
else
=
link_to
namespace_project_project_member_path
(
@project
.
namespace
,
@project
,
member
),
data:
{
confirm:
remove_from_project_team_message
(
@project
,
us
er
)
},
method: :delete
,
remote:
true
,
class:
"btn-xs btn btn-remove"
,
title:
'Remove user from team'
do
=
link_to
namespace_project_project_member_path
(
@project
.
namespace
,
@project
,
member
),
data:
{
confirm:
remove_from_project_team_message
(
@project
,
memb
er
)
},
method: :delete
,
remote:
true
,
class:
"btn-xs btn btn-remove"
,
title:
'Remove user from team'
do
%i
.fa.fa-minus.fa-inverse
.edit-member.hide.js-toggle-content
...
...
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