Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
0858cb09
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,发现更多精彩内容 >>
提交
0858cb09
编写于
3月 16, 2016
作者:
P
Phil Hughes
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixed issue with labels dropdown getting wrong labels
上级
9280fd4a
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
17 addition
and
20 deletion
+17
-20
app/assets/javascripts/labels_select.js.coffee
app/assets/javascripts/labels_select.js.coffee
+0
-9
app/assets/javascripts/milestone_select.js.coffee
app/assets/javascripts/milestone_select.js.coffee
+0
-9
app/controllers/projects/labels_controller.rb
app/controllers/projects/labels_controller.rb
+7
-0
app/controllers/projects/milestones_controller.rb
app/controllers/projects/milestones_controller.rb
+8
-0
app/views/shared/issuable/_filter.html.haml
app/views/shared/issuable/_filter.html.haml
+2
-2
未找到文件。
app/assets/javascripts/labels_select.js.coffee
浏览文件 @
0858cb09
...
...
@@ -39,18 +39,9 @@ class @LabelsSelect
$dropdown
.
glDropdown
(
data
:
(
term
,
callback
)
->
# We have to fetch the JS version of the labels list because there is no
# public facing JSON url for labels
$
.
ajax
(
url
:
labelUrl
).
done
(
data
)
->
html
=
$
(
data
)
data
=
[]
html
.
find
(
'.label-row a'
).
each
->
data
.
push
(
title
:
$
(
@
).
text
().
trim
()
)
if
showNo
data
.
unshift
(
id
:
0
...
...
app/assets/javascripts/milestone_select.js.coffee
浏览文件 @
0858cb09
...
...
@@ -15,15 +15,6 @@ class @MilestoneSelect
$
.
ajax
(
url
:
milestonesUrl
).
done
(
data
)
->
html
=
$
(
data
)
data
=
[]
html
.
find
(
'.milestone strong a'
).
each
->
link
=
$
(
@
).
attr
(
'href'
).
split
(
'/'
)
data
.
push
(
id
:
link
[
link
.
length
-
1
]
title
:
$
(
@
).
text
().
trim
()
)
if
showNo
data
.
unshift
(
id
:
'0'
...
...
app/controllers/projects/labels_controller.rb
浏览文件 @
0858cb09
...
...
@@ -12,6 +12,13 @@ class Projects::LabelsController < Projects::ApplicationController
def
index
@labels
=
@project
.
labels
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
respond_to
do
|
format
|
format
.
html
format
.
json
do
render
json:
@labels
.
to_json
end
end
end
def
new
...
...
app/controllers/projects/milestones_controller.rb
浏览文件 @
0858cb09
...
...
@@ -19,7 +19,15 @@ class Projects::MilestonesController < Projects::ApplicationController
end
@milestones
=
@milestones
.
includes
(
:project
)
@milestones_all
=
@milestones
@milestones
=
@milestones
.
page
(
params
[
:page
]).
per
(
PER_PAGE
)
respond_to
do
|
format
|
format
.
html
format
.
json
do
render
json:
@milestones_all
.
to_json
end
end
end
def
new
...
...
app/views/shared/issuable/_filter.html.haml
浏览文件 @
0858cb09
...
...
@@ -22,7 +22,7 @@
-
if
params
[
:milestone_title
]
=
hidden_field_tag
(
:milestone_title
,
params
[
:milestone_title
])
=
dropdown_tag
(
h
(
params
[
:milestone_name
]
||
"Milestone"
),
options:
{
title:
"Filter by milestone"
,
toggle_class:
'js-milestone-select js-filter-submit'
,
filter:
true
,
dropdown_class:
"dropdown-menu-selectable"
,
placeholder:
"Search milestones"
,
footer_content:
true
,
data:
{
show_no:
true
,
show_any:
true
,
field_name:
"milestone_title"
,
selected:
params
[
:milestone_title
],
project_id:
(
@project
.
id
if
@project
),
milestones:
(
namespace_project_milestones_path
(
@project
.
namespace
,
@project
,
:js
)
if
@project
)
}
})
do
placeholder:
"Search milestones"
,
footer_content:
true
,
data:
{
show_no:
true
,
show_any:
true
,
field_name:
"milestone_title"
,
selected:
params
[
:milestone_title
],
project_id:
(
@project
.
id
if
@project
),
milestones:
(
namespace_project_milestones_path
(
@project
.
namespace
,
@project
,
:js
on
)
if
@project
)
}
})
do
-
if
@project
%ul
.dropdown-footer-list
-
if
can?
current_user
,
:admin_milestone
,
@project
...
...
@@ -40,7 +40,7 @@
-
if
params
[
:label_name
]
=
hidden_field_tag
(
:label_name
,
params
[
:label_name
])
.dropdown
%button
.dropdown-menu-toggle.js-label-select.js-filter-submit
{
type:
"button"
,
data:
{
toggle:
"dropdown"
,
field_name:
"label_name"
,
show_no:
"true"
,
show_any:
"true"
,
selected:
params
[
:label_name
],
project_id:
(
@project
.
id
if
@project
),
labels:
(
namespace_project_labels_path
(
@project
.
namespace
,
@project
,
:js
)
if
@project
)}}
%button
.dropdown-menu-toggle.js-label-select.js-filter-submit
{
type:
"button"
,
data:
{
toggle:
"dropdown"
,
field_name:
"label_name"
,
show_no:
"true"
,
show_any:
"true"
,
selected:
params
[
:label_name
],
project_id:
(
@project
.
id
if
@project
),
labels:
(
namespace_project_labels_path
(
@project
.
namespace
,
@project
,
:js
on
)
if
@project
)}}
%span
.dropdown-toggle-text
=
h
(
params
[
:label_name
]
||
"Label"
)
=
icon
(
'chevron-down'
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录