Commit 0bdf6fe4 authored by Patricio Cano's avatar Patricio Cano

Use keyword arguments for boolean values and use `span` instead of `a` for clone "button"

parent be221a30
......@@ -47,9 +47,9 @@ module ApplicationSettingsHelper
def enabled_project_button(project, protocol)
case protocol
when 'ssh'
ssh_clone_button(project, 'bottom', false)
ssh_clone_button(project, 'bottom', append_link: false)
else
http_clone_button(project, 'bottom', false)
http_clone_button(project, 'bottom', append_link: false)
end
end
......
......@@ -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: {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment