diff options
author | Kia Mei Somabes <kssomabes@up.edu.ph> | 2018-07-18 09:19:53 +0800 |
---|---|---|
committer | Kia Mei Somabes <kssomabes@up.edu.ph> | 2018-07-18 09:19:53 +0800 |
commit | cb99e0518c36cca62b14f16178e4396a8c7dcee2 (patch) | |
tree | 3972031c022979c3b5d4407f23d16d5bb53cd3a4 /app/helpers/blob_helper.rb | |
parent | 1e0f0de30253cf20533fe4002272e3e3861b3883 (diff) | |
download | gitlab-ce-cb99e0518c36cca62b14f16178e4396a8c7dcee2.tar.gz |
Refactor code for single file download in repository
Diffstat (limited to 'app/helpers/blob_helper.rb')
-rw-r--r-- | app/helpers/blob_helper.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/helpers/blob_helper.rb b/app/helpers/blob_helper.rb index 3ba49277b5e..1919b8995f5 100644 --- a/app/helpers/blob_helper.rb +++ b/app/helpers/blob_helper.rb @@ -227,12 +227,14 @@ module BlobHelper def open_raw_blob_button(blob) return if blob.empty? return if blob.raw_binary? || blob.stored_externally? + 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' } end def download_blob_button(blob) return if blob.empty? + 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' } end |