82 lines
2.1 KiB
PHTML
82 lines
2.1 KiB
PHTML
|
|
<?php if(empty($builds) || !count($builds)): ?>
|
|
<tr class="">
|
|
<td colspan="6">No builds yet.</td>
|
|
</tr>
|
|
<?php endif; ?>
|
|
|
|
<?php foreach($builds as $build): ?>
|
|
<?php
|
|
switch($build->getStatus())
|
|
{
|
|
case 0:
|
|
$cls = 'info';
|
|
$subcls = 'info';
|
|
$status = 'Pending';
|
|
|
|
break;
|
|
|
|
case 1:
|
|
$cls = 'warning';
|
|
$subcls = 'warning';
|
|
$status = 'Running';
|
|
break;
|
|
|
|
case 2:
|
|
$cls = 'success';
|
|
$subcls = 'success';
|
|
$status = 'Success';
|
|
break;
|
|
|
|
case 3:
|
|
$cls = 'error';
|
|
$subcls = 'important';
|
|
$status = 'Failed';
|
|
break;
|
|
}
|
|
?>
|
|
<tr class="<?php print $cls; ?>">
|
|
<td><a href="<?= PHPCI_URL ?>build/view/<?php print $build->getId(); ?>">#<?php print str_pad($build->getId(), 6, '0', STR_PAD_LEFT); ?></a></td>
|
|
<td><a href="<?= PHPCI_URL ?>project/view/<?php print $build->getProjectId(); ?>"><?php print $build->getProject()->getTitle(); ?></a></td>
|
|
<td><a href="<?php print $build->getCommitLink(); ?>"><?php print $build->getCommitId(); ?></a></td>
|
|
<td><a href="<?php print $build->getBranchLink(); ?>"><?php print $build->getBranch(); ?></a></td>
|
|
<td>
|
|
<?php
|
|
$plugins = json_decode($build->getPlugins(), true);
|
|
|
|
if ( !is_array($plugins) ) {
|
|
$plugins = array();
|
|
}
|
|
if ( 0 === count($plugins) ) {
|
|
?>
|
|
<span class='label label-<?= $subcls ?>'>
|
|
<?= $status ?>
|
|
</span>
|
|
<?php
|
|
}
|
|
?>
|
|
<?php
|
|
foreach($plugins as $plugin => $pluginstatus):
|
|
$subcls = $pluginstatus?'label label-success':'label label-important';
|
|
?>
|
|
<span class='<?= $subcls ?>'>
|
|
<?= ucwords(str_replace('_', ' ', $plugin)) ?>
|
|
</span>
|
|
<?php endforeach; ?>
|
|
<br style='clear:both;' />
|
|
</td>
|
|
<td>
|
|
<div class="btn-group">
|
|
<a class="btn" href="<?= PHPCI_URL ?>build/view/<?php print $build->getId(); ?>">View</a>
|
|
<?php if($this->User()->getIsAdmin()): ?>
|
|
<button class="btn dropdown-toggle" data-toggle="dropdown">
|
|
<span class="caret"></span>
|
|
</button>
|
|
<ul class="dropdown-menu">
|
|
<li><a href="javascript:confirmDelete('<?= PHPCI_URL ?>build/delete/<?php print $build->getId(); ?>');">Delete Build</a></li>
|
|
</ul>
|
|
<?php endif; ?>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<?php endforeach; ?> |