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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
d5c07141
Commit
d5c07141
authored
Mar 19, 2016
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use http_clone_button and ssh_clone_button to restore tooltip functionality in clone panel
parent
68fa4de6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
20 deletions
+12
-20
app/helpers/button_helper.rb
app/helpers/button_helper.rb
+10
-16
app/views/shared/_clone_panel.html.haml
app/views/shared/_clone_panel.html.haml
+2
-4
No files found.
app/helpers/button_helper.rb
View file @
d5c07141
...
@@ -23,36 +23,30 @@ module ButtonHelper
...
@@ -23,36 +23,30 @@ module ButtonHelper
end
end
def
http_clone_button
(
project
)
def
http_clone_button
(
project
)
klass
=
'btn js-protocol-switch'
klass
=
'http-selector'
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?
)
protocol
=
gitlab_config
.
protocol
.
upcase
protocol
=
gitlab_config
.
protocol
.
upcase
content_tag
:
button
,
protocol
,
content_tag
:
a
,
protocol
,
class:
klass
,
class:
klass
,
href:
@project
.
http_url_to_repo
,
data:
{
data:
{
clone:
project
.
http_url_to_repo
,
html:
true
,
container:
'body'
,
html:
'true'
,
title:
"Set a password on your account<br>to pull or push via
#{
protocol
}
"
title:
"Set a password on your account<br>to pull or push via
#{
protocol
}
"
},
}
type: :button
end
end
def
ssh_clone_button
(
project
)
def
ssh_clone_button
(
project
)
klass
=
'btn js-protocol-switch'
klass
=
'ssh-selector'
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?
)
content_tag
:
button
,
'SSH'
,
content_tag
:
a
,
'SSH'
,
class:
klass
,
class:
klass
,
href:
project
.
ssh_url_to_repo
,
data:
{
data:
{
clone:
project
.
ssh_url_to_repo
,
html:
true
,
container:
'body'
,
html:
'true'
,
title:
'Add an SSH key to your profile<br>to pull or push via SSH.'
title:
'Add an SSH key to your profile<br>to pull or push via SSH.'
},
}
type: :button
end
end
end
end
app/views/shared/_clone_panel.html.haml
View file @
d5c07141
...
@@ -8,11 +8,9 @@
...
@@ -8,11 +8,9 @@
=
icon
(
'angle-down'
)
=
icon
(
'angle-down'
)
%ul
.dropdown-menu.dropdown-menu-right.clone-options-dropdown
%ul
.dropdown-menu.dropdown-menu-right.clone-options-dropdown
%li
%li
%a
#ssh-selector
{
href:
@project
.
ssh_url_to_repo
}
=
ssh_clone_button
(
project
)
SSH
%li
%li
%a
#http-selector
{
href:
@project
.
http_url_to_repo
}
=
http_clone_button
(
project
)
#{
gitlab_config
.
protocol
.
upcase
}
=
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
.input-group-btn
...
...
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