phpci/PHPCI/View/BuildsTable.phtml

84 lines
2.2 KiB
PHTML
Raw Normal View History

2013-05-10 13:28:43 +02:00
<?php if(empty($builds) || !count($builds)): ?>
<tr class="">
<td colspan="6">No builds yet.</td>
</tr>
<?php endif; ?>
<?php foreach($builds as $build): ?>
2013-05-10 13:28:43 +02:00
<?php
switch($build->getStatus())
{
case 0:
$cls = 'active';
2013-06-05 21:59:05 +02:00
$subcls = 'info';
2013-05-10 13:28:43 +02:00
$status = 'Pending';
2013-06-05 21:59:05 +02:00
2013-05-10 13:28:43 +02:00
break;
case 1:
$cls = 'warning';
2013-06-05 21:59:05 +02:00
$subcls = 'warning';
2013-05-10 13:28:43 +02:00
$status = 'Running';
break;
case 2:
$cls = 'success';
2013-06-05 21:59:05 +02:00
$subcls = 'success';
2013-05-10 13:28:43 +02:00
$status = 'Success';
break;
case 3:
$cls = 'danger';
$subcls = 'danger';
2013-05-10 13:28:43 +02:00
$status = 'Failed';
break;
}
?>
<tr class="<?php print $cls; ?>">
2014-01-28 22:27:39 +01:00
<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>
2014-03-12 16:22:57 +01:00
2014-12-02 17:26:55 +01:00
<td class="hidden-md hidden-sm hidden-xs">
2014-03-12 16:22:57 +01:00
<?php
if ($build->getCommitId() !== 'Manual') {
print sprintf(
2014-12-03 14:15:33 +01:00
'<a href="%s" target="_blank">%s (%s)</a>',
$build->getCommitLink(),
substr($build->getCommitId(), 0, 7),
$build->getCommitterEmail()
);
} else {
print 'Manual Build';
2014-03-12 16:22:57 +01:00
}
?>
</td>
2014-12-02 17:26:55 +01:00
<td><a href="<?php print $build->getBranchLink(); ?>" target="_blank"><?php print $build->getBranch(); ?></a></td>
<td>
<span class='label label-<?php echo $subcls ?>'><?php echo $status ?></span>
</td>
2013-05-10 13:28:43 +02:00
<td>
<div class="btn-group">
2014-04-30 15:13:07 +02:00
<a class="btn btn-default btn-sm" href="<?php echo PHPCI_URL ?>build/view/<?php print $build->getId(); ?>">View</a>
2013-05-10 17:25:51 +02:00
<?php if($this->User()->getIsAdmin()): ?>
2014-04-30 15:13:07 +02:00
<button class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown">
2013-05-10 13:28:43 +02:00
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
2014-01-28 22:27:39 +01:00
<li><a href="<?php echo PHPCI_URL ?>build/delete/<?php print $build->getId(); ?>" class="phpci-app-delete-build">Delete Build</a></li>
2013-05-10 13:28:43 +02:00
</ul>
2013-05-10 17:25:51 +02:00
<?php endif; ?>
2013-05-10 13:28:43 +02:00
</div>
</td>
</tr>
<?php endforeach; ?>