Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
1d80cd31
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,发现更多精彩内容 >>
提交
1d80cd31
编写于
11月 24, 2015
作者:
R
Robert Speicher
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add clipboard button to project clone panel
Closes #3585
上级
7dab8ed7
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
15 addition
and
11 deletion
+15
-11
app/assets/javascripts/project.js.coffee
app/assets/javascripts/project.js.coffee
+4
-6
app/assets/stylesheets/pages/projects.scss
app/assets/stylesheets/pages/projects.scss
+6
-1
app/helpers/button_helper.rb
app/helpers/button_helper.rb
+2
-2
app/helpers/projects_helper.rb
app/helpers/projects_helper.rb
+1
-2
app/views/shared/_clone_panel.html.haml
app/views/shared/_clone_panel.html.haml
+2
-0
未找到文件。
app/assets/javascripts/project.js.coffee
浏览文件 @
1d80cd31
...
@@ -3,11 +3,9 @@ class @Project
...
@@ -3,11 +3,9 @@ class @Project
# Git clone panel switcher
# Git clone panel switcher
cloneHolder
=
$
(
'.git-clone-holder'
)
cloneHolder
=
$
(
'.git-clone-holder'
)
if
cloneHolder
.
length
if
cloneHolder
.
length
$
(
'a, button'
,
cloneHolder
).
click
->
$
(
'.js-protocol-switch'
,
cloneHolder
).
click
->
$
(
'a, button'
,
cloneHolder
).
removeClass
'active'
$
(
'.js-protocol-switch'
,
cloneHolder
).
toggleClass
(
'active'
)
$
(
@
).
addClass
'active'
$
(
'#project_clone'
).
val
(
$
(
@
).
data
(
'clone'
))
$
(
'#project_clone'
,
cloneHolder
).
val
$
(
@
).
data
'clone'
$
(
".clone"
).
text
(
""
).
append
$
(
@
).
data
'clone'
# Ref switcher
# Ref switcher
$
(
'.project-refs-select'
).
on
'change'
,
->
$
(
'.project-refs-select'
).
on
'change'
,
->
...
@@ -39,4 +37,4 @@ class @Project
...
@@ -39,4 +37,4 @@ class @Project
when
4
then
label
=
' On Mention '
when
4
then
label
=
' On Mention '
$
(
'#notifications-button'
).
empty
().
append
(
"<i class='fa fa-bell'></i>"
+
label
+
"<i class='fa fa-angle-down'></i>"
)
$
(
'#notifications-button'
).
empty
().
append
(
"<i class='fa fa-bell'></i>"
+
label
+
"<i class='fa fa-angle-down'></i>"
)
$
(
@
).
parents
(
'ul'
).
find
(
'li.active'
).
removeClass
'active'
$
(
@
).
parents
(
'ul'
).
find
(
'li.active'
).
removeClass
'active'
$
(
@
).
parent
().
addClass
'active'
$
(
@
).
parent
().
addClass
'active'
\ No newline at end of file
app/assets/stylesheets/pages/projects.scss
浏览文件 @
1d80cd31
...
@@ -178,6 +178,11 @@
...
@@ -178,6 +178,11 @@
&
:active
{
&
:active
{
outline
:
none
;
outline
:
none
;
}
}
&
.btn-clipboard
{
padding-left
:
15px
;
padding-right
:
15px
;
}
}
}
.active
{
.active
{
...
@@ -552,4 +557,4 @@ pre.light-well {
...
@@ -552,4 +557,4 @@ pre.light-well {
z-index
:
100
;
z-index
:
100
;
position
:
relative
;
position
:
relative
;
}
}
}
}
\ No newline at end of file
app/helpers/button_helper.rb
浏览文件 @
1d80cd31
...
@@ -23,7 +23,7 @@ module ButtonHelper
...
@@ -23,7 +23,7 @@ module ButtonHelper
end
end
def
http_clone_button
(
project
)
def
http_clone_button
(
project
)
klass
=
'btn'
klass
=
'btn
js-protocol-switch
'
klass
<<
' active'
if
default_clone_protocol
==
'http'
klass
<<
' active'
if
default_clone_protocol
==
'http'
klass
<<
' has_tooltip'
if
current_user
.
try
(
:require_password?
)
klass
<<
' has_tooltip'
if
current_user
.
try
(
:require_password?
)
...
@@ -41,7 +41,7 @@ module ButtonHelper
...
@@ -41,7 +41,7 @@ module ButtonHelper
end
end
def
ssh_clone_button
(
project
)
def
ssh_clone_button
(
project
)
klass
=
'btn'
klass
=
'btn
js-protocol-switch
'
klass
<<
' active'
if
default_clone_protocol
==
'ssh'
klass
<<
' active'
if
default_clone_protocol
==
'ssh'
klass
<<
' has_tooltip'
if
current_user
.
try
(
:require_ssh_key?
)
klass
<<
' has_tooltip'
if
current_user
.
try
(
:require_ssh_key?
)
...
...
app/helpers/projects_helper.rb
浏览文件 @
1d80cd31
...
@@ -173,8 +173,7 @@ module ProjectsHelper
...
@@ -173,8 +173,7 @@ module ProjectsHelper
'unknown'
'unknown'
end
end
def
default_url_to_repo
(
project
=
nil
)
def
default_url_to_repo
(
project
=
@project
)
project
=
project
||
@project
current_user
?
project
.
url_to_repo
:
project
.
http_url_to_repo
current_user
?
project
.
url_to_repo
:
project
.
http_url_to_repo
end
end
...
...
app/views/shared/_clone_panel.html.haml
浏览文件 @
1d80cd31
...
@@ -6,6 +6,8 @@
...
@@ -6,6 +6,8 @@
.input-group-btn
.input-group-btn
=
http_clone_button
(
project
)
=
http_clone_button
(
project
)
=
text_field_tag
:project_clone
,
default_url_to_repo
(
project
),
class:
"js-select-on-focus form-control"
,
readonly:
true
=
text_field_tag
:project_clone
,
default_url_to_repo
(
project
),
class:
"js-select-on-focus form-control"
,
readonly:
true
.input-group-btn
=
clipboard_button
(
clipboard_target:
'#project_clone'
)
-
if
project
.
kind_of?
(
Project
)
-
if
project
.
kind_of?
(
Project
)
.input-group-addon.has_tooltip
{
title:
"#{visibility_level_label(project.visibility_level)} project"
,
data:
{
container:
"body"
}
}
.input-group-addon.has_tooltip
{
title:
"#{visibility_level_label(project.visibility_level)} project"
,
data:
{
container:
"body"
}
}
.visibility-level-label
.visibility-level-label
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录