debian-mirror-gitlab/app/views/projects/merge_requests/widget/_merged.html.haml

49 lines
2.3 KiB
Text
Raw Normal View History

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')
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
The source branch has been removed.
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.
2015-10-24 18:46:33 +05:30
= link_to namespace_project_branch_path(@merge_request.source_project.namespace, @merge_request.source_project, @merge_request.source_branch), remote: true, method: :delete, class: "btn btn-primary btn-sm remove_source_branch" do
2015-09-11 14:41:01 +05:30
%i.fa.fa-times
Remove Source Branch
.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();
});