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
9c99c4fe
Commit
9c99c4fe
authored
Dec 12, 2014
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show different controls on project member page depending on if the membership lock is in place.
parent
c19248a2
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
15 deletions
+37
-15
app/helpers/projects_helper.rb
app/helpers/projects_helper.rb
+8
-0
app/views/projects/team_members/_team_member.html.haml
app/views/projects/team_members/_team_member.html.haml
+10
-9
app/views/projects/team_members/index.html.haml
app/views/projects/team_members/index.html.haml
+12
-6
app/views/shared/_group_form.html.haml
app/views/shared/_group_form.html.haml
+7
-0
No files found.
app/helpers/projects_helper.rb
View file @
9c99c4fe
...
...
@@ -279,4 +279,12 @@ module ProjectsHelper
result
.
password
=
'*****'
if
result
.
password
.
present?
result
end
def
membership_locked?
if
@project
.
group
&&
@project
.
group
.
membership_lock
true
else
false
end
end
end
app/views/projects/team_members/_team_member.html.haml
View file @
9c99c4fe
-
user
=
member
.
user
%li
{
id:
dom_id
(
user
),
class:
"team_member_row access-#{member.human_access.downcase}"
}
-
unless
membership_locked?
.pull-right
-
if
current_user_can_admin_project
-
unless
@project
.
personal?
&&
user
==
current_user
...
...
app/views/projects/team_members/index.html.haml
View file @
9c99c4fe
%h3
.page-title
Users with access to this project
-
if
can?
current_user
,
:admin_team_member
,
@project
-
unless
membership_locked?
-
if
can?
(
current_user
,
:admin_team_member
,
@project
)
%span
.pull-right
=
link_to
new_project_team_member_path
(
@project
),
class:
"btn btn-new btn-grouped"
,
title:
"New project member"
do
New project member
=
link_to
import_project_team_members_path
(
@project
),
class:
"btn btn-grouped"
,
title:
"Import members from another project"
do
Import members
%p
.light
Read more about project permissions
%strong
=
link_to
"here"
,
help_page_path
(
"permissions"
,
"permissions"
),
class:
"vlink"
-
if
membership_locked?
%span
.pull-right
Adding new user to membership is disabled by a group setting
=
render
"team"
,
members:
@project_members
-
if
@group
=
render
"group_members"
...
...
app/views/shared/_group_form.html.haml
View file @
9c99c4fe
...
...
@@ -10,3 +10,10 @@
.col-sm-10
=
f
.
text_area
:description
,
maxlength:
250
,
class:
'form-control js-gfm-input'
,
rows:
4
.form-group
=
f
.
label
:name
,
class:
'control-label'
do
Member lock
.col-sm-10
.checkbox
=
f
.
check_box
:membership_lock
%span
.descr
Prevent adding new members to project membership within this group
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