Fixed 'add/edit project' page. Issue #21

This commit is contained in:
Dmitry Khomutov 2017-02-15 20:16:40 +07:00
parent 8d7087554f
commit a12407d02f
No known key found for this signature in database
GPG key ID: 7EB36C9576F9ECB9
2 changed files with 4 additions and 18 deletions

View file

@ -251,6 +251,7 @@ class ProjectController extends PHPCensor\Controller
$response = new b8\Http\Response\RedirectResponse();
$response->setHeader('Location', APP_URL.'project/view/' . $project->getId());
return $response;
}
}
@ -316,6 +317,7 @@ class ProjectController extends PHPCensor\Controller
$response = new b8\Http\Response\RedirectResponse();
$response->setHeader('Location', APP_URL.'project/view/' . $project->getId());
return $response;
}

View file

@ -2,14 +2,14 @@
<script src="<?= APP_URL; ?>assets/vendor/codemirror/mode/yaml/yaml.js"></script>
<link href="<?= APP_URL; ?>assets/vendor/codemirror/lib/codemirror.css" rel="stylesheet" type="text/css" />
<script>
setupProjectForm();
$(document).ready(function () {
CodeMirror.fromTextArea(document.getElementById('element-build_config'), {
mode: "yaml",
lineWrapping: true,
lineNumbers: true
});
setupProjectForm();
});
</script>
@ -40,19 +40,3 @@
<?php endif; ?>
</div>
<script>
window.return_url = <?php print json_encode((empty($_SERVER['HTTPS']) ? 'http' : 'https') . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); ?>;
<?php
$gh = \b8\Config::getInstance()->get('php-censor.github', null);
if($gh) {
print 'window.github_app_id = ' . json_encode($gh['id']) . ';' . PHP_EOL;
}
if(!empty($token)) {
print 'window.github_token = ' . json_encode($token) . ';' . PHP_EOL;
}
?>
</script>