* Task#3921

This commit is contained in:
滔哥
2018-05-07 15:04:28 +08:00
parent 83a6c78c3b
commit 27466d9cd8
4 changed files with 68 additions and 33 deletions
+53 -30
View File
@@ -12,11 +12,15 @@
?>
<?php include '../../common/view/header.html.php';?>
<?php js::set('confirmDelete', $lang->build->confirmDelete)?>
<div id="mainMenu" class="clearfix">
<div id="mainMenu" class="clearfix table-row">
<div class="btn-toolbar pull-left">
<div class="pull-left table-group-btns">
<button type="button" class="btn btn-link group-collapse-all"><?php echo $lang->project->treeLevel['root'];?> <i class="icon-fold-all"> </i></button>
<button type="button" class="btn btn-link group-expand-all"><?php echo $lang->project->treeLevel['all'];?> <i class="icon-unfold-all"> </i></button>
</div>
<span class='btn btn-link btn-active-text'>
<span class='text'><?php echo $lang->project->build;?></span>
<span class='label label-light label-badge'><?php echo count($builds);?></span>
<span class='label label-light label-badge'><?php echo count($buildsTotal);?></span>
</span>
</div>
<div class="btn-toolbar pull-right">
@@ -24,42 +28,50 @@
</div>
</div>
<div id="mainContent">
<div class='main-table'>
<table class="table" id='buildList'>
<div class='main-table' data-ride="table" data-checkable="false" data-group="true">
<table class="table table-grouped text-center" id='buildList'>
<thead>
<tr class='text-center'>
<th class='w-id'><?php echo $lang->build->id;?></th>
<th class='w-120px'><?php echo $lang->build->product;?></th>
<th><?php echo $lang->build->name;?></th>
<th><?php echo $lang->build->scmPath;?></th>
<th><?php echo $lang->build->filePath;?></th>
<th class='w-100px'><?php echo $lang->build->date;?></th>
<th class='w-user'><?php echo $lang->build->builder;?></th>
<th class='c-actions-3'><?php echo $lang->actions;?></th>
<tr class="divider">
<th class="c-side"><?php echo $lang->build->product;?></th>
<th class="c-id-sm"><?php echo $lang->build->id;?></th>
<th class="c-name"><?php echo $lang->build->name;?></th>
<th class="c-url"><?php echo $lang->build->scmPath;?></th>
<th class="c-url"><?php echo $lang->build->filePath;?></th>
<th class="c-date"><?php echo $lang->build->date;?></th>
<th class="c-user"><?php echo $lang->build->builder;?></th>
<th class="c-actions-3"><?php echo $lang->actions;?></th>
</tr>
</thead>
<tbody>
<?php foreach($builds as $build):?>
<tr>
<td class='text-center'><?php echo $build->id;?></td>
<td class='nobr' title='<?php echo $build->productName?>'><?php echo $build->productName;?></td>
<td class='nobr'>
<?php foreach($projectBuilds as $projectID => $builds):?>
<?php $total = count($builds);?>
<?php foreach($builds as $index => $build):?>
<?php $trClass = $index == 0 ? 'divider-top' : '';?>
<tr data-id="<?php echo $projectID;?>" class="<?php echo $trClass;?>">
<?php if($index == 0):?>
<td rowspan="<?php echo $total;?>" class="c-side text-left group-toggle">
<a title="<?php echo $build->productName;?>" class="text-primary"><i class="icon-caret-down"></i> <?php echo $build->productName;?></a>
<div class="small"><span class="text-muted"><?php echo $lang->project->build;?></span> <?php echo $total;?></div>
</td>
<?php endif;?>
<td class="c-id-sm text-muted"><?php echo $build->id;?></td>
<td class="c-name">
<?php if($build->branchName) echo "<span class='label label-info label-badge'>{$build->branchName}</span>"?>
<?php echo html::a($this->createLink('build', 'view', "build=$build->id"), $build->name);?>
</td>
<td title="<?php echo $build->scmPath?>"><?php echo strpos($build->scmPath, 'http') === 0 ? html::a($build->scmPath) : $build->scmPath;?></td>
<td title="<?php echo $build->filePath?>"><?php echo strpos($build->filePath, 'http') === 0 ? html::a($build->filePath) : $build->filePath;?></td>
<td><?php echo $build->date?></td>
<td><?php echo $users[$build->builder]?></td>
<td class='c-actions'>
<td class="c-url" title="<?php echo $build->scmPath?>"><?php echo strpos($build->scmPath, 'http') === 0 ? html::a($build->scmPath) : $build->scmPath;?></td>
<td class="c-url" title="<?php echo $build->filePath?>"><?php echo strpos($build->filePath, 'http') === 0 ? html::a($build->filePath) : $build->filePath;?></td>
<td class="c-date"><?php echo $build->date?></td>
<td class="c-user em"><?php echo $users[$build->builder]?></td>
<td class="c-actions">
<div class='more'>
<?php
if(common::hasPriv('build', 'delete', $build))
{
$deleteURL = $this->createLink('build', 'delete', "buildID=$build->id&confirm=yes");
echo html::a("javascript:ajaxDelete(\"$deleteURL\",\"buildList\",confirmDelete)", '<i class="icon-trash"></i>', '', "class='btn' title='{$lang->build->delete}'");
}
?>
<?php
if(common::hasPriv('build', 'delete', $build))
{
$deleteURL = $this->createLink('build', 'delete', "buildID=$build->id&confirm=yes");
echo html::a("javascript:ajaxDelete(\"$deleteURL\",\"buildList\",confirmDelete)", '<i class="icon-trash"></i>', '', "class='btn' title='{$lang->build->delete}'");
}
?>
</div>
<?php
if(common::hasPriv('build', 'linkstory') and common::hasPriv('build', 'view'))
@@ -73,6 +85,17 @@
?>
</td>
</tr>
<?php if(($index + 1) == $total):?>
<tr class="group-toggle group-summary divider hidden" data-id="<?php echo $projectID;?>">
<td class="c-side text-left">
<a title="<?php echo $build->productName;?>"><i class="icon-caret-right text-muted"></i> <?php echo $build->productName;?></a>
</td>
<td colspan="7" class="text-left">
<div class="small with-padding"><span class="text-muted"><?php echo $lang->project->build;?></span> <?php echo $total;?></div>
</td>
</tr>
<?php endif;?>
<?php endforeach;?>
<?php endforeach;?>
</tbody>
</table>