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
0bdf6fe4
Commit
0bdf6fe4
authored
Jul 05, 2016
by
Patricio Cano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use keyword arguments for boolean values and use `span` instead of `a` for clone "button"
parent
be221a30
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
app/helpers/application_settings_helper.rb
app/helpers/application_settings_helper.rb
+2
-2
app/helpers/button_helper.rb
app/helpers/button_helper.rb
+4
-4
No files found.
app/helpers/application_settings_helper.rb
View file @
0bdf6fe4
...
@@ -47,9 +47,9 @@ module ApplicationSettingsHelper
...
@@ -47,9 +47,9 @@ module ApplicationSettingsHelper
def
enabled_project_button
(
project
,
protocol
)
def
enabled_project_button
(
project
,
protocol
)
case
protocol
case
protocol
when
'ssh'
when
'ssh'
ssh_clone_button
(
project
,
'bottom'
,
false
)
ssh_clone_button
(
project
,
'bottom'
,
append_link:
false
)
else
else
http_clone_button
(
project
,
'bottom'
,
false
)
http_clone_button
(
project
,
'bottom'
,
append_link:
false
)
end
end
end
end
...
...
app/helpers/button_helper.rb
View file @
0bdf6fe4
...
@@ -40,13 +40,13 @@ module ButtonHelper
...
@@ -40,13 +40,13 @@ module ButtonHelper
type: :button
type: :button
end
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
=
'http-selector'
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
:a
,
protocol
,
content_tag
(
append_link
?
:a
:
:span
)
,
protocol
,
class:
klass
,
class:
klass
,
href:
(
project
.
http_url_to_repo
if
append_link
),
href:
(
project
.
http_url_to_repo
if
append_link
),
data:
{
data:
{
...
@@ -57,11 +57,11 @@ module ButtonHelper
...
@@ -57,11 +57,11 @@ module ButtonHelper
}
}
end
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
=
'ssh-selector'
klass
<<
' has-tooltip'
if
current_user
.
try
(
:require_ssh_key?
)
klass
<<
' has-tooltip'
if
current_user
.
try
(
:require_ssh_key?
)
content_tag
:a
,
'SSH'
,
content_tag
(
append_link
?
:a
:
:span
)
,
'SSH'
,
class:
klass
,
class:
klass
,
href:
(
project
.
ssh_url_to_repo
if
append_link
),
href:
(
project
.
ssh_url_to_repo
if
append_link
),
data:
{
data:
{
...
...
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