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
97de6f85
Commit
97de6f85
authored
Feb 18, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix not-working team memebership permissions change
parent
1481d1cf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
21 deletions
+28
-21
app/assets/javascripts/main.js.coffee
app/assets/javascripts/main.js.coffee
+4
-0
app/controllers/teams/members_controller.rb
app/controllers/teams/members_controller.rb
+7
-2
app/views/teams/members/_show.html.haml
app/views/teams/members/_show.html.haml
+17
-19
No files found.
app/assets/javascripts/main.js.coffee
View file @
97de6f85
...
@@ -49,6 +49,10 @@ $ ->
...
@@ -49,6 +49,10 @@ $ ->
# Bottom tooltip
# Bottom tooltip
$
(
'.has_bottom_tooltip'
).
tooltip
(
placement
:
'bottom'
)
$
(
'.has_bottom_tooltip'
).
tooltip
(
placement
:
'bottom'
)
# Form submitter
$
(
'.trigger-submit'
).
on
'change'
,
->
$
(
@
).
parents
(
'form'
).
submit
()
# Flash
# Flash
if
(
flash
=
$
(
"#flash-container"
)).
length
>
0
if
(
flash
=
$
(
"#flash-container"
)).
length
>
0
flash
.
click
->
$
(
@
).
slideUp
(
"slow"
)
flash
.
click
->
$
(
@
).
slideUp
(
"slow"
)
...
...
app/controllers/teams/members_controller.rb
View file @
97de6f85
...
@@ -27,7 +27,13 @@ class Teams::MembersController < Teams::ApplicationController
...
@@ -27,7 +27,13 @@ class Teams::MembersController < Teams::ApplicationController
end
end
def
update
def
update
options
=
{
default_projects_access:
params
[
:default_project_access
],
group_admin:
params
[
:group_admin
]}
member_params
=
params
[
:team_member
]
options
=
{
default_projects_access:
member_params
[
:permission
],
group_admin:
member_params
[
:group_admin
]
}
if
user_team
.
update_membership
(
team_member
,
options
)
if
user_team
.
update_membership
(
team_member
,
options
)
redirect_to
team_members_path
(
user_team
),
notice:
"Membership for
#{
team_member
.
name
}
was successfully updated in Team of users."
redirect_to
team_members_path
(
user_team
),
notice:
"Membership for
#{
team_member
.
name
}
was successfully updated in Team of users."
else
else
...
@@ -45,5 +51,4 @@ class Teams::MembersController < Teams::ApplicationController
...
@@ -45,5 +51,4 @@ class Teams::MembersController < Teams::ApplicationController
def
team_member
def
team_member
@member
||=
user_team
.
members
.
find_by_username
(
params
[
:id
])
@member
||=
user_team
.
members
.
find_by_username
(
params
[
:id
])
end
end
end
end
app/views/teams/members/_show.html.haml
View file @
97de6f85
...
@@ -10,23 +10,21 @@
...
@@ -10,23 +10,21 @@
%br
%br
%small
.cgray
=
user
.
email
%small
.cgray
=
user
.
email
.span
6.pull-right
.span
4
-
if
allow_admin
-
if
allow_admin
.left.span2
=
form_for
(
member
,
as: :team_member
,
url:
team_member_path
(
@team
,
user
))
do
|
f
|
=
form_for
(
member
,
as: :team_member
,
url:
team_member_path
(
@team
,
user
))
do
|
f
|
=
f
.
select
:permission
,
options_for_select
(
UsersProject
.
access_roles
,
@team
.
default_projects_access
(
user
)),
{},
class:
"medium trigger-submit"
=
f
.
select
:permission
,
options_for_select
(
UsersProject
.
access_roles
,
@team
.
default_projects_access
(
user
)),
{},
class:
"medium project-access-select span2"
%br
.left.span2
=
label_tag
do
%span
=
f
.
check_box
:group_admin
,
class:
'trigger-submit'
-
if
@team
.
admin?
(
user
)
%span
Admin access
%i
.icon-check
.pull-right
Admin access
-
if
current_user
==
user
.pull-right
%span
.btn.disabled
This is you!
-
if
current_user
==
user
-
if
@team
.
owner
==
user
%span
.btn.disabled
This is you!
%span
.btn.disabled
Owner
-
if
@team
.
owner
==
user
-
elsif
user
.
blocked
%span
.btn.disabled
Owner
%span
.btn.disabled.blocked
Blocked
-
elsif
user
.
blocked
-
elsif
allow_admin
%span
.btn.disabled.blocked
Blocked
=
link_to
team_member_path
(
@team
,
user
),
confirm:
remove_from_user_team_message
(
@team
,
user
),
method: :delete
,
class:
"btn-tiny btn btn-remove"
do
-
elsif
allow_admin
%i
.icon-minus.icon-white
=
link_to
team_member_path
(
@team
,
user
),
confirm:
remove_from_user_team_message
(
@team
,
user
),
method: :delete
,
class:
"btn-tiny btn btn-remove"
do
%i
.icon-minus.icon-white
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