Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-03-14 20:58:52 +0300
committerDouwe Maan <douwe@selenight.nl>2017-03-16 18:37:22 +0300
commitc52fead0d2715b27a7f832c8d848a12d3dd84bae (patch)
tree49428e3ff85c2903bdfc5c00cf11f707782d3b29 /app/helpers/blob_helper.rb
parent95b3b6859a150606586854a666b8163bec21a154 (diff)
Fix spec
Diffstat (limited to 'app/helpers/blob_helper.rb')
-rw-r--r--app/helpers/blob_helper.rb14
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