81 lines
2.1 KiB
PHTML
81 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 = 'active';
|
|
$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 = 'danger';
|
|
$subcls = 'danger';
|
|
$status = 'Failed';
|
|
break;
|
|
}
|
|
?>
|
|
<tr class="<?php print $cls; ?>">
|
|
<td><a href="<?php echo PHPCI_URL ?>build/view/<?php print $build->getId(); ?>">#<?php print str_pad($build->getId(), 6, '0', STR_PAD_LEFT); ?></a></td>
|
|
<td><a href="<?php echo PHPCI_URL ?>project/view/<?php print $build->getProjectId(); ?>">
|
|
<?php
|
|
if (is_object($build->getProject())) {
|
|
print htmlspecialchars($build->getProject()->getTitle());
|
|
} else {
|
|
print ' - ';
|
|
}
|
|
?></a></td>
|
|
|
|
<td>
|
|
<?php
|
|
if ($build->getCommitId() !== 'Manual') {
|
|
print '<a href="' . $build->getCommitLink() . '">';
|
|
}
|
|
print $build->getCommitId();
|
|
if ($build->getCommitId() !== 'Manual') {
|
|
print '</a>';
|
|
}
|
|
?>
|
|
</td>
|
|
|
|
<td><a href="<?php print $build->getBranchLink(); ?>"><?php print $build->getBranch(); ?></a></td>
|
|
<td>
|
|
<span class='label label-<?php echo $subcls ?>'><?php echo $status ?></span>
|
|
</td>
|
|
<td>
|
|
<div class="btn-group">
|
|
<a class="btn btn-default btn-sm" href="<?php echo PHPCI_URL ?>build/view/<?php print $build->getId(); ?>">View</a>
|
|
<?php if($this->User()->getIsAdmin()): ?>
|
|
<button class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown">
|
|
<span class="caret"></span>
|
|
</button>
|
|
<ul class="dropdown-menu">
|
|
<li><a href="<?php echo PHPCI_URL ?>build/delete/<?php print $build->getId(); ?>" class="phpci-app-delete-build">Delete Build</a></li>
|
|
</ul>
|
|
<?php endif; ?>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<?php endforeach; ?>
|