Commit b3ae4b9a authored by Bryce Johnson's avatar Bryce Johnson

Move script tag content in widget views into ci_bundle.

parent e315e3ea
...@@ -5,6 +5,7 @@ $(() => { ...@@ -5,6 +5,7 @@ $(() => {
* temporarily. * temporarily.
* */ * */
if ($('.accept-mr-form').length) {
$('.accept-mr-form').on('ajax:send', () => { $('.accept-mr-form').on('ajax:send', () => {
$('.accept-mr-form :input').disable(); $('.accept-mr-form :input').disable();
}); });
...@@ -21,4 +22,18 @@ $(() => { ...@@ -21,4 +22,18 @@ $(() => {
e.preventDefault(); e.preventDefault();
$(this).closest('form').submit(); $(this).closest('form').submit();
}); });
} else if ($('.rebase-in-progress').length) {
merge_request_widget.rebaseInProgress();
} else if ($('.rebase-mr-form').length) {
$('.rebase-mr-form').on('ajax:send', function() {
$('.rebase-mr-form :input').disable();
});
$('.js-rebase-button').on('click', function() {
$('.js-rebase-button').html("<i class='fa fa-spinner fa-spin'></i> Rebase in progress");
});
} else {
merge_request_widget.getMergeStatus();
}
}); });
- content_for :page_specific_javascripts do
= page_specific_javascript_tag('merge_request_widget/ci_bundle.js')
%strong %strong
= icon("spinner spin") = icon("spinner spin")
Checking ability to merge automatically&hellip; Checking ability to merge automatically&hellip;
:javascript
$(function() {
merge_request_widget.getMergeStatus();
});
- content_for :page_specific_javascripts do
= page_specific_javascript_tag('merge_request_widget/ci_bundle.js')
- if @merge_request.rebase_in_progress? || (defined?(rebase_in_progress) && rebase_in_progress) - if @merge_request.rebase_in_progress? || (defined?(rebase_in_progress) && rebase_in_progress)
%h4 %h4.rebase-in-progress
= icon("spinner spin") = icon("spinner spin")
Rebase in progress&hellip; Rebase in progress&hellip;
%p %p
This merge request is in the process of being rebased. This merge request is in the process of being rebased.
:javascript
$(function() {
merge_request_widget.rebaseInProgress()
});
- elsif !can_push_branch?(@merge_request.source_project, @merge_request.source_branch) - elsif !can_push_branch?(@merge_request.source_project, @merge_request.source_branch)
%h4 %h4
= icon("exclamation-triangle") = icon("exclamation-triangle")
...@@ -26,12 +25,3 @@ ...@@ -26,12 +25,3 @@
Rebase onto #{@merge_request.target_branch} Rebase onto #{@merge_request.target_branch}
.accept-control .accept-control
Fast-forward merge is not possible. Rebase the source branch onto the target branch or merge target branch into source branch to allow this merge request to be merged. Fast-forward merge is not possible. Rebase the source branch onto the target branch or merge target branch into source branch to allow this merge request to be merged.
:javascript
$('.rebase-mr-form').on('ajax:send', function() {
$('.rebase-mr-form :input').disable();
});
$('.js-rebase-button').on('click', function() {
$('.js-rebase-button').html("<i class='fa fa-spinner fa-spin'></i> Rebase in progress");
});
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