Fix clipboard buttons on MR instructions and Commit#show
This commit is contained in:
parent
a5a9cd304c
commit
f49ac5c8d3
4 changed files with 11 additions and 11 deletions
|
@ -191,7 +191,7 @@
|
|||
.btn-clipboard {
|
||||
@extend .pull-right;
|
||||
|
||||
margin-right: 18px;
|
||||
margin-right: 20px;
|
||||
margin-top: 5px;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
|
|
|
@ -10,8 +10,8 @@ module ButtonHelper
|
|||
# # => "<button class='...' data-clipboard-text='Foo'>...</button>"
|
||||
#
|
||||
# # Define the target element
|
||||
# clipboard_button(clipboard_target: "#foo")
|
||||
# # => "<button class='...' data-clipboard-target='#foo'>...</button>"
|
||||
# clipboard_button(clipboard_target: "div#foo")
|
||||
# # => "<button class='...' data-clipboard-target='div#foo'>...</button>"
|
||||
#
|
||||
# See http://clipboardjs.com/#usage
|
||||
def clipboard_button(data = {})
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
|
||||
%p
|
||||
%span.light Commit
|
||||
= link_to @commit.id, namespace_project_commit_path(@project.namespace, @project, @commit), class: "monospace", data: { clipboard_text: @commit.id }
|
||||
= clipboard_button
|
||||
= link_to @commit.id, namespace_project_commit_path(@project.namespace, @project, @commit), class: "monospace"
|
||||
= clipboard_button(clipboard_text: @commit.id)
|
||||
.commit-info-row
|
||||
%span.light Authored by
|
||||
%strong
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
%p
|
||||
%strong Step 1.
|
||||
Fetch and check out the branch for this merge request
|
||||
= clipboard_button
|
||||
%pre.dark
|
||||
= clipboard_button(clipboard_target: 'pre#merge-info-1')
|
||||
%pre.dark#merge-info-1
|
||||
- if @merge_request.for_fork?
|
||||
:preserve
|
||||
git fetch #{h @merge_request.source_project.http_url_to_repo} #{h @merge_request.source_branch}
|
||||
|
@ -25,8 +25,8 @@
|
|||
%p
|
||||
%strong Step 3.
|
||||
Merge the branch and fix any conflicts that come up
|
||||
= clipboard_button
|
||||
%pre.dark
|
||||
= clipboard_button(clipboard_target: 'pre#merge-info-3')
|
||||
%pre.dark#merge-info-3
|
||||
- if @merge_request.for_fork?
|
||||
:preserve
|
||||
git checkout #{h @merge_request.target_branch}
|
||||
|
@ -38,8 +38,8 @@
|
|||
%p
|
||||
%strong Step 4.
|
||||
Push the result of the merge to GitLab
|
||||
= clipboard_button
|
||||
%pre.dark
|
||||
= clipboard_button(clipboard_target: 'pre#merge-info-4')
|
||||
%pre.dark#merge-info-4
|
||||
:preserve
|
||||
git push origin #{h @merge_request.target_branch}
|
||||
- unless @merge_request.can_be_merged_by?(current_user)
|
||||
|
|
Loading…
Reference in a new issue