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
e14718fb
Commit
e14718fb
authored
May 30, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add permission filter to teams -> members page
parent
56b42f58
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
24 deletions
+37
-24
app/models/user_team.rb
app/models/user_team.rb
+0
-1
app/views/teams/members/_member.html.haml
app/views/teams/members/_member.html.haml
+7
-7
app/views/teams/members/_team.html.haml
app/views/teams/members/_team.html.haml
+7
-13
app/views/teams/members/index.html.haml
app/views/teams/members/index.html.haml
+23
-3
No files found.
app/models/user_team.rb
View file @
e14718fb
...
...
@@ -113,5 +113,4 @@ class UserTeam < ActiveRecord::Base
def
admin?
(
member
)
user_team_user_relationships
.
with_user
(
member
).
first
.
group_admin?
end
end
app/views/teams/members/_
show
.html.haml
→
app/views/teams/members/_
member
.html.haml
View file @
e14718fb
...
...
@@ -2,7 +2,7 @@
-
allow_admin
=
can?
current_user
,
:manage_user_team
,
@team
%li
{
id:
dom_id
(
member
),
class:
"team_member_row user_#{user.id}"
}
.row
.span
4
.span
3
=
link_to
user_path
(
user
.
username
),
title:
user
.
name
,
class:
"dark"
do
=
image_tag
gravatar_icon
(
user
.
email
,
40
),
class:
"avatar s32"
=
link_to
user_path
(
user
.
username
),
title:
user
.
name
,
class:
"dark"
do
...
...
@@ -10,22 +10,22 @@
%br
%small
.cgray
=
user
.
username
.span
7
.pull-right
.span
5
.pull-right
-
if
allow_admin
.pull-left
=
form_for
(
member
,
as: :team_member
,
url:
team_member_path
(
@team
,
user
))
do
|
f
|
=
label_tag
do
=
label_tag
:group_admin
do
=
f
.
check_box
:group_admin
,
class:
'trigger-submit'
%span
Admin access
=
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:
"
span2
trigger-submit"
.pull-right
-
if
current_user
==
user
%span
.
btn.disabled
This is you!
%span
.
label.label-success
This is you!
-
if
@team
.
owner
==
user
%span
.
btn.disabled
Owner
%span
.
label.label-info
Owner
-
elsif
user
.
blocked?
%span
.
btn.disabled.blocked
Blocked
%span
.
label.label-error
Blocked
-
elsif
allow_admin
=
link_to
team_member_path
(
@team
,
user
),
confirm:
remove_from_user_team_message
(
@team
,
user
),
method: :delete
,
class:
"btn-tiny btn btn-remove"
,
title:
"Remove from team"
do
%i
.icon-minus.icon-white
app/views/teams/members/_team.html.haml
View file @
e14718fb
-
grouped_user_team_members
(
@team
).
each
do
|
access
,
members
|
-
grouped_user_team_members
(
team
).
each
do
|
access
,
members
|
-
access_key
=
Project
.
access_options
.
key
(
access
)
-
next
if
params
[
:type
].
present?
&&
params
[
:type
]
!=
access_key
.
tableize
.ui-box
%h5
.title
=
Project
.
access_options
.
key
(
access
)
.
pluralize
=
access_key
.
pluralize
%small
=
members
.
size
%ul
.well-list
-
members
.
sort_by
(
&
:user_name
).
each
do
|
up
|
=
render
(
partial:
'teams/members/show'
,
locals:
{
member:
up
})
:javascript
$
(
function
(){
$
(
'
.repo-access-select, .project-access-select
'
).
live
(
"
change
"
,
function
()
{
$
(
this
.
form
).
submit
();
});
})
%ul
.well-list.team-members
-
members
.
sort_by
(
&
:user_name
).
each
do
|
member
|
=
render
'teams/members/member'
,
member:
member
app/views/teams/members/index.html.haml
View file @
e14718fb
...
...
@@ -12,6 +12,26 @@
%hr
.clearfix
%div
.team-table
=
render
partial:
"teams/members/team"
,
locals:
{
project:
@team
}
.row
.span3
%ul
.nav.nav-pills.nav-stacked
%li
{
class:
(
"active"
if
!
params
[
:type
])}
=
link_to
team_members_path
(
@team
,
type:
nil
)
do
All
%li
{
class:
(
"active"
if
params
[
:type
]
==
'masters'
)}
=
link_to
team_members_path
(
@team
,
type:
'masters'
)
do
Masters
%li
{
class:
(
"active"
if
params
[
:type
]
==
'developers'
)}
=
link_to
team_members_path
(
@team
,
type:
'developers'
)
do
Developers
%li
{
class:
(
"active"
if
params
[
:type
]
==
'reporters'
)}
=
link_to
team_members_path
(
@team
,
type:
'reporters'
)
do
Reporters
%li
{
class:
(
"active"
if
params
[
:type
]
==
'guests'
)}
=
link_to
team_members_path
(
@team
,
type:
'guests'
)
do
Guests
.span9
.clearfix
%div
.team-table
=
render
"teams/members/team"
,
team:
@team
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