Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
a29db26c
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,体验更适合开发者的 AI 搜索 >>
提交
a29db26c
编写于
2月 18, 2013
作者:
D
Dmitriy Zaporozhets
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Refactor and restyle team page for project
上级
e9d8d074
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
59 addition
and
57 deletion
+59
-57
app/assets/stylesheets/sections/projects.scss
app/assets/stylesheets/sections/projects.scss
+4
-0
app/controllers/team_members_controller.rb
app/controllers/team_members_controller.rb
+3
-1
app/helpers/projects_helper.rb
app/helpers/projects_helper.rb
+0
-8
app/models/user_team_project_relationship.rb
app/models/user_team_project_relationship.rb
+4
-0
app/views/team_members/_assigned_team.html.haml
app/views/team_members/_assigned_team.html.haml
+10
-0
app/views/team_members/_assigned_teams.html.haml
app/views/team_members/_assigned_teams.html.haml
+4
-0
app/views/team_members/_show_team.html.haml
app/views/team_members/_show_team.html.haml
+0
-15
app/views/team_members/_team.html.haml
app/views/team_members/_team.html.haml
+3
-3
app/views/team_members/_team_member.html.haml
app/views/team_members/_team_member.html.haml
+5
-5
app/views/team_members/_teams.html.haml
app/views/team_members/_teams.html.haml
+0
-16
app/views/team_members/index.html.haml
app/views/team_members/index.html.haml
+26
-9
未找到文件。
app/assets/stylesheets/sections/projects.scss
浏览文件 @
a29db26c
...
...
@@ -115,3 +115,7 @@ ul.nav.nav-projects-tabs {
}
}
}
.team_member_row
form
{
margin
:
0px
;
}
app/controllers/team_members_controller.rb
浏览文件 @
a29db26c
...
...
@@ -4,7 +4,9 @@ class TeamMembersController < ProjectResourceController
before_filter
:authorize_admin_project!
,
except:
[
:index
,
:show
]
def
index
@teams
=
UserTeam
.
scoped
@team
=
@project
.
users_projects
.
scoped
@team
=
@team
.
send
(
params
[
:type
])
if
%w(masters developers reporters guests)
.
include?
(
params
[
:type
])
@team
=
@team
.
sort_by
(
&
:project_access
).
reverse
.
group_by
(
&
:project_access
)
end
def
show
...
...
app/helpers/projects_helper.rb
浏览文件 @
a29db26c
module
ProjectsHelper
def
grouper_project_members
(
project
)
@project
.
users_projects
.
sort_by
(
&
:project_access
).
reverse
.
group_by
(
&
:project_access
)
end
def
grouper_project_teams
(
project
)
@project
.
user_team_project_relationships
.
sort_by
(
&
:greatest_access
).
reverse
.
group_by
(
&
:greatest_access
)
end
def
remove_from_project_team_message
(
project
,
user
)
"You are going to remove
#{
user
.
name
}
from
#{
project
.
name
}
project team. Are you sure?"
end
...
...
app/models/user_team_project_relationship.rb
浏览文件 @
a29db26c
...
...
@@ -26,6 +26,10 @@ class UserTeamProjectRelationship < ActiveRecord::Base
user_team
.
name
end
def
human_max_access
UserTeam
.
access_roles
.
key
(
greatest_access
)
end
private
def
check_greatest_access
...
...
app/views/team_members/_assigned_team.html.haml
0 → 100644
浏览文件 @
a29db26c
%li
{
id:
dom_id
(
team
),
class:
"user_team_row team_#{team.id}"
}
.pull-right
-
if
can?
(
current_user
,
:admin_team_member
,
@project
)
=
link_to
resign_project_team_path
(
@project
,
team
),
method: :delete
,
confirm:
"Are you shure?"
,
class:
"btn btn-remove btn-tiny"
do
%i
.icon-minus.icon-white
%strong
=
link_to
team
.
name
,
team_path
(
team
),
title:
team
.
name
,
class:
"dark"
%br
%small
.cgray
Members:
#{
team
.
members
.
count
}
%small
.cgray
Max access:
#{
team_relation
.
human_max_access
}
app/views/team_members/_assigned_teams.html.haml
0 → 100644
浏览文件 @
a29db26c
.ui-box
%ul
.well-list
-
@project
.
user_team_project_relationships
.
sort_by
(
&
:team_name
).
each
do
|
team_relation
|
=
render
"team_members/assigned_team"
,
team_relation:
team_relation
,
team:
team_relation
.
user_team
app/views/team_members/_show_team.html.haml
已删除
100644 → 0
浏览文件 @
e9d8d074
-
team
=
team_rel
.
user_team
-
allow_admin
=
can?
current_user
,
:admin_team_member
,
@project
%li
{
id:
dom_id
(
team
),
class:
"user_team_row team_#{team.id}"
}
.row
.span6
%strong
=
link_to
team
.
name
,
team_path
(
team
),
title:
team
.
name
,
class:
"dark"
%br
%small
.cgray
Members:
#{
team
.
members
.
count
}
.span5.pull-right
.pull-right
-
if
allow_admin
.left
=
link_to
resign_project_team_path
(
@project
,
team
),
method: :delete
,
confirm:
"Are you shure?"
,
class:
"btn btn-remove small"
do
%i
.icon-minus.icon-white
app/views/team_members/_team.html.haml
浏览文件 @
a29db26c
-
grouper_project_members
(
@project
)
.
each
do
|
access
,
members
|
-
@team
.
each
do
|
access
,
members
|
.ui-box
%h5
.title
=
Project
.
access_options
.
key
(
access
).
pluralize
%small
=
members
.
size
%ul
.well-list
-
members
.
sort_by
(
&
:user_name
).
each
do
|
up
|
=
render
(
partial:
'team_members/show'
,
locals:
{
member:
up
})
-
members
.
sort_by
(
&
:user_name
).
each
do
|
team_member
|
=
render
'team_members/team_member'
,
member:
team_member
:javascript
...
...
app/views/team_members/_
show
.html.haml
→
app/views/team_members/_
team_member
.html.haml
浏览文件 @
a29db26c
...
...
@@ -2,7 +2,7 @@
-
allow_admin
=
can?
current_user
,
:admin_project
,
@project
%li
{
id:
dom_id
(
user
),
class:
"team_member_row user_#{user.id}"
}
.row
.span
6
.span
4
=
link_to
project_team_member_path
(
@project
,
user
),
title:
user
.
name
,
class:
"dark"
do
=
image_tag
gravatar_icon
(
user
.
email
,
40
),
class:
"avatar s32"
=
link_to
project_team_member_path
(
@project
,
user
),
title:
user
.
name
,
class:
"dark"
do
...
...
@@ -10,18 +10,18 @@
%br
%small
.cgray
=
user
.
email
.span
5
.pull-right
.span
4
.pull-right
-
if
allow_admin
.left
=
form_for
(
member
,
as: :team_member
,
url:
project_team_member_path
(
@project
,
member
.
user
))
do
|
f
|
=
f
.
select
:project_access
,
options_for_select
(
UsersProject
.
access_roles
,
member
.
project_access
),
{},
class:
"medium project-access-select span2"
.pull-right
-
if
current_user
==
user
%span
.
btn.disabled
This is you!
%span
.
label
This is you!
-
if
@project
.
namespace_owner
==
user
%span
.
btn.disabled
Owner
%span
.
label
Owner
-
elsif
user
.
blocked
%span
.
btn.disabled.blocked
Blocked
%span
.
label
Blocked
-
elsif
allow_admin
=
link_to
project_team_member_path
(
@project
,
user
),
confirm:
remove_from_project_team_message
(
@project
,
user
),
method: :delete
,
class:
"btn-tiny btn btn-remove"
do
%i
.icon-minus.icon-white
...
...
app/views/team_members/_teams.html.haml
已删除
100644 → 0
浏览文件 @
e9d8d074
-
grouper_project_teams
(
@project
).
each
do
|
access
,
teams
|
.ui-box
%h5
.title
=
UserTeam
.
access_roles
.
key
(
access
).
pluralize
%small
=
teams
.
size
%ul
.well-list
-
teams
.
sort_by
(
&
:team_name
).
each
do
|
tofr
|
=
render
(
partial:
'team_members/show_team'
,
locals:
{
team_rel:
tofr
})
:javascript
$
(
function
(){
$
(
'
.repo-access-select, .project-access-select
'
).
live
(
"
change
"
,
function
()
{
$
(
this
.
form
).
submit
();
});
})
app/views/team_members/index.html.haml
浏览文件 @
a29db26c
...
...
@@ -18,16 +18,33 @@
%hr
.clearfix
%div
.team-table
=
render
partial:
"team_members/team"
,
locals:
{
project:
@project
}
.row
.span3
%ul
.nav.nav-pills.nav-stacked
%li
{
class:
(
"active"
if
!
params
[
:type
])}
=
link_to
project_team_members_path
(
type:
nil
)
do
All
%li
{
class:
(
"active"
if
params
[
:type
]
==
'masters'
)}
=
link_to
project_team_members_path
(
type:
'masters'
)
do
Masters
%li
{
class:
(
"active"
if
params
[
:type
]
==
'developers'
)}
=
link_to
project_team_members_path
(
type:
'developers'
)
do
Developers
%li
{
class:
(
"active"
if
params
[
:type
]
==
'reporters'
)}
=
link_to
project_team_members_path
(
type:
'reporters'
)
do
Reporters
%li
{
class:
(
"active"
if
params
[
:type
]
==
'guests'
)}
=
link_to
project_team_members_path
(
type:
'guests'
)
do
Guests
%h5
Assigned teams
(
#{
@project
.
user_teams
.
count
}
)
%div
=
render
"team_members/assigned_teams"
,
project:
@project
.span9
%div
.team-table
=
render
"team_members/team"
,
project:
@project
%h3
.page_title
Assigned teams
(
#{
@project
.
user_teams
.
count
}
)
%hr
.clearfix
%div
.team-table
=
render
partial:
"team_members/teams"
,
locals:
{
project:
@project
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录