Refactoring to support updated b8framework.
This commit is contained in:
parent
aff5b1886e
commit
67386df9ef
20 changed files with 140 additions and 79 deletions
86
PHPCI/View/Project/view.phtml
Normal file
86
PHPCI/View/Project/view.phtml
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
<div id="title">
|
||||
<h1>Project: <?php print $project->getTitle(); ?></h1>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="span3">
|
||||
<div class="well" style="padding: 8px 0">
|
||||
<ul class="nav nav-list">
|
||||
<li><a href="<?= PHPCI_URL ?>"><i class="icon-home"></i> Dashboard</a></li>
|
||||
<li><a href="<?= PHPCI_URL ?>project/view/<?php print $project->getId(); ?>"><i class="icon-folder-open"></i> <?php print $project->getTitle(); ?></a></li>
|
||||
<li class="divider"></li>
|
||||
<li class="nav-header">Options</li>
|
||||
<li><a href="<?= PHPCI_URL ?>project/build/<?php print $project->getId(); ?>"><i class="icon-cog"></i> Build Now</a></li>
|
||||
|
||||
<?php if($this->User()->getIsAdmin()): ?>
|
||||
<li><a href="<?= PHPCI_URL ?>project/edit/<?php print $project->getId(); ?>"><i class="icon-edit"></i> Edit Project</a></li>
|
||||
<li><a href="javascript:confirmDelete('<?= PHPCI_URL ?>project/delete/<?php print $project->getId(); ?>')"><i class="icon-trash"></i> Delete Project</a></li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
<p class="alert alert-info">To automatically build this project when new commits are pushed, add the URL below
|
||||
|
||||
<?php
|
||||
switch($project->getType())
|
||||
{
|
||||
case 'github':
|
||||
$url = (empty($_SERVER['HTTPS']) ? 'http' : 'https') . '://' . $_SERVER['HTTP_HOST'] . '/github/webhook/' . $project->getId();
|
||||
print ' as a "WebHook URL" in the <a href="https://github.com/' . $project->getReference() . '/settings/hooks">Service Hooks</a> section of your Github repository.<br><br><strong style="word-wrap: break-word;">' . $url . '</strong>';
|
||||
break;
|
||||
|
||||
case 'bitbucket':
|
||||
$url = (empty($_SERVER['HTTPS']) ? 'http' : 'https') . '://' . $_SERVER['HTTP_HOST'] . '/bitbucket/webhook/' . $project->getId();
|
||||
print ' as a "POST" service in the <a href="https://bitbucket.org/' . $project->getReference() . '/admin/services">Services</a> section of your Bitbucket repository.<br><br><strong style="word-wrap: break-word;">' . $url . '</strong>';
|
||||
break;
|
||||
}
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
<div class="span9">
|
||||
<table class="table table-striped table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Project</th>
|
||||
<th>Commit</th>
|
||||
<th>Branch</th>
|
||||
<th>Status</th>
|
||||
<th style="width: 1%"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="latest-builds">
|
||||
<?php print $builds; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
|
||||
print '<div class="pagination"><ul>';
|
||||
$pages = ceil($total / 10);
|
||||
$pages = $pages == 0 ? 1 : $pages;
|
||||
|
||||
print '<li class="'.($page == 1 ? 'disabled' : '').'"><a href="<?= PHPCI_URL ?>project/view/'.$project->getId().'?p='.($page == 1 ? '1' : $page - 1).'">«</a></li>';
|
||||
|
||||
for($i = 1; $i <= $pages; $i++)
|
||||
{
|
||||
print '<li><a href="<?= PHPCI_URL ?>project/view/' . $project->getId() . '?p=' . $i . '">' . $i . '</a></li>';
|
||||
}
|
||||
|
||||
print '<li class="'.($page == $pages ? 'disabled' : '').'"><a href="<?= PHPCI_URL ?>project/view/'.$project->getId().'?p='.($page == $pages ? $pages : $page + 1).'">»</a></li>';
|
||||
|
||||
print '</ul></div>';
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if($page == 1): ?>
|
||||
<script>
|
||||
setInterval(function()
|
||||
{
|
||||
$('#latest-builds').load('<?= PHPCI_URL ?>project/builds/<?php print $project->getId(); ?>');
|
||||
}, 10000);
|
||||
</script>
|
||||
<?php endif; ?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue