diff --git a/README.md b/README.md index 92eb535f2..86d5cadc7 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,7 @@ visais reikalingais failais ir įrankiais darbui: - Paprastas pavyzdys (Controller, Template, CSS) - Įdiegtas bootstrap - Asset'ų buildinimas (encore, yarn, sass) -- Travis CI template - +- GitHub actions (CI) pavyzdys # Paleidimo instrukcija diff --git a/assets/css/app.scss b/assets/css/app.scss index f955fad8f..4ab466a99 100644 --- a/assets/css/app.scss +++ b/assets/css/app.scss @@ -1,3 +1,5 @@ +$body-bg: #bec3d1; + // customize some Bootstrap variables $primary: darken(#428bca, 20%); diff --git a/composer.json b/composer.json index 5e4c82c5e..d87e1084c 100644 --- a/composer.json +++ b/composer.json @@ -11,6 +11,7 @@ "symfony/flex": "^1.3.1", "symfony/framework-bundle": "4.3.*", "symfony/orm-pack": "^1.0", + "symfony/profiler-pack": "^1.0", "symfony/twig-pack": "^1.0", "symfony/webpack-encore-bundle": "^1.7", "symfony/yaml": "4.3.*" diff --git a/composer.lock b/composer.lock index 99073b588..4e62f59ed 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "1ef246e2c00d457122ed5e9043e91bac", + "content-hash": "9e974b813bcc2219441d85c06aa41fe6", "packages": [ { "name": "doctrine/annotations", @@ -2995,6 +2995,34 @@ ], "time": "2019-08-06T08:03:45+00:00" }, + { + "name": "symfony/profiler-pack", + "version": "v1.0.4", + "source": { + "type": "git", + "url": "https://github.com/symfony/profiler-pack.git", + "reference": "99c4370632c2a59bb0444852f92140074ef02209" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/profiler-pack/zipball/99c4370632c2a59bb0444852f92140074ef02209", + "reference": "99c4370632c2a59bb0444852f92140074ef02209", + "shasum": "" + }, + "require": { + "php": "^7.0", + "symfony/stopwatch": "*", + "symfony/twig-bundle": "*", + "symfony/web-profiler-bundle": "*" + }, + "type": "symfony-pack", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A pack for the Symfony web profiler", + "time": "2018-12-10T12:11:44+00:00" + }, { "name": "symfony/routing", "version": "v4.3.5", @@ -3442,6 +3470,82 @@ "description": "A Twig pack for Symfony projects", "time": "2019-10-17T05:44:22+00:00" }, + { + "name": "symfony/var-dumper", + "version": "v4.3.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/var-dumper.git", + "reference": "ea4940845535c85ff5c505e13b3205b0076d07bf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/ea4940845535c85ff5c505e13b3205b0076d07bf", + "reference": "ea4940845535c85ff5c505e13b3205b0076d07bf", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php72": "~1.5" + }, + "conflict": { + "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0", + "symfony/console": "<3.4" + }, + "require-dev": { + "ext-iconv": "*", + "symfony/console": "~3.4|~4.0", + "symfony/process": "~3.4|~4.0", + "twig/twig": "~1.34|~2.4" + }, + "suggest": { + "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).", + "ext-intl": "To show region name in time zone dump", + "symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script" + }, + "bin": [ + "Resources/bin/var-dump-server" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.3-dev" + } + }, + "autoload": { + "files": [ + "Resources/functions/dump.php" + ], + "psr-4": { + "Symfony\\Component\\VarDumper\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony mechanism for exploring and dumping PHP variables", + "homepage": "https://symfony.com", + "keywords": [ + "debug", + "dump" + ], + "time": "2019-10-13T12:02:04+00:00" + }, { "name": "symfony/var-exporter", "version": "v4.3.5", @@ -3502,6 +3606,72 @@ ], "time": "2019-08-22T07:33:08+00:00" }, + { + "name": "symfony/web-profiler-bundle", + "version": "v4.3.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/web-profiler-bundle.git", + "reference": "6ce12ffe97d9e26091b0e7340a9d661fba64655e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/web-profiler-bundle/zipball/6ce12ffe97d9e26091b0e7340a9d661fba64655e", + "reference": "6ce12ffe97d9e26091b0e7340a9d661fba64655e", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "symfony/config": "^4.2", + "symfony/http-kernel": "^4.3", + "symfony/routing": "~3.4|~4.0", + "symfony/twig-bundle": "~4.2", + "symfony/var-dumper": "~3.4|~4.0", + "twig/twig": "^1.41|^2.10" + }, + "conflict": { + "symfony/dependency-injection": "<3.4", + "symfony/form": "<4.3", + "symfony/messenger": "<4.2", + "symfony/var-dumper": "<3.4" + }, + "require-dev": { + "symfony/console": "~3.4|~4.0", + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/stopwatch": "~3.4|~4.0" + }, + "type": "symfony-bundle", + "extra": { + "branch-alias": { + "dev-master": "4.3-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Bundle\\WebProfilerBundle\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony WebProfilerBundle", + "homepage": "https://symfony.com", + "time": "2019-10-23T17:52:52+00:00" + }, { "name": "symfony/webpack-encore-bundle", "version": "v1.7.0", diff --git a/config/bundles.php b/config/bundles.php index 7b4814201..00fefb260 100644 --- a/config/bundles.php +++ b/config/bundles.php @@ -9,4 +9,5 @@ Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true], Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true], Symfony\WebpackEncoreBundle\WebpackEncoreBundle::class => ['all' => true], + Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true], ]; diff --git a/config/packages/dev/web_profiler.yaml b/config/packages/dev/web_profiler.yaml new file mode 100644 index 000000000..e92166a7f --- /dev/null +++ b/config/packages/dev/web_profiler.yaml @@ -0,0 +1,6 @@ +web_profiler: + toolbar: true + intercept_redirects: false + +framework: + profiler: { only_exceptions: false } diff --git a/config/packages/test/web_profiler.yaml b/config/packages/test/web_profiler.yaml new file mode 100644 index 000000000..03752de21 --- /dev/null +++ b/config/packages/test/web_profiler.yaml @@ -0,0 +1,6 @@ +web_profiler: + toolbar: false + intercept_redirects: false + +framework: + profiler: { collect: false } diff --git a/config/routes/dev/web_profiler.yaml b/config/routes/dev/web_profiler.yaml new file mode 100644 index 000000000..c82beff2f --- /dev/null +++ b/config/routes/dev/web_profiler.yaml @@ -0,0 +1,7 @@ +web_profiler_wdt: + resource: '@WebProfilerBundle/Resources/config/routing/wdt.xml' + prefix: /_wdt + +web_profiler_profiler: + resource: '@WebProfilerBundle/Resources/config/routing/profiler.xml' + prefix: /_profiler diff --git a/src/Controller/HomeController.php b/src/Controller/HomeController.php index 90484f11f..8fd085b56 100644 --- a/src/Controller/HomeController.php +++ b/src/Controller/HomeController.php @@ -12,8 +12,10 @@ class HomeController extends AbstractController */ public function index() { - return $this->render('home/index.html.twig', [ - 'someVariable' => 'NFQ Akademija', - ]); + $data = file_get_contents('https://hw1.nfq2019.online/students.json'); + $process=json_decode($data, true); + return $this->render('home/index.html.twig', [ + 'process' => $process, + ]); } } diff --git a/src/Controller/StudentController.php b/src/Controller/StudentController.php new file mode 100644 index 000000000..6086a4682 --- /dev/null +++ b/src/Controller/StudentController.php @@ -0,0 +1,26 @@ +get('student'); + + return $this->render('student/index.html.twig', [ + 'HomeController' => $name, + ]); + + } +} diff --git a/src/Controller/TeamController.php b/src/Controller/TeamController.php new file mode 100644 index 000000000..d7e9f5060 --- /dev/null +++ b/src/Controller/TeamController.php @@ -0,0 +1,32 @@ +getProjectDir(); + return $this->render('team/index.html.twig', [ + 'controller_name' => $a, + ]); + } + + public function groupByStudents(array $projects) + { + $data1 = file_get_contents('https://hw1.nfq2019.online/students.json'); + foreach ($projects as $projectName => $project) { + foreach ($project['students'] as $student) { + $data1[] = ['student' => $student, 'project' => $projectName, 'mentors' => $project['mentors']]; + } + } + return $data1; + } +} diff --git a/symfony.lock b/symfony.lock index fe3f6a33e..b4b80f361 100644 --- a/symfony.lock +++ b/symfony.lock @@ -224,6 +224,9 @@ "symfony/polyfill-php73": { "version": "v1.12.0" }, + "symfony/profiler-pack": { + "version": "v1.0.4" + }, "symfony/routing": { "version": "4.2", "recipe": { @@ -268,9 +271,26 @@ "symfony/twig-pack": { "version": "v1.0.0" }, + "symfony/var-dumper": { + "version": "v4.3.8" + }, "symfony/var-exporter": { "version": "v4.3.5" }, + "symfony/web-profiler-bundle": { + "version": "3.3", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "master", + "version": "3.3", + "ref": "6bdfa1a95f6b2e677ab985cd1af2eae35d62e0f6" + }, + "files": [ + "config/packages/dev/web_profiler.yaml", + "config/packages/test/web_profiler.yaml", + "config/routes/dev/web_profiler.yaml" + ] + }, "symfony/webpack-encore-bundle": { "version": "1.0", "recipe": { diff --git a/templates/home/index.html.twig b/templates/home/index.html.twig index b1bd0115c..a916dccce 100644 --- a/templates/home/index.html.twig +++ b/templates/home/index.html.twig @@ -1,7 +1,34 @@ {% extends 'base.html.twig' %} -{% block title %}{{ someVariable }}{% endblock %} +{% block title %}{% endblock %} {% block body %} -
++ {% else %} ++ Gerb, dėstytojau, + atsiprašau, kad vėluoju. Parašykite penkis, prašau. + Pagarbiai, + Karolis Petrikas +
+
Gal pasiseks kitą kartą
+ {% endif %} +src/Controller/TeamController.phptemplates/team/index.html.twig