Added highlighting for build config + updated dependencies

This commit is contained in:
Dmitry Khomutov 2017-02-10 23:14:07 +07:00
parent efb9cacb02
commit 91a8054fdd
No known key found for this signature in database
GPG key ID: 7EB36C9576F9ECB9
5 changed files with 78 additions and 39 deletions

View file

@ -56,8 +56,9 @@
"mnsami/composer-custom-directory-installer": "1.1.*", "mnsami/composer-custom-directory-installer": "1.1.*",
"bower-asset/admin-lte": "2.3.*",
"npm-asset/sprintf-js": "1.0.*", "npm-asset/sprintf-js": "1.0.*",
"npm-asset/codemirror": "5.*",
"bower-asset/admin-lte": "2.3.*",
"bower-asset/font-awesome": "4.7.*", "bower-asset/font-awesome": "4.7.*",
"bower-asset/ionicons": "2.0.*", "bower-asset/ionicons": "2.0.*",
"bower-asset/raphael": "2.2.*", "bower-asset/raphael": "2.2.*",
@ -74,8 +75,9 @@
}, },
"extra": { "extra": {
"installer-paths": { "installer-paths": {
"public/assets/vendor/admin-lte": ["bower-asset/admin-lte"],
"public/assets/vendor/sprintf-js": ["npm-asset/sprintf-js"], "public/assets/vendor/sprintf-js": ["npm-asset/sprintf-js"],
"public/assets/vendor/codemirror": ["npm-asset/codemirror"],
"public/assets/vendor/admin-lte": ["bower-asset/admin-lte"],
"public/assets/vendor/font-awesome": ["bower-asset/font-awesome"], "public/assets/vendor/font-awesome": ["bower-asset/font-awesome"],
"public/assets/vendor/ion-icons": ["bower-asset/ionicons"], "public/assets/vendor/ion-icons": ["bower-asset/ionicons"],
"public/assets/vendor/raphael": ["bower-asset/raphael"], "public/assets/vendor/raphael": ["bower-asset/raphael"],

67
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "147a1f73282f1c309c8f85a4e9d3bbac", "content-hash": "1b1acb29244fbd9f29469af58ae07d1c",
"packages": [ "packages": [
{ {
"name": "bower-asset/admin-lte", "name": "bower-asset/admin-lte",
@ -235,6 +235,17 @@
], ],
"time": "2016-11-26T00:15:39+00:00" "time": "2016-11-26T00:15:39+00:00"
}, },
{
"name": "npm-asset/codemirror",
"version": "5.23.0.0",
"dist": {
"type": "tar",
"url": "https://registry.npmjs.org/codemirror/-/codemirror-5.23.0.tgz",
"reference": null,
"shasum": null
},
"type": "library"
},
{ {
"name": "npm-asset/sprintf-js", "name": "npm-asset/sprintf-js",
"version": "1.0.3.0", "version": "1.0.3.0",
@ -555,16 +566,16 @@
}, },
{ {
"name": "symfony/config", "name": "symfony/config",
"version": "v3.2.2", "version": "v3.2.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/config.git", "url": "https://github.com/symfony/config.git",
"reference": "c5ea878b5a7f6a01b9a2f182f905831711b9ff3f" "reference": "2ffa7b84d647b8be1788d46b44e438cb3d62056c"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/config/zipball/c5ea878b5a7f6a01b9a2f182f905831711b9ff3f", "url": "https://api.github.com/repos/symfony/config/zipball/2ffa7b84d647b8be1788d46b44e438cb3d62056c",
"reference": "c5ea878b5a7f6a01b9a2f182f905831711b9ff3f", "reference": "2ffa7b84d647b8be1788d46b44e438cb3d62056c",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -607,20 +618,20 @@
], ],
"description": "Symfony Config Component", "description": "Symfony Config Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2017-01-02T20:32:22+00:00" "time": "2017-02-06T12:04:21+00:00"
}, },
{ {
"name": "symfony/console", "name": "symfony/console",
"version": "v2.8.16", "version": "v2.8.17",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/console.git", "url": "https://github.com/symfony/console.git",
"reference": "2e18b8903d9c498ba02e1dfa73f64d4894bb6912" "reference": "f3c234cd8db9f7e520a91d695db7d8bb5daeb7a4"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/2e18b8903d9c498ba02e1dfa73f64d4894bb6912", "url": "https://api.github.com/repos/symfony/console/zipball/f3c234cd8db9f7e520a91d695db7d8bb5daeb7a4",
"reference": "2e18b8903d9c498ba02e1dfa73f64d4894bb6912", "reference": "f3c234cd8db9f7e520a91d695db7d8bb5daeb7a4",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -668,7 +679,7 @@
], ],
"description": "Symfony Console Component", "description": "Symfony Console Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2017-01-08T20:43:03+00:00" "time": "2017-02-06T12:04:06+00:00"
}, },
{ {
"name": "symfony/debug", "name": "symfony/debug",
@ -729,7 +740,7 @@
}, },
{ {
"name": "symfony/filesystem", "name": "symfony/filesystem",
"version": "v3.2.2", "version": "v3.2.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/filesystem.git", "url": "https://github.com/symfony/filesystem.git",
@ -837,16 +848,16 @@
}, },
{ {
"name": "symfony/yaml", "name": "symfony/yaml",
"version": "v2.8.16", "version": "v2.8.17",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/yaml.git", "url": "https://github.com/symfony/yaml.git",
"reference": "dbe61fed9cd4a44c5b1d14e5e7b1a8640cfb2bf2" "reference": "322a8c2dfbca15ad6b1b27e182899f98ec0e0153"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/dbe61fed9cd4a44c5b1d14e5e7b1a8640cfb2bf2", "url": "https://api.github.com/repos/symfony/yaml/zipball/322a8c2dfbca15ad6b1b27e182899f98ec0e0153",
"reference": "dbe61fed9cd4a44c5b1d14e5e7b1a8640cfb2bf2", "reference": "322a8c2dfbca15ad6b1b27e182899f98ec0e0153",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -882,7 +893,7 @@
], ],
"description": "Symfony Yaml Component", "description": "Symfony Yaml Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2017-01-03T13:49:52+00:00" "time": "2017-01-21T16:40:50+00:00"
} }
], ],
"packages-dev": [ "packages-dev": [
@ -1695,16 +1706,16 @@
}, },
{ {
"name": "phpunit/phpunit", "name": "phpunit/phpunit",
"version": "5.7.10", "version": "5.7.13",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git", "url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "bf0804199f516fe80ffcc48ac6d4741c49baeb6e" "reference": "60ebeed87a35ea46fd7f7d8029df2d6f013ebb34"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/bf0804199f516fe80ffcc48ac6d4741c49baeb6e", "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/60ebeed87a35ea46fd7f7d8029df2d6f013ebb34",
"reference": "bf0804199f516fe80ffcc48ac6d4741c49baeb6e", "reference": "60ebeed87a35ea46fd7f7d8029df2d6f013ebb34",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1773,7 +1784,7 @@
"testing", "testing",
"xunit" "xunit"
], ],
"time": "2017-02-04T09:03:53+00:00" "time": "2017-02-10T09:05:10+00:00"
}, },
{ {
"name": "phpunit/phpunit-mock-objects", "name": "phpunit/phpunit-mock-objects",
@ -2153,16 +2164,16 @@
}, },
{ {
"name": "sebastian/git", "name": "sebastian/git",
"version": "2.1.3", "version": "2.1.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/git.git", "url": "https://github.com/sebastianbergmann/git.git",
"reference": "5100bc50cd9e70f424c643618e142214225024f3" "reference": "815bbbc963cf35e5413df195aa29df58243ecd24"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/git/zipball/5100bc50cd9e70f424c643618e142214225024f3", "url": "https://api.github.com/repos/sebastianbergmann/git/zipball/815bbbc963cf35e5413df195aa29df58243ecd24",
"reference": "5100bc50cd9e70f424c643618e142214225024f3", "reference": "815bbbc963cf35e5413df195aa29df58243ecd24",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2194,7 +2205,7 @@
"keywords": [ "keywords": [
"git" "git"
], ],
"time": "2016-06-15T09:30:19+00:00" "time": "2017-01-23T20:57:12+00:00"
}, },
{ {
"name": "sebastian/global-state", "name": "sebastian/global-state",
@ -2622,7 +2633,7 @@
}, },
{ {
"name": "symfony/finder", "name": "symfony/finder",
"version": "v3.2.2", "version": "v3.2.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/finder.git", "url": "https://github.com/symfony/finder.git",

View file

@ -571,3 +571,15 @@ h6,
.btn-group-right { .btn-group-right {
float: right; float: right;
} }
.CodeMirror {
border: 1px solid #ccc;
}
.CodeMirror pre {
font-size: 12px !important;
}
.CodeMirror-linenumber {
font-size: 12px;
}

View file

@ -8,17 +8,19 @@ namespace PHPCensor\Model\Build;
class GogsBuild extends RemoteGitBuild class GogsBuild extends RemoteGitBuild
{ {
/** /**
* Get link to commit from Gogs repositorie * Get link to commit from Gogs repository
*/ */
public function getCommitLink() public function getCommitLink()
{ {
if ($this->getCommitId() !== 'manual'){ if ($this->getCommitId() !== 'manual'){
return $this->getProject()->getReference() . '/commit/' . $this->getCommitId(); return $this->getProject()->getReference() . '/commit/' . $this->getCommitId();
} }
return parent::getCommitLink();
} }
/** /**
* Get link to branch from Gogs repositorie * Get link to branch from Gogs repository
*/ */
public function getBranchLink() public function getBranchLink()
{ {

View file

@ -1,3 +1,18 @@
<script src="<?= APP_URL; ?>assets/vendor/codemirror/lib/codemirror.js"></script>
<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
});
});
</script>
<?php use PHPCensor\Helper\Lang; ?> <?php use PHPCensor\Helper\Lang; ?>
<div class="row"> <div class="row">
@ -17,9 +32,8 @@
<div class="col-sm-4"> <div class="col-sm-4">
<div class="box"> <div class="box">
<div class="box-body"> <div class="box-body">
<p><?php Lang::out('public_key_help'); ?></p> <p><?php Lang::out('public_key_help'); ?></p>
<textarea style="width: 90%; height: 150px;"><?php print $key ?></textarea>
<textarea style="width: 90%; height: 150px;"><?php print $key ?></textarea>
</div> </div>
</div> </div>
</div> </div>
@ -34,13 +48,11 @@ window.return_url = <?php print json_encode((empty($_SERVER['HTTPS']) ? 'http' :
$gh = \b8\Config::getInstance()->get('php-censor.github', null); $gh = \b8\Config::getInstance()->get('php-censor.github', null);
if($gh) { if($gh) {
print 'window.github_app_id = ' . json_encode($gh['id']) . ';' . PHP_EOL; print 'window.github_app_id = ' . json_encode($gh['id']) . ';' . PHP_EOL;
} }
if(!empty($token)) { if(!empty($token)) {
print 'window.github_token = ' . json_encode($token) . ';' . PHP_EOL; print 'window.github_token = ' . json_encode($token) . ';' . PHP_EOL;
} }
?> ?>
$(document).ready(setupProjectForm);
</script> </script>