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
Boxiang Sun
gitlab-ce
Commits
4afd17b2
Commit
4afd17b2
authored
Sep 01, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Included groups on project_members page
parent
87a0501d
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
108 additions
and
58 deletions
+108
-58
app/assets/stylesheets/framework/lists.scss
app/assets/stylesheets/framework/lists.scss
+8
-0
app/assets/stylesheets/pages/groups.scss
app/assets/stylesheets/pages/groups.scss
+0
-2
app/assets/stylesheets/pages/members.scss
app/assets/stylesheets/pages/members.scss
+9
-0
app/controllers/projects/group_links_controller.rb
app/controllers/projects/group_links_controller.rb
+12
-0
app/controllers/projects/project_members_controller.rb
app/controllers/projects/project_members_controller.rb
+1
-0
app/views/projects/group_links/update.js.haml
app/views/projects/group_links/update.js.haml
+3
-0
app/views/projects/project_members/_group_members.html.haml
app/views/projects/project_members/_group_members.html.haml
+1
-1
app/views/projects/project_members/_groups.html.haml
app/views/projects/project_members/_groups.html.haml
+9
-0
app/views/projects/project_members/_team.html.haml
app/views/projects/project_members/_team.html.haml
+0
-12
app/views/projects/project_members/index.html.haml
app/views/projects/project_members/index.html.haml
+9
-5
app/views/shared/members/_group.html.haml
app/views/shared/members/_group.html.haml
+23
-0
app/views/shared/members/_member.html.haml
app/views/shared/members/_member.html.haml
+32
-37
config/routes.rb
config/routes.rb
+1
-1
No files found.
app/assets/stylesheets/framework/lists.scss
View file @
4afd17b2
...
...
@@ -164,6 +164,14 @@ ul.content-list {
}
}
.member-controls
{
float
:
none
;
@media
(
min-width
:
$screen-md-min
)
{
float
:
right
;
}
}
// When dragging a list item
&
.ui-sortable-helper
{
border-bottom
:
none
;
...
...
app/assets/stylesheets/pages/groups.scss
View file @
4afd17b2
.member-search-form
{
float
:
left
;
input
[
type
=
'search'
]
{
width
:
225px
;
vertical-align
:
bottom
;
...
...
app/assets/stylesheets/pages/members.scss
View file @
4afd17b2
...
...
@@ -5,6 +5,15 @@
}
.member
{
.list-item-name
{
float
:
none
;
@media
(
min-width
:
$screen-md-min
)
{
float
:
left
;
width
:
50%
;
}
}
.controls
{
display
:
flex
;
width
:
400px
;
...
...
app/controllers/projects/group_links_controller.rb
View file @
4afd17b2
...
...
@@ -19,9 +19,21 @@ class Projects::GroupLinksController < Projects::ApplicationController
redirect_to
namespace_project_group_links_path
(
project
.
namespace
,
project
)
end
def
update
@group_link
=
@project
.
project_group_links
.
find
(
params
[
:id
])
@group_link
.
update_attributes
(
group_link_params
)
end
def
destroy
project
.
project_group_links
.
find
(
params
[
:id
]).
destroy
redirect_to
namespace_project_group_links_path
(
project
.
namespace
,
project
)
end
protected
def
group_link_params
params
.
require
(
:group_link
).
permit
(
:group_access
,
:expires_at
)
end
end
app/controllers/projects/project_members_controller.rb
View file @
4afd17b2
...
...
@@ -5,6 +5,7 @@ class Projects::ProjectMembersController < Projects::ApplicationController
before_action
:authorize_admin_project_member!
,
except:
[
:index
,
:leave
,
:request_access
]
def
index
@groups
=
@project
.
project_group_links
.
all
@project_members
=
@project
.
project_members
@project_members
=
@project_members
.
non_invite
unless
can?
(
current_user
,
:admin_project
,
@project
)
...
...
app/views/projects/group_links/update.js.haml
0 → 100644
View file @
4afd17b2
:plain
var $listItem = $('
#{
escape_javascript
(
render
(
'shared/members/group'
,
group_link:
@group_link
,
group:
@group_link
.
group
))
}
');
$("##{dom_id(@group_link.group)} .list-item-name").replaceWith($listItem.find('.list-item-name'));
app/views/projects/project_members/_group_members.html.haml
View file @
4afd17b2
.panel.panel-default
.panel-heading
Group members with access to
%strong
#{
@group
.
name
}
group members
%span
.badge
=
members
.
size
-
if
can?
(
current_user
,
:admin_group_member
,
@group
)
.controls
...
...
app/views/projects/project_members/_groups.html.haml
0 → 100644
View file @
4afd17b2
.panel.panel-default
.panel-heading
Groups with access to
%strong
#{
@project
.
name
}
%span
.badge
=
groups
.
size
%ul
.content-list
-
@groups
.
each
do
|
group_link
|
-
group
=
group_link
.
group
=
render
'shared/members/group'
,
group_link:
group_link
,
group:
group
app/views/projects/project_members/_team.html.haml
View file @
4afd17b2
...
...
@@ -3,17 +3,5 @@
Users with access to
%strong
#{
@project
.
name
}
%span
.badge
=
members
.
size
.controls
=
form_tag
namespace_project_project_members_path
(
@project
.
namespace
,
@project
),
method: :get
,
class:
'form-inline member-search-form'
do
.form-group
=
search_field_tag
:search
,
params
[
:search
],
{
placeholder:
'Find existing member by name'
,
class:
'form-control'
,
spellcheck:
false
}
=
button_tag
class:
'btn'
,
title:
'Search'
do
=
icon
(
"search"
)
%ul
.content-list
=
render
partial:
'shared/members/member'
,
collection:
members
,
as: :member
:javascript
$
(
'
form.member-search-form
'
).
on
(
'
submit
'
,
function
(
event
)
{
event
.
preventDefault
();
Turbolinks
.
visit
(
this
.
action
+
'
?
'
+
$
(
this
).
serialize
());
});
app/views/projects/project_members/index.html.haml
View file @
4afd17b2
...
...
@@ -14,12 +14,16 @@
=
render
'shared/members/requests'
,
membership_source:
@project
,
requesters:
@requesters
%h5
.append-bottom-default
Existing users and groups
.append-bottom-default.clearfix
%h5
.pull-left
Existing users and groups
=
form_tag
namespace_project_project_members_path
(
@project
.
namespace
,
@project
),
method: :get
,
class:
'form-inline member-search-form pull-right hidden-xs hidden-sm'
do
.form-group
=
search_field_tag
:search
,
params
[
:search
],
{
placeholder:
'Find existing members by name'
,
class:
'form-control'
,
spellcheck:
false
}
=
icon
(
"search"
)
-
if
@grups
=
render
'groups'
,
groups:
@groups
=
render
'team'
,
members:
@project_members
-
if
@group
=
render
"group_members"
,
members:
@group_members
-
if
@project_group_links
.
any?
&&
@project
.
allowed_to_share_with_group?
=
render
"shared_group_members"
app/views/shared/members/_group.html.haml
0 → 100644
View file @
4afd17b2
-
group
=
local_assigns
[
:group
]
-
group_link
=
local_assigns
[
:group_link
]
%li
.member
{
class:
dom_class
(
group
),
id:
dom_id
(
group
)
}
%span
{
class:
"list-item-name"
}
=
image_tag
group_icon
(
group
),
class:
"avatar s40"
,
alt:
''
%strong
=
link_to
group
.
name
,
group_path
(
group
)
.cgray
Joined
#{
time_ago_with_tooltip
(
group
.
created_at
)
}
-
if
group_link
.
expires?
·
%span
{
class:
(
'text-warning'
if
group_link
.
expires_soon?
)
}
Expires in
#{
distance_of_time_in_words_to_now
(
group_link
.
expires_at
)
}
.controls.member-controls
=
form_tag
namespace_project_group_link_path
(
@project
.
namespace
,
@project
,
group_link
),
method: :put
,
remote:
true
,
class:
'form-horizontal'
do
=
select_tag
'group_link[group_access]'
,
options_for_select
(
ProjectGroupLink
.
access_options
,
group_link
.
group_access
),
class:
'form-control member-form-control append-right-5 js-member-update-control'
,
id:
"member_access_level_
#{
group
.
id
}
"
.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
}
"
%i
.clear-icon.js-clear-input
=
link_to
icon
(
'trash'
),
namespace_project_group_link_path
(
@project
.
namespace
,
@project
,
group_link
),
remote:
true
,
method: :delete
,
class:
'btn btn-remove'
app/views/shared/members/_member.html.haml
View file @
4afd17b2
...
...
@@ -3,43 +3,6 @@
-
user
=
member
.
user
%li
.member
{
class:
dom_class
(
member
),
id:
dom_id
(
member
)
}
-
if
show_roles
.controls
-
if
show_controls
-
if
@project
.
owner
!=
user
=
form_for
member
,
remote:
true
,
html:
{
class:
'form-horizontal'
}
do
|
f
|
=
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
)
.prepend-left-5.append-right-10.clearable-input.member-form-control
=
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
-
if
!
user
&&
can?
(
current_user
,
action_member_permission
(
:admin
,
member
),
member
.
source
)
=
link_to
'Resend invite'
,
polymorphic_path
([
:resend_invite
,
member
]),
method: :post
,
class:
'btn'
-
else
Owner
-
if
member
.
request?
&&
can?
(
current_user
,
action_member_permission
(
:update
,
member
),
member
)
=
link_to
icon
(
'check inverse'
),
polymorphic_path
([
:approve_access_request
,
member
]),
method: :post
,
class:
'btn btn-success'
,
title:
'Grant access'
-
if
can?
(
current_user
,
action_member_permission
(
:destroy
,
member
),
member
)
-
if
current_user
==
user
=
link_to
icon
(
'sign-out'
,
text:
'Leave'
),
polymorphic_path
([
:leave
,
member
.
source
,
:members
]),
method: :delete
,
data:
{
confirm:
leave_confirmation_message
(
member
.
source
)
},
class:
'btn btn-remove'
-
else
=
link_to
icon
(
'trash'
),
member
,
remote:
true
,
method: :delete
,
data:
{
confirm:
remove_member_message
(
member
)
},
class:
'btn btn-remove'
,
title:
remove_member_title
(
member
)
%span
{
class:
(
"list-item-name"
if
show_controls
)
}
-
if
user
=
image_tag
avatar_icon
(
user
,
40
),
class:
"avatar s40"
,
alt:
''
...
...
@@ -74,3 +37,35 @@
by
=
link_to
member
.
created_by
.
name
,
user_path
(
member
.
created_by
)
=
time_ago_with_tooltip
(
member
.
created_at
)
-
if
show_roles
.controls.member-controls
-
if
show_controls
=
form_for
member
,
remote:
true
,
html:
{
class:
'form-horizontal'
}
do
|
f
|
=
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
)
.prepend-left-5.append-right-10.clearable-input.member-form-control
=
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
-
if
!
user
&&
can?
(
current_user
,
action_member_permission
(
:admin
,
member
),
member
.
source
)
=
link_to
'Resend invite'
,
polymorphic_path
([
:resend_invite
,
member
]),
method: :post
,
class:
'btn'
-
if
member
.
request?
&&
can?
(
current_user
,
action_member_permission
(
:update
,
member
),
member
)
=
link_to
icon
(
'check inverse'
),
polymorphic_path
([
:approve_access_request
,
member
]),
method: :post
,
class:
'btn btn-success'
,
title:
'Grant access'
-
if
can?
(
current_user
,
action_member_permission
(
:destroy
,
member
),
member
)
-
if
current_user
==
user
=
link_to
icon
(
'sign-out'
,
text:
'Leave'
),
polymorphic_path
([
:leave
,
member
.
source
,
:members
]),
method: :delete
,
data:
{
confirm:
leave_confirmation_message
(
member
.
source
)
},
class:
'btn btn-remove'
-
else
=
link_to
icon
(
'trash'
),
member
,
remote:
true
,
method: :delete
,
data:
{
confirm:
remove_member_message
(
member
)
},
class:
'btn btn-remove'
,
title:
remove_member_title
(
member
)
config/routes.rb
View file @
4afd17b2
...
...
@@ -867,7 +867,7 @@ Rails.application.routes.draw do
end
end
resources
:group_links
,
only:
[
:index
,
:create
,
:destroy
],
constraints:
{
id:
/\d+/
}
resources
:group_links
,
only:
[
:index
,
:create
,
:
update
,
:
destroy
],
constraints:
{
id:
/\d+/
}
resources
:notes
,
only:
[
:index
,
:create
,
:destroy
,
:update
],
constraints:
{
id:
/\d+/
}
do
member
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