diff options
author | Kia Mei Somabes <kssomabes@up.edu.ph> | 2018-07-09 09:55:36 +0800 |
---|---|---|
committer | Kia Mei Somabes <kssomabes@up.edu.ph> | 2018-07-09 10:13:00 +0800 |
commit | 50c128944e5e65fb5124aeb790cc0f1ec06049d3 (patch) | |
tree | f47b04173ccc93319c5d3307b32bd8c531ffa5e3 /app/helpers | |
parent | 0ed8f3490e037d451841ec0e6fe226b9e62e8466 (diff) | |
download | gitlab-ce-50c128944e5e65fb5124aeb790cc0f1ec06049d3.tar.gz |
Add single file download in repository
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/blob_helper.rb | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/app/helpers/blob_helper.rb b/app/helpers/blob_helper.rb index 3db28fd6da3..16a8764dc41 100644 --- a/app/helpers/blob_helper.rb +++ b/app/helpers/blob_helper.rb @@ -226,18 +226,18 @@ module BlobHelper def open_raw_blob_button(blob) return if blob.empty? - - if blob.raw_binary? || blob.stored_externally? - icon = sprite_icon('download') - title = 'Download' - else - icon = icon('file-code-o') - title = 'Open raw' - end - + icon = icon('file-code-o') + title = 'Open raw' link_to icon, blob_raw_path, class: 'btn btn-sm has-tooltip', target: '_blank', rel: 'noopener noreferrer', title: title, data: { container: 'body' } end + def download_button(blob) + return if blob.empty? + icon = sprite_icon('download') + title = 'Download' + link_to icon, blob_raw_path, download: '', class: 'btn btn-sm has-tooltip', target: '_blank', rel: 'noopener noreferrer', title: title, data: { container: 'body' } + end + def blob_render_error_reason(viewer) case viewer.render_error when :collapsed |