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
Léo-Paul Géneau
gitlab-ce
Commits
453340d4
Commit
453340d4
authored
Apr 10, 2015
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Let membership invitations be resent.
parent
87dd3f21
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
0 deletions
+37
-0
app/controllers/groups/group_members_controller.rb
app/controllers/groups/group_members_controller.rb
+11
-0
app/controllers/projects/project_members_controller.rb
app/controllers/projects/project_members_controller.rb
+13
-0
app/views/groups/group_members/_group_member.html.haml
app/views/groups/group_members/_group_member.html.haml
+4
-0
app/views/projects/project_members/_project_member.html.haml
app/views/projects/project_members/_project_member.html.haml
+4
-0
config/routes.rb
config/routes.rb
+5
-0
No files found.
app/controllers/groups/group_members_controller.rb
View file @
453340d4
...
...
@@ -47,6 +47,17 @@ class Groups::GroupMembersController < Groups::ApplicationController
end
end
def
resend_invite
@group_member
=
@group
.
group_members
.
find
(
params
[
:id
])
if
@group_member
.
invite?
@group_member
.
resend_invite
redirect_to
group_group_members_path
(
@group
),
notice:
'Invite was successfully resent.'
else
redirect_to
group_group_members_path
(
@group
),
alert:
'The invite has already been accepted.'
end
end
def
leave
@group_member
=
@group
.
group_members
.
where
(
user_id:
current_user
.
id
).
first
...
...
app/controllers/projects/project_members_controller.rb
View file @
453340d4
...
...
@@ -59,6 +59,19 @@ class Projects::ProjectMembersController < Projects::ApplicationController
end
end
def
resend_invite
@project_member
=
@project
.
project_members
.
find
(
params
[
:id
])
if
@project_member
.
invite?
@project_member
.
resend_invite
redirect_to
namespace_project_project_members_path
(
@project
.
namespace
,
@project
),
notice:
'Invite was successfully resent.'
else
redirect_to
namespace_project_project_members_path
(
@project
.
namespace
,
@project
),
alert:
'The invite has already been accepted.'
end
end
def
leave
@project
.
project_members
.
find_by
(
user_id:
current_user
).
destroy
...
...
app/views/groups/group_members/_group_member.html.haml
View file @
453340d4
...
...
@@ -24,6 +24,10 @@
=
link_to
member
.
created_by
.
name
,
user_path
(
member
.
created_by
)
=
time_ago_with_tooltip
(
member
.
created_at
)
-
if
show_controls
&&
can?
(
current_user
,
:admin_group
,
@group
)
=
link_to
resend_invite_group_group_member_path
(
@group
,
member
),
method: :post
,
class:
"btn-xs btn"
,
title:
'Resend invite'
do
Resend invite
-
if
show_roles
%span
.pull-right
%strong
=
member
.
human_access
...
...
app/views/projects/project_members/_project_member.html.haml
View file @
453340d4
...
...
@@ -24,6 +24,10 @@
=
link_to
member
.
created_by
.
name
,
user_path
(
member
.
created_by
)
=
time_ago_with_tooltip
(
member
.
created_at
)
-
if
current_user_can_admin_project
=
link_to
resend_invite_namespace_project_project_member_path
(
@project
.
namespace
,
@project
,
member
),
method: :post
,
class:
"btn-xs btn"
,
title:
'Resend invite'
do
Resend invite
-
if
current_user_can_admin_project
-
unless
@project
.
personal?
&&
user
==
current_user
.pull-right
...
...
config/routes.rb
View file @
453340d4
...
...
@@ -260,6 +260,7 @@ Gitlab::Application.routes.draw do
scope
module: :groups
do
resources
:group_members
,
only:
[
:index
,
:create
,
:update
,
:destroy
]
do
post
:resend_invite
,
on: :member
delete
:leave
,
on: :collection
end
...
...
@@ -486,6 +487,10 @@ Gitlab::Application.routes.draw do
get
:import
post
:apply_import
end
member
do
post
:resend_invite
end
end
resources
:notes
,
only:
[
:index
,
:create
,
:destroy
,
:update
],
constraints:
{
id:
/\d+/
}
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