Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
5db2622a
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 搜索 >>
提交
5db2622a
编写于
3月 19, 2016
作者:
J
Jacob Schatz
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Assign current user when no user is assigned link
上级
f6491260
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
77 addition
and
40 deletion
+77
-40
app/assets/javascripts/labels_select.js.coffee
app/assets/javascripts/labels_select.js.coffee
+10
-11
app/assets/javascripts/users_select.js.coffee
app/assets/javascripts/users_select.js.coffee
+55
-26
app/assets/stylesheets/pages/issuable.scss
app/assets/stylesheets/pages/issuable.scss
+6
-0
app/views/shared/issuable/_sidebar.html.haml
app/views/shared/issuable/_sidebar.html.haml
+6
-3
未找到文件。
app/assets/javascripts/labels_select.js.coffee
浏览文件 @
5db2622a
...
...
@@ -31,17 +31,16 @@ class @LabelsSelect
issueURLSplit
=
issueUpdateURL
.
split
(
'/'
)
if
issueUpdateURL
?
if
issueUpdateURL
labelHTMLTemplate
=
_
.
template
(
'<% _.each(labels, function(label){ %>'
+
'<a href="'
+
[
''
,
issueURLSplit
[
1
],
issueURLSplit
[
2
],
''
].
join
(
'/'
)
+
'issues?label_name=<%= label.title %>">'
+
'<span class="label color-label" '
+
'style="background-color: <%= label.color %>; '
+
'color: #FFFFFF">'
+
'<%= label.title %>'
+
'</span>'
+
'</a>'
+
'<% }); %>'
);
'<% _.each(labels, function(label){ %>
<a href="
#{["",issueURLSplit[1], issueURLSplit[2],""].join("/")}
issues?label_name=<%= label.title %>">
<span class="label color-label" style="background-color: <%= label.color %>; color: #FFFFFF">
<%= label.title %>
</span>
</a>
<% }); %>'
);
labelNoneHTMLTemplate
=
_
.
template
(
'<div class="light">None</div>'
)
if
newLabelField
.
length
and
$dropdown
.
hasClass
'js-extra-options'
...
...
app/assets/javascripts/users_select.js.coffee
浏览文件 @
5db2622a
...
...
@@ -19,6 +19,27 @@ class @UsersSelect
$value
=
$block
.
find
(
'.value'
)
$loading
=
$block
.
find
(
'.block-loading'
).
fadeOut
()
noAssigneeTemplate
=
_
.
template
(
'<% if (username) { %>
<a class="author_link " href="/u/<%= username %>">
<% if( avatar ) { %>
<img width="32" class="avatar avatar-inline s32" alt="" src="<%= avatar %>">
<% } %>
<span class="author"><%= name %></span>
<span class="username">
@<%= username %>
</span>
</a>
<% } else { %>
<span class="assign-yourself">
No assignee -
<a href="#" class="js-assign-yourself">
assign yourself
</a>
</span>
<% } %>'
)
$dropdown
.
glDropdown
(
data
:
(
term
,
callback
)
=>
@
users
term
,
(
users
)
=>
...
...
@@ -100,21 +121,21 @@ class @UsersSelect
).
done
(
data
)
->
$loading
.
fadeOut
()
$selectbox
.
hide
()
href
=
$value
.
show
()
.
find
(
'.author'
)
.
text
(
data
.
assignee
.
name
)
.
end
()
.
find
(
'.username'
)
.
text
(
"@
#{
data
.
assignee
.
username
}
"
)
.
end
()
.
find
(
'a'
)
.
attr
(
'href'
)
splitHref
=
href
.
split
(
'/'
)
splitHref
[
splitHref
.
length
-
1
]
=
data
.
assignee
.
username
$value
.
find
(
'a
'
)
.
attr
(
'href'
,
splitHref
.
join
(
'/'
))
if
data
.
assignee
user
=
name
:
data
.
assignee
.
name
username
:
data
.
assignee
.
username
avatar
:
data
.
assignee
.
avatar
.
url
else
user
=
name
:
'Unassigned'
username
:
''
avatar
:
''
$value
.
html
(
noAssigneeTemplate
(
user
))
$value
.
find
(
'a'
).
attr
(
'href
'
)
renderRow
:
(
user
)
->
username
=
if
user
.
username
then
"@
#{
user
.
username
}
"
else
""
avatar
=
if
user
.
avatar_url
then
user
.
avatar_url
else
false
...
...
@@ -131,17 +152,25 @@ class @UsersSelect
if
avatar
img
=
"<img src='
#{
avatar
}
' class='avatar avatar-inline' width='30' />"
"<li>
<a href='#' class='dropdown-menu-user-link
#{
selected
}
'>
#{
img
}
<strong class='dropdown-menu-user-full-name'>
#{
user
.
name
}
</strong>
<span class='dropdown-menu-user-username'>
#{
username
}
</span>
</a>
</li>"
# split into three parts so we can remove the username section if nessesary
listWithName
=
"<li>
<a href='#' class='dropdown-menu-user-link
#{
selected
}
'>
#{
img
}
<strong class='dropdown-menu-user-full-name'>
#{
user
.
name
}
</strong>"
listWithUserName
=
"<span class='dropdown-menu-user-username'>
#{
username
}
</span>"
listClosingTags
=
"</a>
</li>"
if
username
is
''
listWithUserName
=
''
listWithName
+
listWithUserName
+
listClosingTags
)
$
(
'.ajax-users-select'
).
each
(
i
,
select
)
=>
...
...
app/assets/stylesheets/pages/issuable.scss
浏览文件 @
5db2622a
...
...
@@ -133,6 +133,12 @@
.value
{
line-height
:
1
;
.assign-yourself
{
margin-top
:
10px
;
font-weight
:
normal
;
display
:
block
;
}
}
.bold
{
...
...
app/views/shared/issuable/_sidebar.html.haml
浏览文件 @
5db2622a
...
...
@@ -44,11 +44,14 @@
%span
.username
=
issuable
.
assignee
.
to_reference
-
else
.light
None
%span
.assign-yourself
No assignee -
%a
.js-assign-yourself
{
href
:'#'
}
assign yourself
.selectbox.hide-collapsed
=
f
.
hidden_field
'assignee_id'
,
value:
issuable
.
assignee_id
,
id:
nil
=
dropdown_tag
(
'Select assignee'
,
options:
{
toggle_class:
'js-user-search js-author-search'
,
title:
'Assign user'
,
filter:
true
,
dropdown_class:
'dropdown-menu-user dropdown-menu-selectable dropdown-menu-author'
,
placeholder:
'Search users'
,
data:
{
first_user:
(
current_user
.
username
if
current_user
),
current_user:
true
,
project_id:
(
@project
.
id
if
@project
),
field_name:
"
#{
issuable
.
to_ability_name
}
[assignee_id]"
,
issue_update:
issuable_url
,
ability_name:
issuable
.
to_ability_name
}
})
=
f
.
hidden_field
'assignee_id'
,
value:
issuable
.
assignee_id
,
id:
'issue_assignee_id'
=
dropdown_tag
(
'Select assignee'
,
options:
{
toggle_class:
'js-user-search js-author-search'
,
title:
'Assign user'
,
filter:
true
,
dropdown_class:
'dropdown-menu-user dropdown-menu-selectable dropdown-menu-author'
,
placeholder:
'Search users'
,
data:
{
first_user:
(
current_user
.
username
if
current_user
),
current_user:
true
,
project_id:
(
@project
.
id
if
@project
),
field_name:
"
#{
issuable
.
to_ability_name
}
[assignee_id]"
,
issue_update:
issuable_url
,
ability_name:
issuable
.
to_ability_name
,
null_user:
true
}
})
.block.milestone
.sidebar-collapsed-icon
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录