2014-04-30 15:13:07 +02:00
< h1 >< i class = "glyphicon glyphicon-th-list" ></ i > <?php print htmlspecialchars ( $project -> getTitle ()); ?> </ h1 >
2013-05-10 13:28:43 +02:00
< div class = "row" >
2013-08-01 12:55:10 +02:00
< div class = "col-lg-3" >
2014-04-30 15:13:07 +02:00
< div class = "panel panel-default" >
< div class = "panel-heading" >
< h3 class = "panel-title" > Options< / h3 >
< / div >
< div class = "list-group" >
< a class = "list-group-item" href = " <?php echo PHPCI_URL ?> project/build/ <?php print $project -> getId (); ?> " >< i class = "glyphicon glyphicon-cog" ></ i > Build Now</ a >
<?php if ( $this -> User () -> getIsAdmin ()) : ?>
< a class = "list-group-item" href = " <?php echo PHPCI_URL ?> project/edit/ <?php print $project -> getId (); ?> " >< i class = "glyphicon glyphicon-edit" ></ i > Edit Project</ a >
< a class = "list-group-item" href = "#" id = "delete-project" > < i class = "glyphicon glyphicon-trash" > < / i > Delete Project< / a >
<?php endif ; ?>
< / div >
< / div >
2013-05-10 13:28:43 +02:00
2013-09-19 09:34:51 +02:00
<?php if ( in_array ( $project -> getType (), array ( 'github' , 'gitlab' , 'bitbucket' ))) : ?>
2014-04-30 15:13:07 +02:00
< div class = "panel panel-info" >
< div class = "panel-heading" >
< h4 class = "panel-title" > Webhooks< / h4 >
< / div >
< div class = "panel-body" >
To automatically build this project when new commits are pushed, add the URL below
2013-07-15 22:56:51 +02:00
<?php endif ; ?>
2013-05-10 13:28:43 +02:00
<?php
switch($project->getType())
{
case 'github':
2014-02-24 16:30:44 +01:00
$url = PHPCI_URL . 'webhook/github/' . $project->getId();
2013-05-10 13:28:43 +02:00
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;
2013-09-19 09:46:29 +02:00
case 'gitlab':
2014-02-24 16:30:44 +01:00
$url = PHPCI_URL. 'webhook/gitlab/' . $project->getId();
2013-09-19 09:46:29 +02:00
print ' as a "WebHook URL" in the Web Hooks section of your Gitlab repository.< br > < br > < strong style = "word-wrap: break-word;" > ' . $url . '< / strong > ';
break;
2013-09-19 09:34:51 +02:00
2013-05-10 13:28:43 +02:00
case 'bitbucket':
2014-02-24 16:30:44 +01:00
$url = PHPCI_URL . 'webhook/bitbucket/' . $project->getId();
2013-05-10 13:28:43 +02:00
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;
}
?>
2014-04-30 15:13:07 +02:00
< / div >
< / div >
<?php if ( $project -> getPublicKey ()) : ?>
< div class = "panel panel-default" >
< div class = "panel-heading" > < h3 class = "panel-title" > Public Key< / h3 > < / div >
< div class = "panel-body" > <?php print $project -> getPublicKey (); ?> </ div >
< / div >
<?php endif ; ?>
2013-05-10 13:28:43 +02:00
< / div >
2013-08-01 12:55:10 +02:00
< div class = "col-lg-9" >
2014-04-30 15:13:07 +02:00
< div class = "panel panel-default" >
< div class = "panel-heading" > < h3 class = "panel-title" > Builds< / h3 > < / div >
2013-05-10 13:28:43 +02:00
< table class = "table table-striped table-bordered" >
< thead >
< tr >
< th > ID< / th >
< th > Project< / th >
< th > Commit< / th >
< th > Branch< / th >
< th > Status< / th >
2013-08-01 12:55:10 +02:00
< th style = "width: 100px" > < / th >
2013-05-10 13:28:43 +02:00
< / 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 >
2014-04-30 15:13:07 +02:00
< / div >
<?php
print '< div > < ul class = "pagination" > ';
$pages = ceil($total / 10);
$pages = $pages == 0 ? 1 : $pages;
2013-05-10 13:28:43 +02:00
2014-04-30 15:13:07 +02:00
if ($page > 1) {
print '< li > < a href = "' . PHPCI_URL . 'project/view/'.$project->getId().'?p='.($page == 1 ? '1' : $page - 1).'" > « Prev< / a > < / li > ';
}
2013-05-10 13:28:43 +02:00
2014-04-30 15:13:07 +02:00
for($i = 1; $i < = $pages; $i++)
{
print '< li > < a href = "' . PHPCI_URL . 'project/view/' . $project->getId() . '?p=' . $i . '" > ' . $i . '< / a > < / li > ';
}
2013-05-10 13:28:43 +02:00
2014-04-30 15:13:07 +02:00
if ($page < $pages) {
print '< li > < a href = "' . PHPCI_URL . 'project/view/'.$project->getId().'?p='.($page == $pages ? $pages : $page + 1).'" > Next » < / a > < / li > ';
}
2013-05-10 13:28:43 +02:00
2014-04-30 15:13:07 +02:00
print '< / ul > < / div > ';
2013-05-10 13:28:43 +02:00
2014-04-30 15:13:07 +02:00
?>
2013-05-10 13:28:43 +02:00
< / div >
< / div >
<?php if ( $page == 1 ) : ?>
< script >
2013-07-25 23:48:08 +02:00
setInterval(function()
{
2014-01-28 22:27:39 +01:00
$('#latest-builds').load('<?php echo PHPCI_URL ?> project/builds/<?php print $project -> getId (); ?> ');
2013-07-25 23:48:08 +02:00
}, 10000);
$(function() {
$('#delete-project').on('click', function (e) {
e.preventDefault();
2013-11-27 18:04:24 +01:00
confirmDelete(
2014-01-28 22:27:39 +01:00
"<?php echo PHPCI_URL ?> project/delete/<?php print $project -> getId (); ?> ", "Project"
2013-12-07 16:35:44 +01:00
).onCloseConfirmed = function () {window.location = '/'};
2013-07-25 23:48:08 +02:00
});
})
2013-05-10 13:28:43 +02:00
< / script >
2013-07-15 22:56:51 +02:00
<?php endif ; ?>