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
Tatuya Kamada
gitlab-ce
Commits
6eabf90b
Commit
6eabf90b
authored
Aug 06, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ability to edit group member permissions
parent
f8137075
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
6 deletions
+22
-6
app/assets/javascripts/behaviors/toggler_behavior.coffee
app/assets/javascripts/behaviors/toggler_behavior.coffee
+5
-0
app/assets/javascripts/extensions/jquery.js.coffee
app/assets/javascripts/extensions/jquery.js.coffee
+4
-0
app/controllers/users_groups_controller.rb
app/controllers/users_groups_controller.rb
+2
-1
app/views/users_groups/_users_group.html.haml
app/views/users_groups/_users_group.html.haml
+9
-5
app/views/users_groups/update.js.haml
app/views/users_groups/update.js.haml
+2
-0
No files found.
app/assets/javascripts/behaviors/toggler_behavior.coffee
View file @
6eabf90b
...
...
@@ -11,3 +11,8 @@ $ ->
container
=
$
(
".js-toggle-visibility-container"
)
container
.
toggleClass
(
"hide"
)
e
.
preventDefault
()
$
(
"body"
).
on
"click"
,
".js-toggle-button"
,
(
e
)
->
$
(
@
).
disableButton
()
$
(
@
).
closest
(
".js-toggle-container"
).
find
(
".js-toggle-content"
).
show
()
e
.
preventDefault
()
app/assets/javascripts/extensions/jquery.js.coffee
View file @
6eabf90b
...
...
@@ -7,3 +7,7 @@ $.fn.enableButton = ->
$
(
@
).
removeAttr
(
'disabled'
).
removeClass
(
'disabled'
)
$
.
fn
.
disableButton
=
->
$
(
@
).
attr
(
'disabled'
,
'disabled'
).
addClass
(
'disabled'
)
app/controllers/users_groups_controller.rb
View file @
6eabf90b
...
...
@@ -13,7 +13,8 @@ class UsersGroupsController < ApplicationController
end
def
update
# TODO: implement
@member
=
@group
.
users_groups
.
find
(
params
[
:id
])
@member
.
update_attributes
(
params
[
:users_group
])
end
def
destroy
...
...
app/views/users_groups/_users_group.html.haml
View file @
6eabf90b
-
user
=
member
.
user
-
return
unless
user
%li
{
class:
dom_class
(
member
)}
%li
{
class:
"#{dom_class(member)} js-toggle-container"
,
id:
dom_id
(
member
)}
=
image_tag
gravatar_icon
(
user
.
email
,
16
),
class:
"avatar s16"
%strong
=
user
.
name
%span
.cgray
=
user
.
username
...
...
@@ -8,12 +8,16 @@
%span
.label.label-success
It's you
%span
.pull-right
-
if
@group
.
owners
.
include?
(
user
)
%span
.label.label-info
Group Owner
-
else
=
member
.
human_access
%strong
=
member
.
human_access
-
if
show_controls
&&
user
!=
@group
.
owner
&&
user
!=
current_user
=
link_to
'#'
,
class:
"btn-tiny btn js-toggle-button"
,
title:
'Edit access level'
do
%i
.icon-edit
=
link_to
group_users_group_path
(
@group
,
member
),
confirm:
remove_user_from_group_message
(
@group
,
user
),
method: :delete
,
remote:
true
,
class:
"btn-tiny btn btn-remove"
,
title:
'Remove user from group'
do
%i
.icon-minus.icon-white
.edit-member.hide.js-toggle-content
=
form_for
[
@group
,
member
],
remote:
true
do
|
f
|
.alert.prepend-top-20
=
f
.
select
:group_access
,
options_for_select
(
UsersGroup
.
group_access_roles
,
member
.
group_access
)
=
f
.
submit
'Save'
,
class:
'btn btn-save'
app/views/users_groups/update.js.haml
0 → 100644
View file @
6eabf90b
:plain
$("##{dom_id(@member)}").replaceWith('
#{
escape_javascript
(
render
(
@member
,
member:
@member
,
show_controls:
true
))
}
');
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