diff options
author | Fatih Acet <acetfatih@gmail.com> | 2016-11-01 00:57:57 +0000 |
---|---|---|
committer | Fatih Acet <acetfatih@gmail.com> | 2016-11-01 00:57:57 +0000 |
commit | b328c7885532ccff70e1f9f7dc970a8dde0c52d6 (patch) | |
tree | 92f765cc522f3f498779d6bce762954dc7e4877d | |
parent | 0a31ad3f880be0ecb6caa85920bf8c26bfd34340 (diff) | |
parent | 3a40842f8d195351652ae276272b46e3afe196c2 (diff) | |
download | gitlab-ce-b328c7885532ccff70e1f9f7dc970a8dde0c52d6.tar.gz |
Merge branch 'mr-copy-filename-btn-update' into 'master'
Updated positioning of copy file path button in diffs
## What does this MR do?
Updated the positioning of the copy file path button in diffs.
## Screenshots (if relevant)
![Screen_Shot_2016-10-31_at_16.53.24](/uploads/53de39ce550855f86b90d2d9fc227f95/Screen_Shot_2016-10-31_at_16.53.24.png)
## What are the relevant issue numbers?
Closes #23591
See merge request !7203
-rw-r--r-- | app/helpers/button_helper.rb | 3 | ||||
-rw-r--r-- | app/views/projects/diffs/_file.html.haml | 1 | ||||
-rw-r--r-- | app/views/projects/diffs/_file_header.html.haml | 2 |
3 files changed, 4 insertions, 2 deletions
diff --git a/app/helpers/button_helper.rb b/app/helpers/button_helper.rb index 85e1dc33ee8..dee3c78df47 100644 --- a/app/helpers/button_helper.rb +++ b/app/helpers/button_helper.rb @@ -16,13 +16,14 @@ module ButtonHelper # See http://clipboardjs.com/#usage def clipboard_button(data = {}) css_class = data[:class] || 'btn-clipboard btn-transparent' + title = data[:title] || 'Copy to Clipboard' data = { toggle: 'tooltip', placement: 'bottom', container: 'body' }.merge(data) content_tag :button, icon('clipboard'), class: "btn #{css_class}", data: data, type: :button, - title: 'Copy to Clipboard' + title: title end def http_clone_button(project, placement = 'right', append_link: true) diff --git a/app/views/projects/diffs/_file.html.haml b/app/views/projects/diffs/_file.html.haml index 257e0a855bd..8f4f9ad4a80 100644 --- a/app/views/projects/diffs/_file.html.haml +++ b/app/views/projects/diffs/_file.html.haml @@ -8,7 +8,6 @@ = link_to '#', class: 'js-toggle-diff-comments btn active has-tooltip btn-file-option', title: "Toggle comments for this file", disabled: @diff_notes_disabled do = icon('comment') \ - = clipboard_button(clipboard_text: diff_file.new_path, class: 'btn-file-option') - if editable_diff?(diff_file) - link_opts = @merge_request.id ? { from_merge_request_id: @merge_request.id } : {} = edit_blob_link(@merge_request.source_project, @merge_request.source_branch, diff_file.new_path, diff --git a/app/views/projects/diffs/_file_header.html.haml b/app/views/projects/diffs/_file_header.html.haml index a6a2e5690b5..73993f35b39 100644 --- a/app/views/projects/diffs/_file_header.html.haml +++ b/app/views/projects/diffs/_file_header.html.haml @@ -21,6 +21,8 @@ - if diff_file.deleted_file deleted + = clipboard_button(clipboard_text: diff_file.new_path, class: 'btn-clipboard btn-transparent prepend-left-5', title: 'Copy filename to clipboard') + - if diff_file.mode_changed? %small = "#{diff_file.a_mode} → #{diff_file.b_mode}" |