summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2016-03-19 22:46:56 -0700
committerStan Hu <stanhu@gmail.com>2016-03-19 22:47:27 -0700
commitd5c071419a3c302a7cdfd939db944515b57bf21b (patch)
treecdc6797fd47b7419ef8a6147c0ea822cc70ab185
parent68fa4de6e39dfa036bb74eeb01fa569c716aacdf (diff)
downloadgitlab-ce-d5c071419a3c302a7cdfd939db944515b57bf21b.tar.gz
Use http_clone_button and ssh_clone_button to restore tooltip functionality in clone panel
-rw-r--r--app/helpers/button_helper.rb26
-rw-r--r--app/views/shared/_clone_panel.html.haml6
2 files changed, 12 insertions, 20 deletions
diff --git a/app/helpers/button_helper.rb b/app/helpers/button_helper.rb
index d6c05843743..c77a2a0f430 100644
--- a/app/helpers/button_helper.rb
+++ b/app/helpers/button_helper.rb
@@ -23,36 +23,30 @@ module ButtonHelper
end
def http_clone_button(project)
- klass = 'btn js-protocol-switch'
- klass << ' active' if default_clone_protocol == 'http'
+ klass = 'http-selector'
klass << ' has_tooltip' if current_user.try(:require_password?)
protocol = gitlab_config.protocol.upcase
- content_tag :button, protocol,
+ content_tag :a, protocol,
class: klass,
+ href: @project.http_url_to_repo,
data: {
- clone: project.http_url_to_repo,
- container: 'body',
- html: 'true',
+ html: true,
title: "Set a password on your account<br>to pull or push via #{protocol}"
- },
- type: :button
+ }
end
def ssh_clone_button(project)
- klass = 'btn js-protocol-switch'
- klass << ' active' if default_clone_protocol == 'ssh'
+ klass = 'ssh-selector'
klass << ' has_tooltip' if current_user.try(:require_ssh_key?)
- content_tag :button, 'SSH',
+ content_tag :a, 'SSH',
class: klass,
+ href: project.ssh_url_to_repo,
data: {
- clone: project.ssh_url_to_repo,
- container: 'body',
- html: 'true',
+ html: true,
title: 'Add an SSH key to your profile<br>to pull or push via SSH.'
- },
- type: :button
+ }
end
end
diff --git a/app/views/shared/_clone_panel.html.haml b/app/views/shared/_clone_panel.html.haml
index 5c7806459dd..974751d9970 100644
--- a/app/views/shared/_clone_panel.html.haml
+++ b/app/views/shared/_clone_panel.html.haml
@@ -8,11 +8,9 @@
= icon('angle-down')
%ul.dropdown-menu.dropdown-menu-right.clone-options-dropdown
%li
- %a#ssh-selector{href: @project.ssh_url_to_repo}
- SSH
+ = ssh_clone_button(project)
%li
- %a#http-selector{href: @project.http_url_to_repo}
- #{gitlab_config.protocol.upcase}
+ = http_clone_button(project)
= text_field_tag :project_clone, default_url_to_repo(project), class: "js-select-on-focus form-control", readonly: true
.input-group-btn