Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
3958330e
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,发现更多精彩内容 >>
未验证
提交
3958330e
编写于
12月 19, 2013
作者:
D
Dmitriy Zaporozhets
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added milestone_options and assigne_options helpers
Signed-off-by:
N
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
上级
5c68f4f4
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
14 addition
and
6 deletion
+14
-6
app/helpers/issues_helper.rb
app/helpers/issues_helper.rb
+8
-0
app/views/projects/issues/_form.html.haml
app/views/projects/issues/_form.html.haml
+2
-2
app/views/projects/issues/_issue_context.html.haml
app/views/projects/issues/_issue_context.html.haml
+2
-2
app/views/projects/merge_requests/_form.html.haml
app/views/projects/merge_requests/_form.html.haml
+2
-2
未找到文件。
app/helpers/issues_helper.rb
浏览文件 @
3958330e
...
...
@@ -76,4 +76,12 @@ module IssuesHelper
def
bulk_update_assignee_options
options_for_select
([
"None (unassigned)"
,
nil
])
+
options_from_collection_for_select
(
@project
.
team
.
members
,
"id"
,
"name"
,
params
[
:assignee_id
])
end
def
assignee_options
object
options_from_collection_for_select
(
@project
.
team
.
members
.
sort_by
(
&
:name
),
'id'
,
'name'
,
object
.
assignee_id
)
end
def
milestone_options
object
options_from_collection_for_select
(
@project
.
milestones
.
active
,
'id'
,
'title'
,
object
.
milestone_id
)
end
end
app/views/projects/issues/_form.html.haml
浏览文件 @
3958330e
...
...
@@ -21,7 +21,7 @@
Assign to
.controls
.pull-left
=
f
.
select
(
:assignee_id
,
@project
.
team
.
members
.
sort_by
(
&
:name
).
map
{
|
p
|
[
p
.
name
,
p
.
id
]
}
,
{
include_blank:
"Select a user"
},
{
class:
'chosen'
})
=
f
.
select
(
:assignee_id
,
assignee_options
(
@issue
)
,
{
include_blank:
"Select a user"
},
{
class:
'chosen'
})
.pull-right
=
link_to
'Assign to me'
,
'#'
,
class:
'btn btn-small assign-to-me-link'
...
...
@@ -29,7 +29,7 @@
=
f
.
label
:milestone_id
do
%i
.icon-time
Milestone
.controls
=
f
.
select
(
:milestone_id
,
@project
.
milestones
.
active
.
collect
{
|
p
|
[
p
.
title
,
p
.
id
]
}
,
{
include_blank:
"Select milestone"
},
{
class:
'chosen'
})
.controls
=
f
.
select
(
:milestone_id
,
milestone_options
(
@issue
)
,
{
include_blank:
"Select milestone"
},
{
class:
'chosen'
})
.ui-box-bottom
.control-group
...
...
app/views/projects/issues/_issue_context.html.haml
浏览文件 @
3958330e
...
...
@@ -7,7 +7,7 @@
-
if
can?
(
current_user
,
:modify_issue
,
@issue
)
=
link_to
profile_path
(
issue
.
assignee
)
do
=
image_tag
(
avatar_icon
(
issue
.
assignee
.
email
),
class:
'avatar avatar-inline s16 assignee'
)
if
issue
.
assignee
=
f
.
select
(
:assignee_id
,
@project
.
team
.
members
.
sort_by
(
&
:name
).
map
{
|
p
|
[
p
.
name
,
p
.
id
]
}
,
{
include_blank:
"Assign to user (none):"
},
{
class:
'chosen'
})
=
f
.
select
(
:assignee_id
,
assignee_options
(
@issue
)
,
{
include_blank:
"Assign to user (none):"
},
{
class:
'chosen'
})
-
elsif
issue
.
assignee
=
link_to_member
(
@project
,
@issue
.
assignee
)
...
...
@@ -16,7 +16,7 @@
%cite
.cgray
and attached to milestone
-
if
can?
(
current_user
,
:modify_issue
,
@issue
)
=
f
.
select
(
:milestone_id
,
@project
.
milestones
.
active
.
all
.
collect
{
|
p
|
[
p
.
title
,
p
.
id
]
}
,
{
include_blank:
"Select milestone (none):"
},
{
class:
'chosen'
})
=
f
.
select
(
:milestone_id
,
milestone_options
(
@issue
)
,
{
include_blank:
"Select milestone (none):"
},
{
class:
'chosen'
})
=
hidden_field_tag
:issue_context
=
f
.
submit
class:
'btn'
...
...
app/views/projects/merge_requests/_form.html.haml
浏览文件 @
3958330e
...
...
@@ -39,12 +39,12 @@
=
f
.
label
:assignee_id
do
%i
.icon-user
Assign to
.controls
=
f
.
select
(
:assignee_id
,
@project
.
team
.
members
.
sort_by
(
&
:name
).
map
{
|
p
|
[
p
.
name
,
p
.
id
]
}
,
{
include_blank:
"Select user"
},
{
class:
'chosen span3'
})
.controls
=
f
.
select
(
:assignee_id
,
assignee_options
(
@merge_request
)
,
{
include_blank:
"Select user"
},
{
class:
'chosen span3'
})
.left
=
f
.
label
:milestone_id
do
%i
.icon-time
Milestone
.controls
=
f
.
select
(
:milestone_id
,
@project
.
milestones
.
active
.
map
{
|
p
|
[
p
.
title
,
p
.
id
]
}
,
{
include_blank:
"Select milestone"
},
{
class:
'chosen'
})
.controls
=
f
.
select
(
:milestone_id
,
milestone_options
(
@merge_request
)
,
{
include_blank:
"Select milestone"
},
{
class:
'chosen'
})
.control-group
=
f
.
label
:description
,
"Description"
.controls
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录