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
Jérome Perrin
gitlab-ce
Commits
843dd24b
Commit
843dd24b
authored
Sep 01, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mobile improvements
Added group name to members row Fixed saving group member
parent
e33cda96
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
74 additions
and
24 deletions
+74
-24
app/assets/javascripts/project_members.js.es6
app/assets/javascripts/project_members.js.es6
+6
-1
app/assets/stylesheets/framework/lists.scss
app/assets/stylesheets/framework/lists.scss
+6
-2
app/assets/stylesheets/pages/members.scss
app/assets/stylesheets/pages/members.scss
+35
-7
app/views/groups/group_members/update.js.haml
app/views/groups/group_members/update.js.haml
+2
-2
app/views/projects/project_members/_team.html.haml
app/views/projects/project_members/_team.html.haml
+1
-1
app/views/shared/members/_group.html.haml
app/views/shared/members/_group.html.haml
+5
-2
app/views/shared/members/_member.html.haml
app/views/shared/members/_member.html.haml
+19
-9
No files found.
app/assets/javascripts/project_members.js.es6
View file @
843dd24b
((w) => {
((w) => {
w
indow.gl = windo
w.gl || {};
w
.gl =
w.gl || {};
class ProjectMembers {
class ProjectMembers {
constructor() {
constructor() {
...
@@ -10,6 +10,7 @@
...
@@ -10,6 +10,7 @@
removeListeners() {
removeListeners() {
$('.project_member, .group_member').off('ajax:success');
$('.project_member, .group_member').off('ajax:success');
$('.js-member-update-control').off('change');
$('.js-member-update-control').off('change');
$('.js-edit-member-form').off('ajax:success');
}
}
addListeners() {
addListeners() {
...
@@ -17,6 +18,10 @@
...
@@ -17,6 +18,10 @@
$('.js-member-update-control').on('change', function () {
$('.js-member-update-control').on('change', function () {
$(this).closest('form')
$(this).closest('form')
.trigger("submit.rails");
.trigger("submit.rails");
$(this).disable();
});
$('.js-edit-member-form').on('ajax:success', function () {
$(this).find('.js-member-update-control').enable();
});
});
}
}
...
...
app/assets/stylesheets/framework/lists.scss
View file @
843dd24b
...
@@ -128,6 +128,10 @@ ul.content-list {
...
@@ -128,6 +128,10 @@ ul.content-list {
color
:
$gl-dark-link-color
;
color
:
$gl-dark-link-color
;
}
}
.member-group-link
{
color
:
$blue-normal
;
}
.description
{
.description
{
p
{
p
{
@include
str-truncated
;
@include
str-truncated
;
...
@@ -166,8 +170,8 @@ ul.content-list {
...
@@ -166,8 +170,8 @@ ul.content-list {
.member-controls
{
.member-controls
{
float
:
none
;
float
:
none
;
@media
(
min-width
:
$screen-
md
-min
)
{
@media
(
min-width
:
$screen-
sm
-min
)
{
float
:
right
;
float
:
right
;
}
}
}
}
...
...
app/assets/stylesheets/pages/members.scss
View file @
843dd24b
...
@@ -8,24 +8,52 @@
...
@@ -8,24 +8,52 @@
.list-item-name
{
.list-item-name
{
float
:
none
;
float
:
none
;
@media
(
min-width
:
$screen-
md
-min
)
{
@media
(
min-width
:
$screen-
sm
-min
)
{
float
:
left
;
float
:
left
;
width
:
50%
;
width
:
50%
;
}
}
}
}
.controls
{
.controls
{
display
:
flex
;
@media
(
min-width
:
$screen-sm-min
)
{
width
:
400px
;
display
:
flex
;
width
:
400px
;
max-width
:
50%
;
}
}
}
.form-horizontal
{
.form-horizontal
{
display
:
flex
;
margin-top
:
5px
;
flex
:
1
;
margin-top
:
3px
;
@media
(
min-width
:
$screen-sm-min
)
{
display
:
flex
;
flex
:
1
;
margin-top
:
3px
;
}
}
.btn-remove
{
width
:
100%
;
@media
(
min-width
:
$screen-sm-min
)
{
width
:
auto
;
}
}
}
.member-form-control
{
@media
(
max-width
:
$screen-xs-max
)
{
padding
:
5px
0
;
margin-left
:
0
;
margin-right
:
0
;
}
}
.member-form-control
{
@media
(
min-width
:
$screen-sm-min
)
{
width
:
50%
;
width
:
50%
;
}
}
}
}
.member-access-text
{
margin-left
:
auto
;
line-height
:
43px
;
}
app/views/groups/group_members/update.js.haml
View file @
843dd24b
:plain
:plain
$("##{dom_id(@group_member)}").replaceWith
('
#{
escape_javascript
(
render
(
'shared/members/member'
,
member:
@group_member
))
}
');
var $listItem = $
('
#{
escape_javascript
(
render
(
'shared/members/member'
,
member:
@group_member
))
}
');
new gl.MemberExpirationDate(
);
$("##{dom_id(@group_member)} .list-item-name").replaceWith($listItem.find('.list-item-name')
);
app/views/projects/project_members/_team.html.haml
View file @
843dd24b
...
@@ -6,4 +6,4 @@
...
@@ -6,4 +6,4 @@
%ul
.content-list
%ul
.content-list
-
members
.
each
do
|
user
|
-
members
.
each
do
|
user
|
-
member
=
@project
.
team
.
find_member
(
user
.
id
)
-
member
=
@project
.
team
.
find_member
(
user
.
id
)
=
render
'shared/members/member'
,
member:
member
=
render
'shared/members/member'
,
member:
member
,
user:
user
app/views/shared/members/_group.html.haml
View file @
843dd24b
...
@@ -17,7 +17,10 @@
...
@@ -17,7 +17,10 @@
.prepend-left-5.append-right-10.clearable-input.member-form-control
.prepend-left-5.append-right-10.clearable-input.member-form-control
=
text_field_tag
'group_link[expires_at]'
,
group_link
.
expires_at
,
class:
'form-control js-access-expiration-date js-member-update-control'
,
placeholder:
'Expiration date'
,
id:
"member_expires_at_
#{
group
.
id
}
"
=
text_field_tag
'group_link[expires_at]'
,
group_link
.
expires_at
,
class:
'form-control js-access-expiration-date js-member-update-control'
,
placeholder:
'Expiration date'
,
id:
"member_expires_at_
#{
group
.
id
}
"
%i
.clear-icon.js-clear-input
%i
.clear-icon.js-clear-input
=
link_to
icon
(
'trash'
),
namespace_project_group_link_path
(
@project
.
namespace
,
@project
,
group_link
),
=
link_to
namespace_project_group_link_path
(
@project
.
namespace
,
@project
,
group_link
),
remote:
true
,
remote:
true
,
method: :delete
,
method: :delete
,
class:
'btn btn-remove'
class:
'btn btn-remove'
do
%span
.visible-xs-block
Delete
=
icon
(
'trash'
,
class:
'hidden-xs'
)
app/views/shared/members/_member.html.haml
View file @
843dd24b
-
show_roles
=
local_assigns
.
fetch
(
:show_roles
,
true
)
-
show_roles
=
local_assigns
.
fetch
(
:show_roles
,
true
)
-
show_controls
=
local_assigns
.
fetch
(
:show_controls
,
true
)
-
show_controls
=
local_assigns
.
fetch
(
:show_controls
,
true
)
-
user
=
member
.
user
-
user
=
local_assigns
.
fetch
(
:user
,
member
.
user
)
%li
.member
{
class:
dom_class
(
member
),
id:
dom_id
(
member
)
}
%li
.member
{
class:
dom_class
(
member
),
id:
dom_id
(
member
)
}
%span
{
class:
(
"list-item-name"
if
show_controls
)
}
%span
{
class:
(
"list-item-name"
if
show_controls
)
}
...
@@ -11,12 +11,16 @@
...
@@ -11,12 +11,16 @@
%span
.cgray
=
user
.
to_reference
%span
.cgray
=
user
.
to_reference
-
if
user
==
current_user
-
if
user
==
current_user
%span
.label.label-success
It's you
%span
.label.label-success
.prepend-left-5
It's you
-
if
user
.
blocked?
-
if
user
.
blocked?
%label
.label.label-danger
%label
.label.label-danger
%strong
Blocked
%strong
Blocked
-
if
member
.
respond_to?
(
:group
)
&&
!
@group
=
link_to
member
.
group
,
class:
"member-group-link prepend-left-5"
do
=
"·
#{
member
.
group
.
name
}
"
.cgray
.cgray
-
if
member
.
request?
-
if
member
.
request?
Requested
Requested
...
@@ -40,11 +44,14 @@
...
@@ -40,11 +44,14 @@
-
if
show_roles
-
if
show_roles
.controls.member-controls
.controls.member-controls
-
if
show_controls
-
if
show_controls
=
form_for
member
,
remote:
true
,
html:
{
class:
'form-horizontal'
}
do
|
f
|
-
if
user
!=
current_user
=
f
.
select
:access_level
,
options_for_select
(
member
.
class
.
access_level_roles
,
member
.
access_level
),
{},
class:
'form-control member-form-control append-right-5 js-member-update-control'
,
id:
"member_access_level_
#{
member
.
id
}
"
,
disabled:
!
can?
(
current_user
,
action_member_permission
(
:update
,
member
),
member
)
=
form_for
member
,
remote:
true
,
html:
{
class:
'form-horizontal js-edit-member-form'
}
do
|
f
|
.prepend-left-5.append-right-10.clearable-input.member-form-control
=
f
.
select
:access_level
,
options_for_select
(
member
.
class
.
access_level_roles
,
member
.
access_level
),
{},
class:
'form-control member-form-control append-right-5 js-member-update-control'
,
id:
"member_access_level_
#{
member
.
id
}
"
,
disabled:
!
can?
(
current_user
,
action_member_permission
(
:update
,
member
),
member
)
=
f
.
text_field
:expires_at
,
class:
'form-control js-access-expiration-date js-member-update-control'
,
placeholder:
'Expiration date'
,
id:
"member_expires_at_
#{
member
.
id
}
"
,
disabled:
!
can?
(
current_user
,
action_member_permission
(
:update
,
member
),
member
)
.prepend-left-5.append-right-10.clearable-input.member-form-control
%i
.clear-icon.js-clear-input
=
f
.
text_field
:expires_at
,
class:
'form-control js-access-expiration-date js-member-update-control'
,
placeholder:
'Expiration date'
,
id:
"member_expires_at_
#{
member
.
id
}
"
,
disabled:
!
can?
(
current_user
,
action_member_permission
(
:update
,
member
),
member
)
%i
.clear-icon.js-clear-input
-
else
%span
.member-access-text
=
member
.
human_access
-
if
!
user
&&
can?
(
current_user
,
action_member_permission
(
:admin
,
member
),
member
.
source
)
-
if
!
user
&&
can?
(
current_user
,
action_member_permission
(
:admin
,
member
),
member
.
source
)
=
link_to
'Resend invite'
,
polymorphic_path
([
:resend_invite
,
member
]),
=
link_to
'Resend invite'
,
polymorphic_path
([
:resend_invite
,
member
]),
method: :post
,
method: :post
,
...
@@ -63,9 +70,12 @@
...
@@ -63,9 +70,12 @@
data:
{
confirm:
leave_confirmation_message
(
member
.
source
)
},
data:
{
confirm:
leave_confirmation_message
(
member
.
source
)
},
class:
'btn btn-remove'
class:
'btn btn-remove'
-
else
-
else
=
link_to
icon
(
'trash'
),
member
,
=
link_to
member
,
remote:
true
,
remote:
true
,
method: :delete
,
method: :delete
,
data:
{
confirm:
remove_member_message
(
member
)
},
data:
{
confirm:
remove_member_message
(
member
)
},
class:
'btn btn-remove'
,
class:
'btn btn-remove'
,
title:
remove_member_title
(
member
)
title:
remove_member_title
(
member
)
do
%span
.visible-xs-block
Delete
=
icon
(
'trash'
,
class:
'hidden-xs'
)
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