php-censor/PHPCI/View/ProjectForm.phtml

43 lines
1.3 KiB
PHTML
Raw Normal View History

2013-05-10 13:28:43 +02:00
<div id="title">
<h1><?php print $type == 'add' ? 'Add Project' : 'Edit Project' ?></h1>
2013-05-10 13:28:43 +02:00
</div>
<div class="row">
<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>
<textarea style="width: 90%; height: 150px;"><?php print $key ?></textarea>
2013-05-10 13:28:43 +02:00
<?php elseif($type == 'add'): ?>
<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: ?>
<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>
<div class="col-lg-8">
<div class="box">
<?php print $form; ?>
</div>
2013-05-10 13:28:43 +02:00
</div>
</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
if($gh) {
2013-05-14 17:37:54 +02:00
print 'window.github_app_id = ' . json_encode($gh['id']) . ';' . PHP_EOL;
}
if(!empty($token)) {
2013-05-14 17:37:54 +02:00
print 'window.github_token = ' . json_encode($token) . ';' . PHP_EOL;
}
?>
$(document).ready(setupProjectForm);
2014-01-28 22:27:39 +01:00
</script>