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

View file

@ -11,21 +11,26 @@ switch($build->getStatus())
{ {
case 0: case 0:
$cls = 'info'; $cls = 'info';
$subcls = 'info';
$status = 'Pending'; $status = 'Pending';
break; break;
case 1: case 1:
$cls = 'warning'; $cls = 'warning';
$subcls = 'warning';
$status = 'Running'; $status = 'Running';
break; break;
case 2: case 2:
$cls = 'success'; $cls = 'success';
$subcls = 'success';
$status = 'Success'; $status = 'Success';
break; break;
case 3: case 3:
$cls = 'error'; $cls = 'error';
$subcls = 'important';
$status = 'Failed'; $status = 'Failed';
break; 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="<?= 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->getCommitLink(); ?>"><?php print $build->getCommitId(); ?></a></td>
<td><a href="<?php print $build->getBranchLink(); ?>"><?php print $build->getBranch(); ?></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> <td>
<div class="btn-group"> <div class="btn-group">
<a class="btn" href="<?= PHPCI_URL ?>build/view/<?php print $build->getId(); ?>">View</a> <a class="btn" href="<?= PHPCI_URL ?>build/view/<?php print $build->getId(); ?>">View</a>

View file

@ -14,6 +14,20 @@ body
padding: 10px; padding: 10px;
} }
td .label { margin-right: 5px; }
.success-message {
background-color: #4F8A10;
}
.error-message {
background-color: #FF4747;
}
#latest-builds td {
vertical-align: middle;
}
.widget-title, .modal-header, .table th, div.dataTables_wrapper .ui-widget-header, .ui-dialog .ui-dialog-titlebar { .widget-title, .modal-header, .table th, div.dataTables_wrapper .ui-widget-header, .ui-dialog .ui-dialog-titlebar {
background-color: #efefef; background-color: #efefef;
background-image: -webkit-gradient(linear, 0 0%, 0 100%, from(#fdfdfd), to(#eaeaea)); background-image: -webkit-gradient(linear, 0 0%, 0 100%, from(#fdfdfd), to(#eaeaea));
@ -61,7 +75,7 @@ body
background: url('/assets/img/icon-build-running.png') no-repeat top left; background: url('/assets/img/icon-build-running.png') no-repeat top left;
} }
h3 h3
{ {
border-bottom: 1px solid #f0f0f0; border-bottom: 1px solid #f0f0f0;
margin-top: 0; margin-top: 0;