116 lines
4.4 KiB
PHTML
116 lines
4.4 KiB
PHTML
<div class="row">
|
|
<div class="col-lg-5 col-md-5 col-sm-5">
|
|
<div class="box box-primary">
|
|
<div class="box-header">
|
|
<h3 class="box-title">Latest Builds</h3>
|
|
</div>
|
|
|
|
<div class="box-body">
|
|
<ul class="timeline">
|
|
<?php $last = new \DateTime('-1 Year'); ?>
|
|
|
|
<?php
|
|
foreach ($builds as $build):
|
|
|
|
switch ($build->getProject()->getType()) {
|
|
case 'github':
|
|
$icon = 'github';
|
|
break;
|
|
|
|
case 'bitbucket':
|
|
$icon = 'bitbucket';
|
|
break;
|
|
|
|
case 'git':
|
|
case 'gitlab':
|
|
$icon = 'git';
|
|
break;
|
|
|
|
default:
|
|
$icon = 'cog';
|
|
break;
|
|
}
|
|
|
|
switch ($build->getStatus()) {
|
|
case \PHPCI\Model\Build::STATUS_NEW:
|
|
$updated = $build->getCreated();
|
|
$label = 'created';
|
|
$color = 'blue';
|
|
break;
|
|
|
|
case \PHPCI\Model\Build::STATUS_RUNNING:
|
|
$updated = $build->getStarted();
|
|
$label = 'started';
|
|
$color = 'yellow';
|
|
break;
|
|
|
|
case \PHPCI\Model\Build::STATUS_SUCCESS:
|
|
$updated = $build->getFinished();
|
|
$label = 'success';
|
|
$color = 'green';
|
|
break;
|
|
|
|
case \PHPCI\Model\Build::STATUS_FAILED:
|
|
$updated = $build->getFinished();
|
|
$label = 'failed';
|
|
$color = 'red';
|
|
break;
|
|
}
|
|
|
|
if ($updated->format('Y-m-d') != $last->format('Y-m-d')): $last = $updated;
|
|
?>
|
|
<li class="time-label">
|
|
<span class="bg-gray">
|
|
<?php print $last->format('M j Y'); ?>
|
|
</span>
|
|
</li>
|
|
<?php endif; ?>
|
|
|
|
<!-- /.timeline-label -->
|
|
<!-- timeline item -->
|
|
<li>
|
|
<i class="fa fa-<?php print $icon; ?> bg-<?php print $color; ?>"></i>
|
|
<div class="timeline-item">
|
|
<span class="time"><i class="fa fa-clock-o"></i> <?php print $updated->format('g:ia'); ?></span>
|
|
<h3 class="timeline-header">
|
|
<a href="<?php print PHPCI_URL; ?>project/view/<?php print $build->getProjectId(); ?>">
|
|
<?php print $build->getProject()->getTitle(); ?>
|
|
</a>
|
|
</h3>
|
|
|
|
<div class="timeline-body">
|
|
Build <?php print $label; ?>
|
|
</div>
|
|
</div>
|
|
</li>
|
|
<!-- END timeline item -->
|
|
|
|
<?php endforeach; ?>
|
|
|
|
<li>
|
|
<i class="fa fa-clock-o"></i>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-lg-7 col-md-7 col-sm-7">
|
|
<div class="box box-default">
|
|
<div class="box-header"><h3 class="box-title">Project Overview</h3></div>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>Project</th>
|
|
<th>Health</th>
|
|
<th style="width: 100px"></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="project-overview">
|
|
<?php print $summary; ?>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|