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
Jérome Perrin
gitlab-ce
Commits
30db305d
Commit
30db305d
authored
Apr 13, 2017
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move conditional inside copy_blob_source_button
parent
0d1ec11e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
app/helpers/blob_helper.rb
app/helpers/blob_helper.rb
+3
-3
app/views/projects/blob/_header.html.haml
app/views/projects/blob/_header.html.haml
+1
-1
No files found.
app/helpers/blob_helper.rb
View file @
30db305d
...
@@ -208,10 +208,10 @@ module BlobHelper
...
@@ -208,10 +208,10 @@ module BlobHelper
clipboard_button
(
text:
file_path
,
gfm:
"`
#{
file_path
}
`"
,
class:
'btn-clipboard btn-transparent prepend-left-5'
,
title:
'Copy file path to clipboard'
)
clipboard_button
(
text:
file_path
,
gfm:
"`
#{
file_path
}
`"
,
class:
'btn-clipboard btn-transparent prepend-left-5'
,
title:
'Copy file path to clipboard'
)
end
end
def
copy_blob_
content
_button
(
blob
)
def
copy_blob_
source
_button
(
blob
)
return
if
markup?
(
blob
.
name
)
return
unless
blob
.
rendered_as_text?
(
override_max_size:
params
[
:override_max_size
]
)
clipboard_button
(
target:
".blob-content[data-blob-id='
#{
blob
.
id
}
']"
,
class:
"btn btn-sm
"
,
title:
"Copy content
to clipboard"
)
clipboard_button
(
target:
".blob-content[data-blob-id='
#{
blob
.
id
}
']"
,
class:
"btn btn-sm
js-copy-blob-source-btn"
,
title:
"Copy source
to clipboard"
)
end
end
def
open_raw_file_button
(
path
)
def
open_raw_file_button
(
path
)
...
...
app/views/projects/blob/_header.html.haml
View file @
30db305d
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
.file-actions.hidden-xs
.file-actions.hidden-xs
.btn-group
{
role:
"group"
}
<
.btn-group
{
role:
"group"
}
<
=
copy_blob_
content_button
(
blob
)
if
!
blame
&&
blob_rendered_as_text?
(
blob
)
=
copy_blob_
source_button
(
blob
)
unless
blame
=
open_raw_file_button
(
namespace_project_raw_path
(
@project
.
namespace
,
@project
,
@id
))
=
open_raw_file_button
(
namespace_project_raw_path
(
@project
.
namespace
,
@project
,
@id
))
=
view_on_environment_button
(
@commit
.
sha
,
@path
,
@environment
)
if
@environment
=
view_on_environment_button
(
@commit
.
sha
,
@path
,
@environment
)
if
@environment
...
...
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