summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-03-10 16:44:36 -0600
committerDouwe Maan <douwe@selenight.nl>2017-03-16 09:37:22 -0600
commit95b3b6859a150606586854a666b8163bec21a154 (patch)
treedd06e83b994562a0f20eb55e654ad153105a889d
parent74702b41aaac2251b3a732192f2d65bba258cc25 (diff)
downloadgitlab-ce-95b3b6859a150606586854a666b8163bec21a154.tar.gz
Add copy button to blob header and use icon for Raw button
-rw-r--r--app/views/projects/blob/_actions.html.haml10
-rw-r--r--changelogs/unreleased/add-blob-copy-button.yml4
2 files changed, 10 insertions, 4 deletions
diff --git a/app/views/projects/blob/_actions.html.haml b/app/views/projects/blob/_actions.html.haml
index 14d42f7d9ec..83781919053 100644
--- a/app/views/projects/blob/_actions.html.haml
+++ b/app/views/projects/blob/_actions.html.haml
@@ -1,10 +1,12 @@
-- if @environment
- .btn-group<
+
+.btn-group{ role: "group" }<
+ = clipboard_button(clipboard_target: ".blob-content[data-blob-id='#{@blob.id}']", class: "btn btn-sm")
+ = link_to icon('download'), namespace_project_raw_path(@project.namespace, @project, @id),
+ class: 'btn btn-sm has-tooltip', target: '_blank', title: 'Download raw', data: { container: 'body' }
+ - if @environment
= view_on_environment_button(@commit.sha, @path, @environment)
.btn-group{ role: "group" }<
- = link_to 'Raw', namespace_project_raw_path(@project.namespace, @project, @id),
- class: 'btn btn-sm', target: '_blank'
-# only show normal/blame view links for text files
- if blob_text_viewable?(@blob)
- if current_page? namespace_project_blame_path(@project.namespace, @project, @id)
diff --git a/changelogs/unreleased/add-blob-copy-button.yml b/changelogs/unreleased/add-blob-copy-button.yml
new file mode 100644
index 00000000000..946723e523b
--- /dev/null
+++ b/changelogs/unreleased/add-blob-copy-button.yml
@@ -0,0 +1,4 @@
+---
+title: Add copy button to blob header and use icon for Raw button
+merge_request:
+author: