Refactor code for single file download in repository
This commit is contained in:
parent
1e0f0de302
commit
cb99e0518c
|
@ -227,12 +227,14 @@ module BlobHelper
|
||||||
def open_raw_blob_button(blob)
|
def open_raw_blob_button(blob)
|
||||||
return if blob.empty?
|
return if blob.empty?
|
||||||
return if blob.raw_binary? || blob.stored_externally?
|
return if blob.raw_binary? || blob.stored_externally?
|
||||||
|
|
||||||
title = 'Open raw'
|
title = 'Open raw'
|
||||||
link_to icon('file-code-o'), blob_raw_path, class: 'btn btn-sm has-tooltip', target: '_blank', rel: 'noopener noreferrer', title: title, data: { container: 'body' }
|
link_to icon('file-code-o'), blob_raw_path, class: 'btn btn-sm has-tooltip', target: '_blank', rel: 'noopener noreferrer', title: title, data: { container: 'body' }
|
||||||
end
|
end
|
||||||
|
|
||||||
def download_blob_button(blob)
|
def download_blob_button(blob)
|
||||||
return if blob.empty?
|
return if blob.empty?
|
||||||
|
|
||||||
title = 'Download'
|
title = 'Download'
|
||||||
link_to sprite_icon('download'), blob_raw_path(inline: false), download: @path, class: 'btn btn-sm has-tooltip', target: '_blank', rel: 'noopener noreferrer', title: title, data: { container: 'body' }
|
link_to sprite_icon('download'), blob_raw_path(inline: false), download: @path, class: 'btn btn-sm has-tooltip', target: '_blank', rel: 'noopener noreferrer', title: title, data: { container: 'body' }
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue