2013-05-10 13:28:43 +02:00
< div id = "title" >
2013-05-14 19:28:03 +02:00
< h1 > Project: <?php print $project -> getTitle (); ?> </ h1 >
2013-05-10 13:28:43 +02:00
< / div >
< div class = "row" >
< div class = "span3" >
< div class = "well" style = "padding: 8px 0" >
< ul class = "nav nav-list" >
2013-05-17 18:34:31 +02:00
< 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 >
2013-05-10 13:28:43 +02:00
< li class = "divider" > < / li >
< li class = "nav-header" > Options< / li >
2013-05-17 18:34:31 +02:00
< li >< a href = " <? = PHPCI_URL ?> project/build/ <?php print $project -> getId (); ?> " >< i class = "icon-cog" ></ i > Build Now</ a ></ li >
2013-05-10 13:28:43 +02:00
2013-05-10 17:25:51 +02:00
<?php if ( $this -> User () -> getIsAdmin ()) : ?>
2013-05-17 18:34:31 +02:00
< li >< a href = " <? = PHPCI_URL ?> project/edit/ <?php print $project -> getId (); ?> " >< i class = "icon-edit" ></ i > Edit Project</ a ></ li >
2013-07-25 23:48:08 +02:00
< li > < a href = "#" id = "delete-project" > < i class = "icon-trash" > < / i > Delete Project< / a > < / li >
2013-05-10 17:25:51 +02:00
<?php endif ; ?>
2013-05-10 13:28:43 +02:00
< / ul >
< / div >
2013-07-15 22:56:51 +02:00
<?php if ( in_array ( $project -> getType (), array ( 'github' , 'bitbucket' ))) : ?>
< br >
< p class = "alert alert-info" > To automatically build this project when new commits are pushed, add the URL below
<?php endif ; ?>
2013-05-10 13:28:43 +02:00
<?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" >
2013-05-14 19:28:03 +02:00
<?php print $builds ; ?>
2013-05-10 13:28:43 +02:00
< / tbody >
< / table >
<?php
print '< div class = "pagination" > < ul > ';
$pages = ceil($total / 10);
$pages = $pages == 0 ? 1 : $pages;
2013-06-05 15:55:52 +02:00
print '< li class = "'.($page == 1 ? 'disabled' : '').'" > < a href = "' . PHPCI_URL . 'project/view/'.$project->getId().'?p='.($page == 1 ? '1' : $page - 1).'" > « < / a > < / li > ';
2013-05-10 13:28:43 +02:00
for($i = 1; $i < = $pages; $i++)
{
2013-06-05 15:55:52 +02:00
print '< li > < a href = "' . PHPCI_URL . 'project/view/' . $project->getId() . '?p=' . $i . '" > ' . $i . '< / a > < / li > ';
2013-05-10 13:28:43 +02:00
}
2013-06-05 15:55:52 +02:00
print '< li class = "'.($page == $pages ? 'disabled' : '').'" > < a href = "' . PHPCI_URL . 'project/view/'.$project->getId().'?p='.($page == $pages ? $pages : $page + 1).'" > » < / a > < / li > ';
2013-05-10 13:28:43 +02:00
print '< / ul > < / div > ';
?>
< / div >
< / div >
<?php if ( $page == 1 ) : ?>
< script >
2013-07-25 23:48:08 +02:00
setInterval(function()
{
$('#latest-builds').load('<? = PHPCI_URL ?> project/builds/<?php print $project -> getId (); ?> ');
}, 10000);
$(function() {
$('#delete-project').on('click', function (e) {
e.preventDefault();
confirmDelete("<? = PHPCI_URL ?> project/delete/<?php print $project -> getId (); ?> ");
});
})
2013-05-10 13:28:43 +02:00
< / script >
2013-07-15 22:56:51 +02:00
<?php endif ; ?>