* Adjust view header.

This commit is contained in:
Guan Xiying
2021-11-23 20:08:16 +08:00
parent 7b9cefc2f9
commit bcb70c304e
3 changed files with 104 additions and 95 deletions
-1
View File
@@ -4,4 +4,3 @@
.table-content tbody tr td{border:none;}
.table-content thead tr th{text-align: left; vertical-align: middle;}
.detail-content{margin-top:0;}
-1
View File
@@ -34,7 +34,6 @@
<?php endif; ?>
</div>
</div>
</div>
<div id='mainContent' class='main-content'>
<div class='tabs' id='tabsNav'>
+104 -93
View File
@@ -1,26 +1,27 @@
<?php include '../../common/view/header.html.php'; ?>
<?php if(!isset($MR->id)): ?>
<div id='mainContent'>
<div class="table-empty-tip">
<p>
<span class="text-muted"><?php echo $lang->mr->notFound;?></span>
<?php if(common::hasPriv('mr', 'create')): ?>
<?php echo html::a($this->createLink('mr', 'create'), "<i class='icon icon-plus'></i> " . $lang->mr->create, '', "class='btn btn-info'"); ?>
<?php endif; ?>
</p>
</div>
<div id='mainContent'>
<div class="table-empty-tip">
<p>
<span class="text-muted"><?php echo $lang->mr->notFound;?></span>
<?php if(common::hasPriv('mr', 'create')): ?>
<?php echo html::a($this->createLink('mr', 'create'), "<i class='icon icon-plus'></i> " . $lang->mr->create, '', "class='btn btn-info'"); ?>
<?php endif; ?>
</p>
</div>
<!-- If this mr is deleted in GitLab, then show this part to user. -->
</div>
<?php /* If this mr is deleted in GitLab, then show this part to user. */?>
<?php elseif(empty($rawMR) or !isset($rawMR->id)): ?>
<div id='mainContent'>
<div class="table-empty-tip">
<p>
<span class="text-muted"><?php echo $lang->mr->notFound; ?></span>
<?php echo html::a($this->createLink('mr', 'browse'), "<i class='icon icon-plus'></i> " . $lang->mr->browse, '', "class='btn btn-info'"); ?>
</p>
</div>
<div id='mainContent'>
<div class="table-empty-tip">
<p>
<span class="text-muted"><?php echo $lang->mr->notFound; ?></span>
<?php echo html::a($this->createLink('mr', 'browse'), "<i class='icon icon-plus'></i> " . $lang->mr->browse, '', "class='btn btn-info'"); ?>
</p>
</div>
</div>
<?php else: ?>
<div id='mainMenu' class='clearfix'>
<div class="btn-toolbar pull-left">
<?php echo html::a($this->createLink('mr', 'browse'), '<i class="icon icon-back icon-sm"></i> ' . $lang->goback, '', "class='btn btn-secondary'"); ?>
<div class="divider"></div>
@@ -30,20 +31,29 @@
<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>
</div>
</div>
</div>
<div id="mainContent" class="main-row">
<div class="main-col">
<div class="cell">
<div id="mainContent" class="main-content">
<div class='tabs' id='tabsNav'>
<ul class='nav nav-tabs'>
<li class='active'><?php echo html::a(inlink('view', "mr={$MR->id}"), $lang->mr->overview);?></li>
<li><?php echo html::a(inlink('viewDiff', "mr={$MR->id}"), $lang->mr->viewDiff);?></li>
<li><?php echo html::a(inlink('link', "mr={$MR->id}") . "#story", html::icon($lang->icons['story'], 'text-info') . ' ' . $lang->productplan->linkedStories);?></a></li>
<li><?php echo html::a(inlink('link', "mr={$MR->id}") . "#bugs", html::icon($lang->icons['bug'], 'text-info') . ' ' . $lang->productplan->linkedBugs);?></a></li>
<li><?php echo html::a(inlink('link', "mr={$MR->id}") . "#tasks", html::icon($lang->icons['todo'], 'text-info') . ' ' . $lang->mr->linkedTasks);?></a></li>
</ul>
<div class='tab-content'>
<div class="cell col-8">
<div class="detail">
<div class="detail-content">
<table class="table table-content">
<thead>
<table class="table table-content">
<thead>
<tr>
<th colspan='2'>
<span><?php echo $lang->mr->from . html::a($sourceProjectURL, $sourceProjectName . ":" . $MR->sourceBranch, "_blank", "class='btn btn-link btn-active-text' style='color: blue'") . $lang->mr->to . html::a($targetProjectURL, $targetProjectName . ":" . $MR->targetBranch, "_blank", "class='btn btn-link btn-active-text' style='color: blue'"); ?></span>
</th>
</tr>
</thead>
</thead>
<tbody>
<tr>
<th class="w-100px"><?php echo $lang->mr->status;?></th>
@@ -69,78 +79,79 @@
<tr>
<th><?php echo $lang->mr->MRHasConflicts; ?></th>
<td><?php echo ($rawMR->has_conflicts ? $lang->mr->hasConflicts : $lang->mr->hasNoConflict);?></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="cell">
<div class="detail">
<div class="detail-title"><?php echo $lang->mr->description; ?></div>
<div class="detail-content article-content">
<?php echo !empty($MR->description) ? $MR->description : "<div class='text-center text-muted'>" . $lang->noData . '</div>'; ?>
</div>
</div>
</div>
<?php if($rawMR->state == 'opened'): ?>
<div class="cell"><?php echo sprintf($lang->mr->commandDocument, $httpRepoURL, $MR->sourceBranch, $branchPath, $MR->targetBranch, $branchPath, $MR->targetBranch); ?></div>
<?php endif; ?>
<div class='main-actions'>
<div class="btn-toolbar">
<?php common::printBack(inlink('browse', '')); ?>
<?php if($rawMR->state == 'opened' and !$rawMR->has_conflicts) echo html::a(inlink('accept', "mr=$MR->id"), '<i class="icon icon-flow"></i> ' . $lang->mr->acceptMR, '', "id='mergeButton' class='btn'"); ?>
<?php if($rawMR->state == 'opened'): ?>
<?php if($rawMR->has_conflicts or $MR->compileStatus != 'success'):?>
<?php echo html::a(inlink('approval', "mr=$MR->id&action=approve&onlybody=yes"), '<i class="icon icon-ok"></i> ' . $lang->mr->approve, '', "id='mergeButton' class='btn iframe showinonlybody' disabled"); ?>
<?php else:?>
<?php echo html::a(inlink('approval', "mr=$MR->id&action=approve&onlybody=yes"), '<i class="icon icon-ok"></i> ' . $lang->mr->approve, '', "id='mergeButton' class='btn iframe showinonlybody'"); ?>
<?php endif;?>
<?php echo html::a(inlink('approval', "mr=$MR->id&action=reject&onlybody=yes"), '<i class="icon icon-bug"></i> ' . $lang->mr->reject, '', "id='mergeButton' class='btn iframe showinonlybody'"); ?>
<?php echo html::a(inlink('close', "mr=$MR->id"), '<i class="icon icon-close"></i> ' . $lang->mr->close, '', "id='mergeButton' class='btn'"); ?>
<?php echo html::a(inlink('edit', "mr=$MR->id"), '<i class="icon icon-edit"></i> ' . str_replace($lang->mr->common, '', $lang->mr->edit), '', "id='mergeButton' class='btn'"); ?>
<?php endif;?>
<?php if($rawMR->state == 'closed') echo html::a(inlink('reopen', "mr=$MR->id"), '<i class="icon icon-restart"></i> ' . $lang->mr->reopen, '', "id='mergeButton' class='btn'"); ?>
<?php echo html::a(inlink('delete', "mr=$MR->id"), '<i class="icon icon-trash"></i> ' . str_replace($lang->mr->common, '', $lang->mr->delete), '', "id='mergeButton' class='btn'"); ?>
</div>
</div>
</div>
<div class="side-col col-4">
<div class="cell">
<details class="detail" open>
<summary class="detail-title"><?php echo $lang->compile->job;?></summary>
<div class="detail-content">
<?php if($MR->compileID):?>
<table class="table table-data">
<tbody>
<tr>
<th class="w-90px"><?php echo $lang->job->common;?></th>
<td><?php echo $compile->name;?></td>
</tr>
<tr>
<th><?php echo $lang->compile->atTime;?></th>
<td><?php echo $compileJob ? $compileJob->lastExec : $lang->mr->compileUnexecuted;?></td>
</tr>
<?php if($compileJob):?>
<tr>
<th><?php echo $lang->compile->result;?></th>
<td>
<?php echo zget($lang->compile->statusList, $compile->status);?> &nbsp;&nbsp;
<?php echo html::a($this->createLink('job', 'view', "jobID=$compileJob->id&compileID=$compile->id&onlybody=yes"), "<i class='icon icon-search'>{$lang->compile->logs}</i>", "", "class='iframe'");?>
</td>
</tr>
<?php endif;?>
</tbody>
</table>
<?php else:?>
<div class='text-center'><?php echo $lang->mr->noCompileJob;?></div>
<?php endif;?>
</div>
</details>
</div>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="cell col-4">
<details class="detail" open>
<summary class="detail-title"><?php echo $lang->compile->job;?></summary>
<div class="detail-content">
<?php if($MR->compileID):?>
<table class="table table-data">
<tbody>
<tr>
<th class="w-90px"><?php echo $lang->job->common;?></th>
<td><?php echo $compile->name;?></td>
</tr>
<tr>
<th><?php echo $lang->compile->atTime;?></th>
<td><?php echo $compileJob ? $compileJob->lastExec : $lang->mr->compileUnexecuted;?></td>
</tr>
<?php if($compileJob):?>
<tr>
<th><?php echo $lang->compile->result;?></th>
<td>
<?php echo zget($lang->compile->statusList, $compile->status);?> &nbsp;&nbsp;
<?php echo html::a($this->createLink('job', 'view', "jobID=$compileJob->id&compileID=$compile->id&onlybody=yes"), "<i class='icon icon-search'>{$lang->compile->logs}</i>", "", "class='iframe'");?>
</td>
</tr>
<?php endif;?>
</tbody>
</table>
<?php else:?>
<div class='text-center'><?php echo $lang->mr->noCompileJob;?></div>
<?php endif;?>
</div>
</details>
</div>
<div class="cell col-8">
<div class="detail">
<div class="detail-title"><?php echo $lang->mr->description; ?></div>
<div class="detail-content article-content">
<?php echo !empty($MR->description) ? $MR->description : "<div class='text-center text-muted'>" . $lang->noData . '</div>'; ?>
</div>
</div>
</div>
<?php if($rawMR->state == 'opened'): ?>
<div class="cell col-8"><?php echo sprintf($lang->mr->commandDocument, $httpRepoURL, $MR->sourceBranch, $branchPath, $MR->targetBranch, $branchPath, $MR->targetBranch); ?></div>
<?php endif; ?>
</div>
</div>
<br>
<div class='main-actions'>
<div class="btn-toolbar">
<?php common::printBack(inlink('browse', '')); ?>
<?php if($rawMR->state == 'opened' and !$rawMR->has_conflicts) echo html::a(inlink('accept', "mr=$MR->id"), '<i class="icon icon-flow"></i> ' . $lang->mr->acceptMR, '', "id='mergeButton' class='btn'"); ?>
<?php if($rawMR->state == 'opened'): ?>
<?php if($rawMR->has_conflicts or $MR->compileStatus != 'success'):?>
<?php echo html::a(inlink('approval', "mr=$MR->id&action=approve&onlybody=yes"), '<i class="icon icon-ok"></i> ' . $lang->mr->approve, '', "id='mergeButton' class='btn iframe showinonlybody' disabled"); ?>
<?php else:?>
<?php echo html::a(inlink('approval', "mr=$MR->id&action=approve&onlybody=yes"), '<i class="icon icon-ok"></i> ' . $lang->mr->approve, '', "id='mergeButton' class='btn iframe showinonlybody'"); ?>
<?php endif;?>
<?php echo html::a(inlink('approval', "mr=$MR->id&action=reject&onlybody=yes"), '<i class="icon icon-bug"></i> ' . $lang->mr->reject, '', "id='mergeButton' class='btn iframe showinonlybody'"); ?>
<?php echo html::a(inlink('close', "mr=$MR->id"), '<i class="icon icon-close"></i> ' . $lang->mr->close, '', "id='mergeButton' class='btn'"); ?>
<?php echo html::a(inlink('edit', "mr=$MR->id"), '<i class="icon icon-edit"></i> ' . str_replace($lang->mr->common, '', $lang->mr->edit), '', "id='mergeButton' class='btn'"); ?>
<?php endif;?>
<?php if($rawMR->state == 'closed') echo html::a(inlink('reopen', "mr=$MR->id"), '<i class="icon icon-restart"></i> ' . $lang->mr->reopen, '', "id='mergeButton' class='btn'"); ?>
<?php echo html::a(inlink('delete', "mr=$MR->id"), '<i class="icon icon-trash"></i> ' . str_replace($lang->mr->common, '', $lang->mr->delete), '', "id='mergeButton' class='btn'"); ?>
</div>
</div>
</div>
</div>
<?php endif; ?>
<script>
/* Callback function for approval view. */