Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
e14718fb
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e14718fb
编写于
5月 30, 2013
作者:
D
Dmitriy Zaporozhets
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add permission filter to teams -> members page
上级
56b42f58
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
37 addition
and
24 deletion
+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
未找到文件。
app/models/user_team.rb
浏览文件 @
e14718fb
...
@@ -113,5 +113,4 @@ class UserTeam < ActiveRecord::Base
...
@@ -113,5 +113,4 @@ class UserTeam < ActiveRecord::Base
def
admin?
(
member
)
def
admin?
(
member
)
user_team_user_relationships
.
with_user
(
member
).
first
.
group_admin?
user_team_user_relationships
.
with_user
(
member
).
first
.
group_admin?
end
end
end
end
app/views/teams/members/_
show
.html.haml
→
app/views/teams/members/_
member
.html.haml
浏览文件 @
e14718fb
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
-
allow_admin
=
can?
current_user
,
:manage_user_team
,
@team
-
allow_admin
=
can?
current_user
,
:manage_user_team
,
@team
%li
{
id:
dom_id
(
member
),
class:
"team_member_row user_#{user.id}"
}
%li
{
id:
dom_id
(
member
),
class:
"team_member_row user_#{user.id}"
}
.row
.row
.span
4
.span
3
=
link_to
user_path
(
user
.
username
),
title:
user
.
name
,
class:
"dark"
do
=
link_to
user_path
(
user
.
username
),
title:
user
.
name
,
class:
"dark"
do
=
image_tag
gravatar_icon
(
user
.
email
,
40
),
class:
"avatar s32"
=
image_tag
gravatar_icon
(
user
.
email
,
40
),
class:
"avatar s32"
=
link_to
user_path
(
user
.
username
),
title:
user
.
name
,
class:
"dark"
do
=
link_to
user_path
(
user
.
username
),
title:
user
.
name
,
class:
"dark"
do
...
@@ -10,22 +10,22 @@
...
@@ -10,22 +10,22 @@
%br
%br
%small
.cgray
=
user
.
username
%small
.cgray
=
user
.
username
.span
7
.pull-right
.span
5
.pull-right
-
if
allow_admin
-
if
allow_admin
.pull-left
.pull-left
=
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
|
=
label_tag
do
=
label_tag
:group_admin
do
=
f
.
check_box
:group_admin
,
class:
'trigger-submit'
=
f
.
check_box
:group_admin
,
class:
'trigger-submit'
%span
Admin access
%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
.pull-right
-
if
current_user
==
user
-
if
current_user
==
user
%span
.
btn.disabled
This is you!
%span
.
label.label-success
This is you!
-
if
@team
.
owner
==
user
-
if
@team
.
owner
==
user
%span
.
btn.disabled
Owner
%span
.
label.label-info
Owner
-
elsif
user
.
blocked?
-
elsif
user
.
blocked?
%span
.
btn.disabled.blocked
Blocked
%span
.
label.label-error
Blocked
-
elsif
allow_admin
-
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
=
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
%i
.icon-minus.icon-white
app/views/teams/members/_team.html.haml
浏览文件 @
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
.ui-box
%h5
.title
%h5
.title
=
Project
.
access_options
.
key
(
access
)
.
pluralize
=
access_key
.
pluralize
%small
=
members
.
size
%small
=
members
.
size
%ul
.well-list
%ul
.well-list.team-members
-
members
.
sort_by
(
&
:user_name
).
each
do
|
up
|
-
members
.
sort_by
(
&
:user_name
).
each
do
|
member
|
=
render
(
partial:
'teams/members/show'
,
locals:
{
member:
up
})
=
render
'teams/members/member'
,
member:
member
:javascript
$
(
function
(){
$
(
'
.repo-access-select, .project-access-select
'
).
live
(
"
change
"
,
function
()
{
$
(
this
.
form
).
submit
();
});
})
app/views/teams/members/index.html.haml
浏览文件 @
e14718fb
...
@@ -12,6 +12,26 @@
...
@@ -12,6 +12,26 @@
%hr
%hr
.clearfix
.row
%div
.team-table
.span3
=
render
partial:
"teams/members/team"
,
locals:
{
project:
@team
}
%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
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录