2013-05-10 13:28:43 +02:00
< div id = "title" >
2013-05-14 19:28:03 +02:00
< h1 > <?php print $type == 'add' ? 'Add Project' : 'Edit Project' ?> </ h1 >
2013-05-10 13:28:43 +02:00
< / div >
< div class = "row" >
2013-08-01 12:55:10 +02:00
< div class = "col-lg-4" >
2013-05-10 13:28:43 +02:00
< div class = "well" style = "" >
<?php if ( ! is_null ( $key )) : ?>
< p > To make it easier to get started, we've generated a public / private key pair for you to use for this project. To use it, just add the following public key to the "deploy keys" section of your repository settings on Github / Bitbucket.< / p >
2013-05-14 19:28:03 +02:00
< textarea style = "width: 90%; height: 150px;" > <?php print $key ?> </ textarea >
2013-05-10 13:28:43 +02:00
<?php elseif ( $type == 'add' ) : ?>
2013-09-20 23:18:22 +02:00
< p style = "margin-bottom:0;" > Fill in the form to the right to add your new project.< / p >
2013-05-10 13:28:43 +02:00
<?php else : ?>
2013-09-20 23:18:22 +02:00
< p style = "margin-bottom:0;" > Edit your project details using the form to the right.< / p >
2013-05-10 13:28:43 +02:00
<?php endif ; ?>
< / div >
< / div >
2013-08-01 12:55:10 +02:00
< div class = "col-lg-8" >
2013-10-08 08:21:46 +02:00
< div class = "box" >
2013-07-31 22:04:34 +02:00
<?php print $form ; ?>
2013-10-08 08:21:46 +02:00
< / div >
2013-05-10 13:28:43 +02:00
< / div >
2013-05-14 10:00:56 +02:00
< / div >
< script >
2013-05-17 20:17:51 +02:00
window.return_url = <?php print json_encode (( empty ( $_SERVER [ 'HTTPS' ]) ? 'http' : 'https' ) . '://' . $_SERVER [ 'HTTP_HOST' ] . $_SERVER [ 'REQUEST_URI' ]); ?> ;
2013-05-14 17:37:54 +02:00
<?php
2013-07-30 03:55:29 +02:00
$gh = \b8\Config::getInstance()->get('phpci.github', null);
2013-05-14 17:37:54 +02:00
2013-05-16 02:59:27 +02:00
if($gh) {
2013-05-14 17:37:54 +02:00
print 'window.github_app_id = ' . json_encode($gh['id']) . ';' . PHP_EOL;
}
2013-05-16 02:59:27 +02:00
if(!empty($token)) {
2013-05-14 17:37:54 +02:00
print 'window.github_token = ' . json_encode($token) . ';' . PHP_EOL;
}
?>
2013-05-16 02:59:27 +02:00
$(document).ready(setupProjectForm);
2014-01-28 22:27:39 +01:00
< / script >