Merge pull request #842 from corpsee/feature-ui-improvements

UI improvements
This commit is contained in:
Marco Vito Moscaritolo 2015-03-25 12:51:10 +01:00
commit 800f0539af
15 changed files with 31 additions and 9 deletions

View file

@ -98,12 +98,22 @@ class HomeController extends \PHPCI\Controller
protected function getSummaryHtml($projects) protected function getSummaryHtml($projects)
{ {
$summaryBuilds = array(); $summaryBuilds = array();
$successes = array(); $successes = array();
$failures = array(); $failures = array();
$counts = array();
foreach ($projects['items'] as $project) { foreach ($projects['items'] as $project) {
$summaryBuilds[$project->getId()] = $this->buildStore->getLatestBuilds($project->getId()); $summaryBuilds[$project->getId()] = $this->buildStore->getLatestBuilds($project->getId());
$count = $this->buildStore->getWhere(
array('project_id' => $project->getId()),
1,
0,
array(),
array('id' => 'DESC')
);
$counts[$project->getId()] = $count['count'];
$success = $this->buildStore->getLastBuildByStatus($project->getId(), Build::STATUS_SUCCESS); $success = $this->buildStore->getLastBuildByStatus($project->getId(), Build::STATUS_SUCCESS);
$failure = $this->buildStore->getLastBuildByStatus($project->getId(), Build::STATUS_FAILED); $failure = $this->buildStore->getLastBuildByStatus($project->getId(), Build::STATUS_FAILED);
@ -112,10 +122,11 @@ class HomeController extends \PHPCI\Controller
} }
$summaryView = new b8\View('SummaryTable'); $summaryView = new b8\View('SummaryTable');
$summaryView->projects = $projects['items']; $summaryView->projects = $projects['items'];
$summaryView->builds = $summaryBuilds; $summaryView->builds = $summaryBuilds;
$summaryView->successful = $successes; $summaryView->successful = $successes;
$summaryView->failed = $failures; $summaryView->failed = $failures;
$summaryView->counts = $counts;
return $summaryView->render(); return $summaryView->render();
} }

View file

@ -86,7 +86,7 @@ class ProjectController extends PHPCI\Controller
$this->view->builds = $builds[0]; $this->view->builds = $builds[0];
$this->view->total = $builds[1]; $this->view->total = $builds[1];
$this->view->project = $project; $this->view->project = $project;
$this->view->branch = urldecode($branch); $this->view->branch = urldecode($branch);
$this->view->branches = $this->projectStore->getKnownBranches($projectId); $this->view->branches = $this->projectStore->getKnownBranches($projectId);
$this->view->page = $page; $this->view->page = $page;
$this->view->pages = $pages; $this->view->pages = $pages;

View file

@ -126,6 +126,7 @@ i din foretrukne hosting-platform.',
'all_branches' => 'Alle branches', 'all_branches' => 'Alle branches',
'builds' => 'Builds', 'builds' => 'Builds',
'id' => 'ID', 'id' => 'ID',
'date' => 'Date',
'project' => 'Projekt', 'project' => 'Projekt',
'commit' => 'Commit', 'commit' => 'Commit',
'branch' => 'Branch', 'branch' => 'Branch',

View file

@ -127,6 +127,7 @@ generiert. Um es zu verwenden, fügen Sie einfach den folgenden Public Key im Ab
'all_branches' => 'Alle Branches', 'all_branches' => 'Alle Branches',
'builds' => 'Builds', 'builds' => 'Builds',
'id' => 'ID', 'id' => 'ID',
'date' => 'Date',
'project' => 'Projekt', 'project' => 'Projekt',
'commit' => 'Commit', 'commit' => 'Commit',
'branch' => 'Branch', 'branch' => 'Branch',

View file

@ -127,6 +127,7 @@ PHPCI',
'all_branches' => 'Όλες οι διακλαδώσεις', 'all_branches' => 'Όλες οι διακλαδώσεις',
'builds' => 'Κατασκευές', 'builds' => 'Κατασκευές',
'id' => 'Αριθμός αναγνώρισης', 'id' => 'Αριθμός αναγνώρισης',
'date' => 'Date',
'project' => 'Έργο', 'project' => 'Έργο',
'commit' => 'Συνεισφορά', 'commit' => 'Συνεισφορά',
'branch' => 'Διακλάδωση', 'branch' => 'Διακλάδωση',

View file

@ -128,6 +128,7 @@ PHPCI',
'all_branches' => 'All Branches', 'all_branches' => 'All Branches',
'builds' => 'Builds', 'builds' => 'Builds',
'id' => 'ID', 'id' => 'ID',
'date' => 'Date',
'project' => 'Project', 'project' => 'Project',
'commit' => 'Commit', 'commit' => 'Commit',
'branch' => 'Branch', 'branch' => 'Branch',

View file

@ -127,6 +127,7 @@ PHPCI',
'all_branches' => 'Toutes les branches', 'all_branches' => 'Toutes les branches',
'builds' => 'Builds', 'builds' => 'Builds',
'id' => 'ID', 'id' => 'ID',
'date' => 'Date',
'project' => 'Projet', 'project' => 'Projet',
'commit' => 'Commit', 'commit' => 'Commit',
'branch' => 'Branche', 'branch' => 'Branche',

View file

@ -127,6 +127,7 @@ PHPCI',
'all_branches' => 'Tutti i Branche', 'all_branches' => 'Tutti i Branche',
'builds' => 'Builds', 'builds' => 'Builds',
'id' => 'ID', 'id' => 'ID',
'date' => 'Data',
'project' => 'Progetto', 'project' => 'Progetto',
'commit' => 'Commit', 'commit' => 'Commit',
'branch' => 'Branch', 'branch' => 'Branch',

View file

@ -127,6 +127,7 @@ van je gekozen source code hosting platform',
'all_branches' => 'Alle brances', 'all_branches' => 'Alle brances',
'builds' => 'Builds', 'builds' => 'Builds',
'id' => 'ID', 'id' => 'ID',
'date' => 'Datum',
'project' => 'Project', 'project' => 'Project',
'commit' => 'Commit', 'commit' => 'Commit',
'branch' => 'Branch', 'branch' => 'Branch',

View file

@ -128,6 +128,7 @@ od wybranego kodu źródłowego platformy hostingowej.',
'all_branches' => 'Wszystkie Gałęzie', 'all_branches' => 'Wszystkie Gałęzie',
'builds' => 'Budowania', 'builds' => 'Budowania',
'id' => 'ID', 'id' => 'ID',
'date' => 'Date',
'project' => 'Projekt', 'project' => 'Projekt',
'commit' => 'Commit', 'commit' => 'Commit',
'branch' => 'Gałąź', 'branch' => 'Gałąź',

View file

@ -126,6 +126,7 @@ PHPCI',
'all_branches' => 'Все ветки', 'all_branches' => 'Все ветки',
'builds' => 'Сборки', 'builds' => 'Сборки',
'id' => 'ID', 'id' => 'ID',
'date' => 'Дата',
'project' => 'Проект', 'project' => 'Проект',
'commit' => 'Коммит', 'commit' => 'Коммит',
'branch' => 'Ветка', 'branch' => 'Ветка',

View file

@ -126,6 +126,7 @@ PHPCI',
'all_branches' => 'Усі гілки', 'all_branches' => 'Усі гілки',
'builds' => 'Збірки', 'builds' => 'Збірки',
'id' => 'ID', 'id' => 'ID',
'date' => 'Дата',
'project' => 'Проект', 'project' => 'Проект',
'commit' => 'Комміт', 'commit' => 'Комміт',
'branch' => 'Гілка', 'branch' => 'Гілка',

View file

@ -39,6 +39,7 @@ switch($build->getStatus())
?> ?>
<tr class="<?php print $cls; ?>"> <tr class="<?php print $cls; ?>">
<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 ?>build/view/<?php print $build->getId(); ?>">#<?php print str_pad($build->getId(), 6, '0', STR_PAD_LEFT); ?></a></td>
<td><?php print $build->getCreated()->format('Y-m-d H:i:s'); ?></td>
<td><a href="<?php echo PHPCI_URL ?>project/view/<?php print $build->getProjectId(); ?>"> <td><a href="<?php echo PHPCI_URL ?>project/view/<?php print $build->getProjectId(); ?>">
<?php <?php
if (is_object($build->getProject())) { if (is_object($build->getProject())) {

View file

@ -36,13 +36,13 @@
<div class="col-lg-9 col-md-8 col-sm-8"> <div class="col-lg-9 col-md-8 col-sm-8">
<div class="box box-primary"> <div class="box box-primary">
<div class="box-header"> <div class="box-header">
<h3 class="box-title"><?php Lang::out('builds'); ?> (<?php print $total; ?>)</h3>
<h3 class="box-title"><?php Lang::out('builds'); ?></h3>
</div> </div>
<table class="table"> <table class="table">
<thead> <thead>
<tr> <tr>
<th><?php Lang::out('id'); ?></th> <th><?php Lang::out('id'); ?></th>
<th><?php Lang::out('date'); ?></th>
<th><?php Lang::out('project'); ?></th> <th><?php Lang::out('project'); ?></th>
<th class="hidden-md hidden-sm hidden-xs"><?php Lang::out('commit'); ?></th> <th class="hidden-md hidden-sm hidden-xs"><?php Lang::out('commit'); ?></th>
<th><?php Lang::out('branch'); ?></th> <th><?php Lang::out('branch'); ?></th>

View file

@ -123,7 +123,7 @@ foreach($projects as $project):
<i class="fa fa-<?php print $project->getIcon(); ?>"></i> <i class="fa fa-<?php print $project->getIcon(); ?>"></i>
</div> </div>
<a href="<?php print PHPCI_URL; ?>project/view/<?php print $project->getId(); ?>" class="small-box-footer small-box-footer-project"> <a href="<?php print PHPCI_URL; ?>project/view/<?php print $project->getId(); ?>" class="small-box-footer small-box-footer-project">
<?php Lang::out('view_project'); ?> <i class="fa fa-arrow-circle-right"></i> <?php Lang::out('view_project'); ?> (<?php print $counts[$project->getId()]; ?>) <i class="fa fa-arrow-circle-right"></i>
</a> </a>
<?php endif; ?> <?php endif; ?>