BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
cef746dc
Commit
cef746dc
authored
May 29, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
User should be able to leave group. If not - show him proper message
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
aa97325d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
5 deletions
+9
-5
CHANGELOG
CHANGELOG
+1
-0
group_members_controller.rb
app/controllers/groups/group_members_controller.rb
+5
-1
index.html.haml
app/views/dashboard/groups/index.html.haml
+3
-4
No files found.
CHANGELOG
View file @
cef746dc
...
...
@@ -29,6 +29,7 @@ v 7.12.0 (unreleased)
- Clarify navigation labels for Project Settings and Group Settings.
- Move user avatar and logout button to sidebar
- You can not remove user if he/she is an only owner of group
- User should be able to leave group. If not - show him proper message
v 7.11.4
- Fix missing bullets when creating lists
...
...
app/controllers/groups/group_members_controller.rb
View file @
cef746dc
...
...
@@ -66,7 +66,11 @@ class Groups::GroupMembersController < Groups::ApplicationController
@group_member
.
destroy
redirect_to
(
dashboard_groups_path
,
notice:
"You left
#{
group
.
name
}
group."
)
else
return
render_403
if
@group
.
last_owner?
(
current_user
)
redirect_to
(
dashboard_groups_path
,
alert:
"You can not leave
#{
group
.
name
}
group because you're the last owner. Transfer or delete the group."
)
else
return
render_403
end
end
end
...
...
app/views/dashboard/groups/index.html.haml
View file @
cef746dc
...
...
@@ -23,10 +23,9 @@
%i
.fa.fa-cogs
Settings
-
if
can?
(
current_user
,
:destroy_group_member
,
group_member
)
=
link_to
leave_group_group_members_path
(
group
),
data:
{
confirm:
leave_group_message
(
group
.
name
)
},
method: :delete
,
class:
"btn-sm btn btn-grouped"
,
title:
'Remove user from group'
do
%i
.fa.fa-sign-out
Leave
=
link_to
leave_group_group_members_path
(
group
),
data:
{
confirm:
leave_group_message
(
group
.
name
)
},
method: :delete
,
class:
"btn-sm btn btn-grouped"
,
title:
'Leave this group'
do
%i
.fa.fa-sign-out
Leave
=
image_tag
group_icon
(
group
),
class:
"avatar s40 avatar-tile"
=
link_to
group
,
class:
'group-name'
do
...
...
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