diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-03-14 11:58:52 -0600 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-03-16 09:37:22 -0600 |
commit | c52fead0d2715b27a7f832c8d848a12d3dd84bae (patch) | |
tree | 49428e3ff85c2903bdfc5c00cf11f707782d3b29 /app/helpers | |
parent | 95b3b6859a150606586854a666b8163bec21a154 (diff) | |
download | gitlab-ce-c52fead0d2715b27a7f832c8d848a12d3dd84bae.tar.gz |
Fix spec
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/blob_helper.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/app/helpers/blob_helper.rb b/app/helpers/blob_helper.rb index 7f32c1b5300..81ec9641184 100644 --- a/app/helpers/blob_helper.rb +++ b/app/helpers/blob_helper.rb @@ -203,4 +203,18 @@ module BlobHelper 'blob-language' => @blob && @blob.language.try(:ace_mode) } end + + def copy_file_path_button(file_path) + clipboard_button(clipboard_text: file_path, class: 'btn-clipboard btn-transparent prepend-left-5', title: 'Copy file path to clipboard') + end + + def copy_blob_content_button(blob) + return if markup?(blob.name) + + clipboard_button(clipboard_target: ".blob-content[data-blob-id='#{blob.id}']", class: "btn btn-sm", title: "Copy content to clipboard") + end + + def open_raw_file_button(path) + link_to icon('file-text-o'), path, class: 'btn btn-sm has-tooltip', target: '_blank', title: 'Open raw', data: { container: 'body' } + end end |