Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
1d80cd31
Commit
1d80cd31
authored
Nov 24, 2015
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add clipboard button to project clone panel
Closes #3585
parent
7dab8ed7
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
11 deletions
+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
No files found.
app/assets/javascripts/project.js.coffee
View file @
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'
,
->
...
...
app/assets/stylesheets/pages/projects.scss
View file @
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
{
...
...
app/helpers/button_helper.rb
View file @
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
View file @
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
View file @
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment