* Adjust the merge branch page style.

This commit is contained in:
hufangzhou
2021-12-23 14:01:25 +08:00
parent f5da2d8a21
commit 897f930f48
2 changed files with 13 additions and 3 deletions
+12 -3
View File
@@ -65,8 +65,8 @@ $(function()
{
$('#targetBranch').attr('disabled', true).trigger('chosen:updated');
var newBranchName = '<tr><th>' + branchLang.name + "</th><td class='required'><input type='text' name='name' id='name' class='form-control' /></td></tr>";
var newBranchDesc = '<tr><th>' + branchLang.desc + "</th><td><input type='text' name='desc' id='desc' class='form-control' /></td></tr>";
var newBranchName = '<tr><th>' + branchLang.name + "</th><td class='required' colspan='7'><input type='text' name='name' id='name' class='form-control' /></td></tr>";
var newBranchDesc = '<tr><th>' + branchLang.desc + "</th><td colspan='7'><input type='text' name='desc' id='desc' class='form-control' /></td></tr>";
$(this).closest('tr').after(newBranchName + newBranchDesc);
}
else
@@ -96,6 +96,8 @@ $(function()
$('#targetBranch').replaceWith(data);
$('#targetBranch_chosen').remove();
$('#targetBranch').chosen();
if($('#createBranch').prop('checked')) $('#targetBranch').attr('disabled', true).trigger('chosen:updated')
})
})
@@ -123,6 +125,13 @@ $(function()
return false;
}
var branchNames = Object.values(branchPairs);
if(isChecked && branchNames.includes($('#name').val()) !== -1)
{
alert(branchLang.existName);
return false;
}
if(confirm(confirmMergeMessage))
{
var postData = {'name' : $('#name').val(), 'desc' : $('#desc').val(), 'createBranch' : isChecked, 'mergedBranchIDList' : mergedBranchIDList, 'targetBranch' : $('#targetBranch').val()};
@@ -136,7 +145,7 @@ $(function()
{
if(data.result == 'fail')
{
alert(data.message)
alert(data.message.name)
return false;
}
else
+1
View File
@@ -15,6 +15,7 @@
<?php js::set('orderBy', $orderBy)?>
<?php js::set('branchLang', $lang->branch);?>
<?php js::set('productID', $productID);?>
<?php js::set('branchPairs', $branchPairs);?>
<?php $canCreate = common::hasPriv('branch', 'create');?>
<?php $canOrder = common::hasPriv('branch', 'sort');?>
<?php $canBatchEdit = common::hasPriv('branch', 'batchEdit');?>