Merge pull request #77 from gabriel403/feature/uitweaks

You certainly can has merge.
This commit is contained in:
Dan Cryer 2013-06-06 12:25:38 -07:00
commit bbb40ee89b
3 changed files with 49 additions and 2 deletions

View file

@ -10,6 +10,7 @@
namespace PHPCI;
use b8;
use b8\Registry;
use b8\Http\Response\RedirectResponse;
use b8\View;
@ -35,6 +36,9 @@ class Application extends b8\Application
$skipValidation = ($externalAction || $sessionAction);
if($skipValidation || $this->validateSession()) {
if ( !empty($_SESSION['user']) ) {
Registry::getInstance()->set('user', $_SESSION['user']);
}
parent::handleRequest();
}

View file

@ -11,21 +11,26 @@ 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;
}
@ -35,7 +40,31 @@ switch($build->getStatus())
<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 print $status; ?></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>