summaryrefslogtreecommitdiff
path: root/app/helpers/button_helper.rb
diff options
context:
space:
mode:
authorPatricio Cano <suprnova32@gmail.com>2016-07-05 16:48:48 -0500
committerPatricio Cano <suprnova32@gmail.com>2016-07-05 16:54:22 -0500
commit0bdf6fe4ba90f0a1dc7777d17651667776dfb91b (patch)
tree34adec49220b96c99aea7139cd0794405ecd7b8d /app/helpers/button_helper.rb
parentbe221a30ac3df7a2954f3be9dddac48aa2179c76 (diff)
downloadgitlab-ce-0bdf6fe4ba90f0a1dc7777d17651667776dfb91b.tar.gz
Use keyword arguments for boolean values and use `span` instead of `a` for clone "button"allow-disabling-of-git-access-protocol
Diffstat (limited to 'app/helpers/button_helper.rb')
-rw-r--r--app/helpers/button_helper.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/helpers/button_helper.rb b/app/helpers/button_helper.rb
index 7fd20d13010..0f097f86816 100644
--- a/app/helpers/button_helper.rb
+++ b/app/helpers/button_helper.rb
@@ -40,13 +40,13 @@ module ButtonHelper
type: :button
end
- def http_clone_button(project, placement = 'right', append_link = true)
+ def http_clone_button(project, placement = 'right', append_link: true)
klass = 'http-selector'
klass << ' has-tooltip' if current_user.try(:require_password?)
protocol = gitlab_config.protocol.upcase
- content_tag :a, protocol,
+ content_tag (append_link ? :a : :span), protocol,
class: klass,
href: (project.http_url_to_repo if append_link),
data: {
@@ -57,11 +57,11 @@ module ButtonHelper
}
end
- def ssh_clone_button(project, placement = 'right', append_link = true)
+ def ssh_clone_button(project, placement = 'right', append_link: true)
klass = 'ssh-selector'
klass << ' has-tooltip' if current_user.try(:require_ssh_key?)
- content_tag :a, 'SSH',
+ content_tag (append_link ? :a : :span), 'SSH',
class: klass,
href: (project.ssh_url_to_repo if append_link),
data: {