Commit 477ae66b authored by Rubén Dávila's avatar Rubén Dávila Committed by Robert Speicher
Browse files

Move revert link to the MR widget section plus some refactor.

parent 2ea5b37f
......@@ -123,14 +123,14 @@ def link_to_browse_code(project, commit)
)
end
def revert_commit_link(show_modal_condition, continue_to_path)
def revert_commit_link(show_modal_condition, continue_to_path, btn_class: nil)
return unless current_user
if show_modal_condition
link_to('Revert', '#modal-revert-commit',
'data-target' => '#modal-revert-commit',
'data-toggle' => 'modal',
class: 'btn btn-grouped btn-close',
class: "btn btn-close btn-#{btn_class}",
title: 'Create merge request to revert commit'
)
else
......
......@@ -18,6 +18,3 @@
Edit
- if @merge_request.closed?
= link_to 'Reopen', merge_request_path(@merge_request, merge_request: {state_event: :reopen }), method: :put, class: 'btn btn-nr btn-grouped btn-reopen reopen-mr-link', title: "Reopen merge request"
- if @merge_request.merged? && @merge_request.merge_commit_sha.present?
= revert_commit_link(can_update_merge_request?, namespace_project_merge_request_path(@project.namespace, @project, @merge_request))
......@@ -6,6 +6,8 @@
- if @merge_request.merge_event
by #{link_to_member(@project, @merge_request.merge_event.author, avatar: true)}
#{time_ago_with_tooltip(@merge_request.merge_event.created_at)}
- if @merge_request.merge_commit_sha.present?
= revert_commit_link(can_update_merge_request?, namespace_project_merge_request_path(@project.namespace, @project, @merge_request), btn_class: 'sm')
%div
- if !@merge_request.source_branch_exists? || (params[:delete_source] == 'true')
The changes were merged into
......
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