2015-09-11 14:41:01 +05:30
|
|
|
.mr-state-widget
|
|
|
|
= render 'projects/merge_requests/widget/heading'
|
|
|
|
.mr-widget-body
|
|
|
|
%h4
|
|
|
|
Merged
|
|
|
|
- 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)}
|
|
|
|
%div
|
2015-12-23 02:04:40 +05:30
|
|
|
- if !@merge_request.source_branch_exists? || (params[:delete_source] == 'true')
|
2016-04-02 18:10:28 +05:30
|
|
|
%p
|
|
|
|
The changes were merged into
|
|
|
|
#{link_to @merge_request.target_branch, namespace_project_commits_path(@project.namespace, @project, @merge_request.target_branch), class: "label-branch"}.
|
|
|
|
The source branch has been removed.
|
|
|
|
= render 'projects/merge_requests/widget/merged_buttons'
|
2015-12-23 02:04:40 +05:30
|
|
|
- elsif @merge_request.can_remove_source_branch?(current_user)
|
2015-09-11 14:41:01 +05:30
|
|
|
.remove_source_branch_widget
|
2015-11-26 14:37:03 +05:30
|
|
|
%p
|
2015-12-23 02:04:40 +05:30
|
|
|
The changes were merged into
|
|
|
|
#{link_to @merge_request.target_branch, namespace_project_commits_path(@project.namespace, @project, @merge_request.target_branch), class: "label-branch"}.
|
2015-09-11 14:41:01 +05:30
|
|
|
You can remove the source branch now.
|
2016-04-02 18:10:28 +05:30
|
|
|
= render 'projects/merge_requests/widget/merged_buttons', source_branch_exists: true
|
2015-09-11 14:41:01 +05:30
|
|
|
.remove_source_branch_widget.failed.hide
|
2015-11-26 14:37:03 +05:30
|
|
|
%p
|
2015-09-11 14:41:01 +05:30
|
|
|
Failed to remove source branch '#{@merge_request.source_branch}'.
|
|
|
|
|
|
|
|
.remove_source_branch_in_progress.hide
|
|
|
|
%p
|
|
|
|
= icon('spinner spin')
|
2015-12-23 02:04:40 +05:30
|
|
|
Removing source branch '#{@merge_request.source_branch}'. Please wait, this page will be automatically reloaded.
|
2015-09-11 14:41:01 +05:30
|
|
|
|
2015-11-26 14:37:03 +05:30
|
|
|
:javascript
|
|
|
|
$('.remove_source_branch').on('click', function() {
|
|
|
|
$('.remove_source_branch_widget').hide();
|
|
|
|
$('.remove_source_branch_in_progress').show();
|
|
|
|
});
|
|
|
|
|
|
|
|
$(".remove_source_branch").on("ajax:success", function (e, data, status, xhr) {
|
|
|
|
location.reload();
|
|
|
|
});
|
|
|
|
|
|
|
|
$(".remove_source_branch").on("ajax:error", function (e, data, status, xhr) {
|
|
|
|
$('.remove_source_branch_widget').hide();
|
|
|
|
$('.remove_source_branch_in_progress').hide();
|
|
|
|
$('.remove_source_branch_widget.failed').show();
|
|
|
|
});
|
2016-06-02 11:05:42 +05:30
|
|
|
- else
|
|
|
|
%p
|
|
|
|
The changes were merged into
|
|
|
|
#{link_to @merge_request.target_branch, namespace_project_commits_path(@project.namespace, @project, @merge_request.target_branch), class: "label-branch"}.
|
|
|
|
= render 'projects/merge_requests/widget/merged_buttons'
|