* Code for task #46003.

This commit is contained in:
liyuchun
2021-12-22 16:12:03 +08:00
parent 5dd72fd196
commit cdbff35897
4 changed files with 52 additions and 32 deletions
+7 -5
View File
@@ -11,7 +11,7 @@
</div>
</div>
<?php /* If this mr is deleted in GitLab, then show this part to user. */?>
<?php elseif(empty($rawMR) or !isset($rawMR->id)): ?>
<?php elseif($MR->synced and (empty($rawMR) or !isset($rawMR->id))): ?>
<div id='mainContent'>
<div class="table-empty-tip">
<p>
@@ -28,7 +28,9 @@
<div class="page-title">
<span class="label label-id"><?php echo $MR->id ?></span>
<span class="text" title='<?php echo $MR->title; ?>'><?php echo $MR->title; ?></span>
<?php if($MR->synced):?>
<span class="text" title='<?php echo $MR->title; ?>' style='color: blue'><?php echo html::a($rawMR->web_url, $lang->mr->viewInGitlab, "_blank", "class='btn btn-link btn-active-text' style='color: blue'"); ?></span>
<?php endif;?>
</div>
</div>
</div>
@@ -90,7 +92,7 @@
</div>
</div>
<?php if($rawMR->state == 'opened'): ?>
<?php if($MR->synced and $rawMR->state == 'opened'): ?>
<div class="cell"><?php echo sprintf($lang->mr->commandDocument, $httpRepoURL, $MR->sourceBranch, $branchPath, $MR->targetBranch, $branchPath, $MR->targetBranch); ?></div>
<?php endif; ?>
@@ -98,8 +100,8 @@
<div class="btn-toolbar">
<?php common::printBack(inlink('browse', '')); ?>
<?php $acceptDisabled = ($MR->approvalStatus != 'approved' or ($MR->compileID != 0 and $MR->compileStatus != 'success')) ? ' disabled' : ''; ?>
<?php if($rawMR->state == 'opened' and !$rawMR->has_conflicts) common::printIcon('mr', 'accept', "mr=$MR->id", $MR, 'button', 'flow', 'hiddenwin', 'mergeButton btn', false, $acceptDisabled, $lang->mr->acceptMR);?>
<?php if($rawMR->state == 'opened'): ?>
<?php if($MR->synced and $rawMR->state == 'opened' and !$rawMR->has_conflicts) common::printIcon('mr', 'accept', "mr=$MR->id", $MR, 'button', 'flow', 'hiddenwin', 'mergeButton btn', false, $acceptDisabled, $lang->mr->acceptMR);?>
<?php if($MR->synced and $rawMR->state == 'opened'): ?>
<?php if($rawMR->has_conflicts or ($MR->compileID != 0 and $MR->compileStatus != 'success') or $MR->approvalStatus == 'approved'):?>
<?php common::printIcon('mr', 'approval', "mr=$MR->id&action=approve", $MR, 'button', 'ok', 'hiddenwin', 'mergeButton', true, 'disabled', $lang->mr->approve);?>
<?php else:?>
@@ -109,7 +111,7 @@
<?php common::printIcon('mr', 'close', "mr=$MR->id", $MR, 'button', 'off', 'hiddenwin', 'mergeButton');?>
<?php common::printIcon('mr', 'edit', "mr=$MR->id", $MR, 'button', 'edit');?>
<?php endif;?>
<?php if($rawMR->state == 'closed') common::printIcon('mr', 'reopen', "mr=$MR->id", $MR, 'button', 'restart', 'hiddenwin', 'mergeButton'); ?>
<?php if($MR->synced and $rawMR->state == 'closed') common::printIcon('mr', 'reopen', "mr=$MR->id", $MR, 'button', 'restart', 'hiddenwin', 'mergeButton'); ?>
<?php common::printIcon('mr', 'delete', "mr=$MR->id", $MR, 'button', 'trash', 'hiddenwin');?>
</div>
</div>