Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
0139896b
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,发现更多精彩内容 >>
提交
0139896b
编写于
12月 13, 2016
作者:
S
Sean McGivern
浏览文件
操作
浏览文件
下载
差异文件
Merge branch '3478-copy-commit-hash-to-clipboard' into 'master'
Copy commit hash to clipboard Closes #3478 See merge request !8020
上级
f4dde5d5
602447a3
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
9 addition
and
17 deletion
+9
-17
app/assets/javascripts/copy_to_clipboard.js
app/assets/javascripts/copy_to_clipboard.js
+2
-2
app/helpers/button_helper.rb
app/helpers/button_helper.rb
+1
-1
app/views/projects/commit/_commit_box.html.haml
app/views/projects/commit/_commit_box.html.haml
+2
-7
app/views/projects/tree/_tree_content.html.haml
app/views/projects/tree/_tree_content.html.haml
+3
-6
spec/views/projects/commit/_commit_box.html.haml_spec.rb
spec/views/projects/commit/_commit_box.html.haml_spec.rb
+1
-1
未找到文件。
app/assets/javascripts/copy_to_clipboard.js
浏览文件 @
0139896b
...
...
@@ -6,7 +6,7 @@
var
genericError
,
genericSuccess
,
showTooltip
;
genericSuccess
=
function
(
e
)
{
showTooltip
(
e
.
trigger
,
'
Copied
!
'
);
showTooltip
(
e
.
trigger
,
'
Copied
'
);
// Clear the selection and blur the trigger so it loses its border
e
.
clearSelection
();
return
$
(
e
.
trigger
).
blur
();
...
...
@@ -31,7 +31,7 @@
var
originalTitle
=
$target
.
data
(
'
original-title
'
);
$target
.
attr
(
'
title
'
,
'
Copied
!
'
)
.
attr
(
'
title
'
,
'
Copied
'
)
.
tooltip
(
'
fixTitle
'
)
.
tooltip
(
'
show
'
)
.
attr
(
'
title
'
,
originalTitle
)
...
...
app/helpers/button_helper.rb
浏览文件 @
0139896b
...
...
@@ -16,7 +16,7 @@ module ButtonHelper
# See http://clipboardjs.com/#usage
def
clipboard_button
(
data
=
{})
css_class
=
data
[
:class
]
||
'btn-clipboard btn-transparent'
title
=
data
[
:title
]
||
'Copy to
C
lipboard'
title
=
data
[
:title
]
||
'Copy to
c
lipboard'
data
=
{
toggle:
'tooltip'
,
placement:
'bottom'
,
container:
'body'
}.
merge
(
data
)
content_tag
:button
,
icon
(
'clipboard'
),
...
...
app/views/projects/commit/_commit_box.html.haml
浏览文件 @
0139896b
.page-content-header
.header-main-content
%strong
Commit
%strong
.monospace.js-details-short
=
@commit
.
short_id
=
link_to
(
"#"
,
class:
"js-details-expand hidden-xs hidden-sm"
)
do
%span
.text-expander
\...
%span
.js-details-content.hide
%strong
.monospace.commit-hash-full
=
@commit
.
id
%strong
=
clipboard_button
(
clipboard_text:
@commit
.
id
)
=
@commit
.
short_id
%span
.hidden-xs
authored
#{
time_ago_with_tooltip
(
@commit
.
authored_date
)
}
%span
by
...
...
app/views/projects/tree/_tree_content.html.haml
浏览文件 @
0139896b
...
...
@@ -5,14 +5,11 @@
%tr
%th
Name
%th
.hidden-xs
.pull-left
Last
C
ommit
.pull-left
Last
c
ommit
.last-commit.hidden-sm.pull-left
%i
.fa.fa-angle-right
%small
.light
%small
.light
=
clipboard_button
(
clipboard_text:
@commit
.
id
)
=
link_to
@commit
.
short_id
,
namespace_project_commit_path
(
@project
.
namespace
,
@project
,
@commit
),
class:
"monospace"
–
=
time_ago_with_tooltip
(
@commit
.
committed_date
)
=
@commit
.
full_title
%small
.commit-history-link-spacer
|
...
...
spec/views/projects/commit/_commit_box.html.haml_spec.rb
浏览文件 @
0139896b
...
...
@@ -13,7 +13,7 @@ describe 'projects/commit/_commit_box.html.haml' do
it
'shows the commit SHA'
do
render
expect
(
rendered
).
to
have_text
(
"
Commit
#{
Commit
.
truncate_sha
(
project
.
commit
.
sha
)
}
"
)
expect
(
rendered
).
to
have_text
(
"
#{
Commit
.
truncate_sha
(
project
.
commit
.
sha
)
}
"
)
end
it
'shows the last pipeline that ran for the commit'
do
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录