phpci/PHPCI/View/Home/index.phtml

103 lines
4.4 KiB
PHTML
Raw Normal View History

2013-05-03 17:02:53 +02:00
<div class="row">
2014-12-03 11:01:26 +01:00
<div class="col-sm-5">
<?php print $summary; ?>
</div>
<div class="col-sm-7 pull-left">
2014-12-02 17:26:55 +01:00
<div class="box box-primary">
<div class="box-header">
<h3 class="box-title">Latest Builds</h3>
2014-04-30 15:13:07 +02:00
</div>
2014-12-02 17:26:55 +01:00
<div class="box-body">
<ul class="timeline">
<?php $last = new \DateTime('-1 Year'); ?>
<?php
foreach ($builds as $build):
switch ($build->getStatus()) {
case \PHPCI\Model\Build::STATUS_NEW:
$updated = $build->getCreated();
$label = 'Created';
2014-12-02 17:26:55 +01:00
$color = 'blue';
break;
case \PHPCI\Model\Build::STATUS_RUNNING:
$updated = $build->getStarted();
$label = 'Started';
2014-12-02 17:26:55 +01:00
$color = 'yellow';
break;
case \PHPCI\Model\Build::STATUS_SUCCESS:
$updated = $build->getFinished();
$label = 'Successful';
2014-12-02 17:26:55 +01:00
$color = 'green';
break;
case \PHPCI\Model\Build::STATUS_FAILED:
$updated = $build->getFinished();
$label = 'Failed';
2014-12-02 17:26:55 +01:00
$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>
2014-12-03 11:01:26 +01:00
<i class="fa fa-<?php print $build->getProject()->getIcon(); ?> bg-<?php print $color; ?>"></i>
2014-12-02 17:26:55 +01:00
<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>
2014-12-03 11:01:26 +01:00
-
<a href="<?php print PHPCI_URL; ?>build/view/<?php print $build->getId(); ?>">
Build #<?php print $build->getId(); ?>
</a>
-
<?php print $label; ?>
2014-12-02 17:26:55 +01:00
</h3>
<div class="timeline-body">
<?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';
}
?>
- <?php print $build->getCommitMessage(); ?>
2014-12-02 17:26:55 +01:00
</div>
</div>
</li>
<!-- END timeline item -->
<?php endforeach; ?>
<li>
<i class="fa fa-clock-o"></i>
</li>
</ul>
2014-04-30 15:13:07 +02:00
</div>
</div>
</div>
2014-12-02 17:26:55 +01:00
2013-05-10 13:28:43 +02:00
</div>