Commit cbac31d9 authored by Robert Speicher's avatar Robert Speicher

Add copy-to-clipboard button to Snippets#show

Closes #3701
parent 7b50965e
...@@ -26,6 +26,7 @@ v 8.3.0 (unreleased) ...@@ -26,6 +26,7 @@ v 8.3.0 (unreleased)
- Block LDAP user when they are no longer found in the LDAP server - Block LDAP user when they are no longer found in the LDAP server
- Improve wording on project visibility levels (Zeger-Jan van de Weg) - Improve wording on project visibility levels (Zeger-Jan van de Weg)
- Automatically select default clone protocol based on user preferences (Eirik Lygre) - Automatically select default clone protocol based on user preferences (Eirik Lygre)
- Add copy-to-clipboard button for Snippets
v 8.2.3 v 8.2.3
- Fix application settings cache not expiring after changes (Stan Hu) - Fix application settings cache not expiring after changes (Stan Hu)
......
...@@ -32,6 +32,12 @@ ...@@ -32,6 +32,12 @@
.file-holder { .file-holder {
border-top: 0; border-top: 0;
} }
.file-actions {
.btn-clipboard {
@extend .btn;
}
}
} }
.snippet-box { .snippet-box {
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
%strong %strong
= @snippet.file_name = @snippet.file_name
.file-actions.hidden-xs .file-actions.hidden-xs
.btn-group.tree-btn-group = clipboard_button(clipboard_target: ".blob-content[data-blob-id='#{@snippet.id}']")
= link_to 'Raw', raw_namespace_project_snippet_path(@project.namespace, @project, @snippet), class: "btn btn-sm", target: "_blank" = link_to 'Raw', raw_namespace_project_snippet_path(@project.namespace, @project, @snippet), class: "btn btn-sm", target: "_blank"
= render 'shared/snippets/blob' = render 'shared/snippets/blob'
......
...@@ -8,5 +8,6 @@ ...@@ -8,5 +8,6 @@
%a{href: "#L#{i}", id: "L#{i}", 'data-line-number' => i} %a{href: "#L#{i}", id: "L#{i}", 'data-line-number' => i}
%i.fa.fa-link %i.fa.fa-link
= i = i
.blob-content{data: {blob_id: blob.id}}
:preserve :preserve
#{highlight(blob.name, blob.data)} #{highlight(blob.name, blob.data)}
...@@ -9,6 +9,6 @@ ...@@ -9,6 +9,6 @@
%strong %strong
= @snippet.file_name = @snippet.file_name
.file-actions.hidden-xs .file-actions.hidden-xs
.btn-group.tree-btn-group = clipboard_button(clipboard_target: ".blob-content[data-blob-id='#{@snippet.id}']")
= link_to 'Raw', raw_snippet_path(@snippet), class: "btn btn-sm", target: "_blank" = link_to 'Raw', raw_snippet_path(@snippet), class: "btn btn-sm", target: "_blank"
= render 'shared/snippets/blob' = render 'shared/snippets/blob'
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment