From f56c6ae3899fc9201a1ee520fa7fe939679fd831 Mon Sep 17 00:00:00 2001 From: Aurelijus Banelis Date: Sun, 10 Nov 2019 20:30:53 +0200 Subject: [PATCH 01/14] Fix documentation: GitHub actions instead of TravisCI --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 From 192ddd3d84cba2bd8e060bd7834ba6287b45f2cc Mon Sep 17 00:00:00 2001 From: Vytas Gavelis Date: Fri, 15 Nov 2019 20:02:18 +0200 Subject: [PATCH 02/14] almost finished --- assets/css/app.scss | 2 + composer.json | 3 +- composer.lock | 78 ++++++++++++++++++++++++++++++- src/Controller/HomeController.php | 19 -------- symfony.lock | 3 ++ templates/base.html.twig | 5 -- templates/home/index.html.twig | 17 +++++-- 7 files changed, 98 insertions(+), 29 deletions(-) delete mode 100644 src/Controller/HomeController.php diff --git a/assets/css/app.scss b/assets/css/app.scss index f955fad8f..8f8cae4cf 100644 --- a/assets/css/app.scss +++ b/assets/css/app.scss @@ -1,3 +1,5 @@ +$body-bg: #fd7e14; + // customize some Bootstrap variables $primary: darken(#428bca, 20%); diff --git a/composer.json b/composer.json index 5e4c82c5e..ee37965ce 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,8 @@ }, "require-dev": { "squizlabs/php_codesniffer": "^3.5", - "symfony/maker-bundle": "^1.13" + "symfony/maker-bundle": "^1.13", + "symfony/var-dumper": "4.3.*" }, "config": { "preferred-install": { diff --git a/composer.lock b/composer.lock index 99073b588..bc0075063 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": "d925f5a50b322fe9bc2ff1eef8793a90", "packages": [ { "name": "doctrine/annotations", @@ -4019,6 +4019,82 @@ "scaffolding" ], "time": "2019-10-18T01:41:52+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" } ], "aliases": [], diff --git a/src/Controller/HomeController.php b/src/Controller/HomeController.php deleted file mode 100644 index 90484f11f..000000000 --- a/src/Controller/HomeController.php +++ /dev/null @@ -1,19 +0,0 @@ -render('home/index.html.twig', [ - 'someVariable' => 'NFQ Akademija', - ]); - } -} diff --git a/symfony.lock b/symfony.lock index fe3f6a33e..f68de02d3 100644 --- a/symfony.lock +++ b/symfony.lock @@ -268,6 +268,9 @@ "symfony/twig-pack": { "version": "v1.0.0" }, + "symfony/var-dumper": { + "version": "v4.3.8" + }, "symfony/var-exporter": { "version": "v4.3.5" }, diff --git a/templates/base.html.twig b/templates/base.html.twig index e06313d52..0f49cdb00 100644 --- a/templates/base.html.twig +++ b/templates/base.html.twig @@ -9,10 +9,5 @@ {{ encore_entry_link_tags('app') }} {% endblock %} - {% block body %}{% endblock %} - {% block javascripts %} - {{ encore_entry_script_tags('app') }} - {% endblock %} - diff --git a/templates/home/index.html.twig b/templates/home/index.html.twig index b1bd0115c..1841cee9d 100644 --- a/templates/home/index.html.twig +++ b/templates/home/index.html.twig @@ -1,7 +1,18 @@ {% extends 'base.html.twig' %} -{% block title %}{{ someVariable }}{% endblock %} +{% block title %}Homework{% endblock %} {% block body %} -
{{ someVariable }}
-{% endblock %} + +{% endblock %} \ No newline at end of file From 9cee23946d316d941eee01bf2de455e179c84209 Mon Sep 17 00:00:00 2001 From: Vytas Gavelis Date: Fri, 15 Nov 2019 20:21:29 +0200 Subject: [PATCH 03/14] Finished --- src/Controller/StudentController.php | 50 ++++++++++++++++++++++++++++ templates/student/index.html.twig | 48 ++++++++++++++++++++++++++ 2 files changed, 98 insertions(+) create mode 100644 src/Controller/StudentController.php create mode 100644 templates/student/index.html.twig diff --git a/src/Controller/StudentController.php b/src/Controller/StudentController.php new file mode 100644 index 000000000..b84322d1a --- /dev/null +++ b/src/Controller/StudentController.php @@ -0,0 +1,50 @@ +render('home/index.html.twig', [ + 'students' => $this->groupByStudents(json_decode($studentsData, true)), + ]); + } + + /** + * @Route("/student", name="student") + */ + public function student(Request $request) + { + $name = $request->query->get('name'); + $project = $request->query->get('project'); + + return $this->render('student/index.html.twig', [ + 'name' => $name, + 'project' => $project, + ]); + } + + private function groupByStudents(array $projects) + { + $result = []; + foreach ($projects as $projectName => $project) { + foreach ($project['students'] as $student) { + $result[] = ['student' => $student, 'project' => $projectName, 'mentors' => $project['mentors']]; + } + } + return $result; + } + +} + diff --git a/templates/student/index.html.twig b/templates/student/index.html.twig new file mode 100644 index 000000000..202e99f8e --- /dev/null +++ b/templates/student/index.html.twig @@ -0,0 +1,48 @@ +{% extends 'base.html.twig' %} + +{% block title %}Vertinimas{% endblock %} + +{% block body %} +
+ + + + + + + + + + + +
+ Projektas + + Studentas +
+ {% if project is not defined or project is null %} + Nenurodytas + {% else %} + {{ project|escape }} + {% endif %} + + {% if name is not defined or name is null %} + Nenurodytas + {% else %} + {{ name|escape }} + {% endif %} +
+ {% if name|lower == "vytas"%} + + {% else %} + + {% endif %} +
+ +{% endblock %} \ No newline at end of file From 8bf52a4b5741d29fd35f3e724691ac9dd1e24428 Mon Sep 17 00:00:00 2001 From: Vytas Gavelis Date: Fri, 15 Nov 2019 20:34:15 +0200 Subject: [PATCH 04/14] Code style fix --- composer.json | 2 +- composer.lock | 104 +++++++++++++-------------- src/Controller/StudentController.php | 4 +- 3 files changed, 54 insertions(+), 56 deletions(-) diff --git a/composer.json b/composer.json index ee37965ce..4070d5199 100644 --- a/composer.json +++ b/composer.json @@ -5,6 +5,7 @@ "php": "^7.1.3", "ext-ctype": "*", "ext-iconv": "*", + "squizlabs/php_codesniffer": "*", "symfony/asset": "4.3.*", "symfony/console": "4.3.*", "symfony/dotenv": "4.3.*", @@ -16,7 +17,6 @@ "symfony/yaml": "4.3.*" }, "require-dev": { - "squizlabs/php_codesniffer": "^3.5", "symfony/maker-bundle": "^1.13", "symfony/var-dumper": "4.3.*" }, diff --git a/composer.lock b/composer.lock index bc0075063..bed84a8c0 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": "d925f5a50b322fe9bc2ff1eef8793a90", + "content-hash": "87741983b8c1aea6ec55fe6f2ff10cb4", "packages": [ { "name": "doctrine/annotations", @@ -1521,6 +1521,57 @@ ], "time": "2018-11-20T15:27:04+00:00" }, + { + "name": "squizlabs/php_codesniffer", + "version": "3.5.2", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "65b12cdeaaa6cd276d4c3033a95b9b88b12701e7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/65b12cdeaaa6cd276d4c3033a95b9b88b12701e7", + "reference": "65b12cdeaaa6cd276d4c3033a95b9b88b12701e7", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + }, + "bin": [ + "bin/phpcs", + "bin/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", + "keywords": [ + "phpcs", + "standards" + ], + "time": "2019-10-28T04:36:32+00:00" + }, { "name": "symfony/asset", "version": "v4.3.5", @@ -3901,57 +3952,6 @@ ], "time": "2019-09-01T07:51:21+00:00" }, - { - "name": "squizlabs/php_codesniffer", - "version": "3.5.1", - "source": { - "type": "git", - "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "82cd0f854ceca17731d6d019c7098e3755c45060" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/82cd0f854ceca17731d6d019c7098e3755c45060", - "reference": "82cd0f854ceca17731d6d019c7098e3755c45060", - "shasum": "" - }, - "require": { - "ext-simplexml": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" - }, - "bin": [ - "bin/phpcs", - "bin/phpcbf" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Greg Sherwood", - "role": "lead" - } - ], - "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", - "keywords": [ - "phpcs", - "standards" - ], - "time": "2019-10-16T21:14:26+00:00" - }, { "name": "symfony/maker-bundle", "version": "v1.13.1", diff --git a/src/Controller/StudentController.php b/src/Controller/StudentController.php index b84322d1a..231aded6b 100644 --- a/src/Controller/StudentController.php +++ b/src/Controller/StudentController.php @@ -18,7 +18,7 @@ public function index() return $this->render('home/index.html.twig', [ 'students' => $this->groupByStudents(json_decode($studentsData, true)), - ]); + ]); } /** @@ -45,6 +45,4 @@ private function groupByStudents(array $projects) } return $result; } - } - From c816d1ca2c3668192289efcf6e2d8a937576d1f1 Mon Sep 17 00:00:00 2001 From: Vytas Gavelis Date: Fri, 15 Nov 2019 21:31:11 +0200 Subject: [PATCH 05/14] Home page finished --- src/Controller/StudentController.php | 12 ++++++++- templates/home/index.html.twig | 38 +++++++++++++++++++++++++++- 2 files changed, 48 insertions(+), 2 deletions(-) diff --git a/src/Controller/StudentController.php b/src/Controller/StudentController.php index 231aded6b..22be2e832 100644 --- a/src/Controller/StudentController.php +++ b/src/Controller/StudentController.php @@ -18,6 +18,7 @@ public function index() return $this->render('home/index.html.twig', [ 'students' => $this->groupByStudents(json_decode($studentsData, true)), + 'projects' => $this->groupByTeams(json_decode($studentsData, true)), ]); } @@ -35,12 +36,21 @@ public function student(Request $request) ]); } + private function groupByTeams(array $projects) + { + $result = []; + foreach ($projects as $projectName => $project) { + $result[] = ['name' => $projectName, 'team' => $project['name']]; + } + return $result; + } + private function groupByStudents(array $projects) { $result = []; foreach ($projects as $projectName => $project) { foreach ($project['students'] as $student) { - $result[] = ['student' => $student, 'project' => $projectName, 'mentors' => $project['mentors']]; + $result[] = ['student' => $student, 'project' => $projectName, 'mentor' => $project['mentors'][0]]; } } return $result; diff --git a/templates/home/index.html.twig b/templates/home/index.html.twig index 1841cee9d..e5d4e052c 100644 --- a/templates/home/index.html.twig +++ b/templates/home/index.html.twig @@ -9,10 +9,46 @@
  • {{ student.student }} - (Mentorius) + (Mentorius {{ student.mentor }})
  • {% endfor %} + +
    +
    +
    + +
    +
    + +
    + +
    +
    + + {% endblock %} \ No newline at end of file From f074b69f895410cdb5d341a747b784c6a8bcba14 Mon Sep 17 00:00:00 2001 From: Vytas Gavelis Date: Sat, 16 Nov 2019 09:38:00 +0200 Subject: [PATCH 06/14] Url escapes --- templates/home/index.html.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/home/index.html.twig b/templates/home/index.html.twig index e5d4e052c..3f707f43f 100644 --- a/templates/home/index.html.twig +++ b/templates/home/index.html.twig @@ -8,7 +8,7 @@ {% for student in students %}
  • - {{ student.student }} + {{ student.student }} (Mentorius {{ student.mentor }})
  • @@ -34,7 +34,7 @@

    {{ project.team }}

    From 3a6c4be7c315085e990cea231208e2c7a3288617 Mon Sep 17 00:00:00 2001 From: Vytas Gavelis Date: Sat, 16 Nov 2019 09:55:05 +0200 Subject: [PATCH 07/14] Json file added --- src/Controller/StudentController.php | 11 ++ templates/home/index.html.twig | 4 +- templates/home/students.json | 181 +++++++++++++++++++++++++++ 3 files changed, 194 insertions(+), 2 deletions(-) create mode 100644 templates/home/students.json diff --git a/src/Controller/StudentController.php b/src/Controller/StudentController.php index 22be2e832..e55b038b1 100644 --- a/src/Controller/StudentController.php +++ b/src/Controller/StudentController.php @@ -2,6 +2,7 @@ namespace App\Controller; +use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; @@ -22,6 +23,16 @@ public function index() ]); } + /** + * @Route("/students.json", name="studentsjson") + */ + public function studentsData() + { + $studentsData = file_get_contents('https://hw1.nfq2019.online/students.json'); + + return new JsonResponse(json_decode($studentsData)); + } + /** * @Route("/student", name="student") */ diff --git a/templates/home/index.html.twig b/templates/home/index.html.twig index 3f707f43f..c27dade6f 100644 --- a/templates/home/index.html.twig +++ b/templates/home/index.html.twig @@ -38,7 +38,7 @@ GitHub
    @@ -49,6 +49,6 @@ {% endfor %} {% endblock %} \ No newline at end of file diff --git a/templates/home/students.json b/templates/home/students.json new file mode 100644 index 000000000..c06cff4d5 --- /dev/null +++ b/templates/home/students.json @@ -0,0 +1,181 @@ +{ + "team1": { + "name": "Team1", + "mentors": [ + "Mantas" + ], + "students": [ + "Tadas", + "Gytis", + "Ričardas" + ] + }, + "baltichalatai": { + "name": "BaltiChalatai", + "mentors": [ + "Lukas" + ], + "students": [ + "Vytas", + "Lukas", + "Diana" + ] + }, + "nnizer": { + "name": "ePacientas", + "mentors": [ + "Tadas" + ], + "students": [ + "Kornelijus", + "Dominykas", + "Miglė" + ] + }, + "activegen": { + "name": "ActiveGen", + "mentors": [ + "Arnoldas" + ], + "students": [ + "Andrius", + "Nojus", + "Martynas", + "Edvinas" + ] + }, + "mms": { + "name": "Membership-management-system", + "mentors": [ + "Mindaugas" + ], + "students": [ + "Erika", + "Rokas", + "Valentinas", + "Eligijus" + ] + }, + "pamainos": { + "name": "NFQ pamainu sistema", + "mentors": [ + "Paulius" + ], + "students": [ + "Liudas", + "Justina", + "Andrius" + ] + }, + "receptai": { + "name": "Receptai", + "mentors": [ + "Mantas" + ], + "students": [ + "Arnoldas", + "Arentas", + "Tautvydas" + ] + }, + "pulse": { + "name": "NFQ pulse", + "mentors": [ + "Lorenas" + ], + "students": [ + "Arvydas", + "Titas", + "Kristijonas", + "Andrius" + ] + }, + "lita": { + "name": "NFQ Petro atrankos problema akademijai", + "mentors": [ + "Paulius" + ], + "students": [ + "Kristina", + "Indrė", + "Dmitri" + ] + }, + "myfleet": { + "name": "MyFleet", + "mentors": [ + "Laurynas" + ], + "students": [ + "Artūras", + "Ignas", + "Jonas" + ] + }, + "career": { + "name": "NFQ Career Criteria Assessment", + "mentors": [ + "Erikas" + ], + "students": [ + "Matas", + "Andrius", + "Ainis" + ] + }, + "carparking": { + "name": "NFQ Car parking", + "mentors": [ + "Andrejus" + ], + "students": [ + "Kęstas", + "Lukas", + "Lukas" + ] + }, + "podcast": { + "name": "Krepšinio podcastai", + "mentors": [ + "Eligijus" + ], + "students": [ + "Edvardas", + "Nerijus", + "Kazimieras" + ] + }, + "Barakas": { + "name": "barakas", + "mentors": [ + "Armandas" + ], + "students": [ + "Raimondas", + "Mantas", + "Tomas" + ] + }, + "devcollab": { + "name": "Education sharing platform", + "mentors": [ + "Viktoras" + ], + "students": [ + "Karolis", + "Arnas", + "Evaldas", + "Algirdas" + ] + }, + "hacker'is po .mySubdomain &project=123": { + "name": "' OR 1 -- DROP DATABASE", + "mentors": [ + "Ponas Programišius" + ], + "students": [ + "Aurelijus", + "Ir jo \"geras\" draug'as" + ] + } +} \ No newline at end of file From 70308d80f668cdb7c6d13baccfdf4fdff4d7a2ed Mon Sep 17 00:00:00 2001 From: Vytas Gavelis Date: Sat, 16 Nov 2019 10:47:38 +0200 Subject: [PATCH 08/14] Escaped students --- templates/home/index.html.twig | 1 - 1 file changed, 1 deletion(-) diff --git a/templates/home/index.html.twig b/templates/home/index.html.twig index c27dade6f..4c9d8f5fe 100644 --- a/templates/home/index.html.twig +++ b/templates/home/index.html.twig @@ -11,7 +11,6 @@ {{ student.student }} (Mentorius {{ student.mentor }}) -
    {% endfor %} From b9a933ef233dddd7a3af2877fb04c57893042d14 Mon Sep 17 00:00:00 2001 From: Vytas Gavelis Date: Sat, 16 Nov 2019 11:22:38 +0200 Subject: [PATCH 09/14] another try --- templates/home/index.html.twig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/home/index.html.twig b/templates/home/index.html.twig index 4c9d8f5fe..41419760f 100644 --- a/templates/home/index.html.twig +++ b/templates/home/index.html.twig @@ -8,7 +8,7 @@ {% for student in students %}
  • - {{ student.student }} + {{ student['student'] | escape}} (Mentorius {{ student.mentor }})
  • {% endfor %} @@ -37,11 +37,11 @@ GitHub
    -
    ssh {{ project.name }}@deploy.nfqakademija.lt -p 2222
    +
    ssh {{ project.name | escape }}@deploy.nfqakademija.lt -p 2222
    From cb049ad4e3f89d4a28012320c2cae4ac69f7d831 Mon Sep 17 00:00:00 2001 From: Vytas Gavelis Date: Sat, 16 Nov 2019 11:30:56 +0200 Subject: [PATCH 10/14] escape2 --- templates/home/index.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/home/index.html.twig b/templates/home/index.html.twig index 41419760f..17032fff3 100644 --- a/templates/home/index.html.twig +++ b/templates/home/index.html.twig @@ -33,7 +33,7 @@

    {{ project.team }}

    From dbe254864e42eede7a1df7efe063dc5f70e9d1d2 Mon Sep 17 00:00:00 2001 From: Vytas Gavelis Date: Sat, 16 Nov 2019 12:03:12 +0200 Subject: [PATCH 11/14] added missing slash --- templates/home/index.html.twig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/templates/home/index.html.twig b/templates/home/index.html.twig index 17032fff3..c8f1a670b 100644 --- a/templates/home/index.html.twig +++ b/templates/home/index.html.twig @@ -14,7 +14,6 @@ {% endfor %} -
    @@ -37,7 +36,7 @@ GitHub
    From 6d62827aed04f9f4e0fc76cc537f7ad053cbb4ac Mon Sep 17 00:00:00 2001 From: Vytas Gavelis Date: Sun, 8 Dec 2019 21:02:15 +0200 Subject: [PATCH 12/14] fixed --- {templates/home => public}/students.json | 0 src/Controller/StudentController.php | 4 +- src/Controller/students.json | 181 +++++++++++++++++++++++ templates/home/index.html.twig | 13 +- templates/student/index.html.twig | 6 +- 5 files changed, 192 insertions(+), 12 deletions(-) rename {templates/home => public}/students.json (100%) create mode 100644 src/Controller/students.json diff --git a/templates/home/students.json b/public/students.json similarity index 100% rename from templates/home/students.json rename to public/students.json diff --git a/src/Controller/StudentController.php b/src/Controller/StudentController.php index e55b038b1..bb7979097 100644 --- a/src/Controller/StudentController.php +++ b/src/Controller/StudentController.php @@ -15,7 +15,7 @@ class StudentController extends AbstractController */ public function index() { - $studentsData = file_get_contents('https://hw1.nfq2019.online/students.json'); + $studentsData = file_get_contents('students.json'); return $this->render('home/index.html.twig', [ 'students' => $this->groupByStudents(json_decode($studentsData, true)), @@ -28,7 +28,7 @@ public function index() */ public function studentsData() { - $studentsData = file_get_contents('https://hw1.nfq2019.online/students.json'); + $studentsData = file_get_contents('students.json'); return new JsonResponse(json_decode($studentsData)); } diff --git a/src/Controller/students.json b/src/Controller/students.json new file mode 100644 index 000000000..c06cff4d5 --- /dev/null +++ b/src/Controller/students.json @@ -0,0 +1,181 @@ +{ + "team1": { + "name": "Team1", + "mentors": [ + "Mantas" + ], + "students": [ + "Tadas", + "Gytis", + "Ričardas" + ] + }, + "baltichalatai": { + "name": "BaltiChalatai", + "mentors": [ + "Lukas" + ], + "students": [ + "Vytas", + "Lukas", + "Diana" + ] + }, + "nnizer": { + "name": "ePacientas", + "mentors": [ + "Tadas" + ], + "students": [ + "Kornelijus", + "Dominykas", + "Miglė" + ] + }, + "activegen": { + "name": "ActiveGen", + "mentors": [ + "Arnoldas" + ], + "students": [ + "Andrius", + "Nojus", + "Martynas", + "Edvinas" + ] + }, + "mms": { + "name": "Membership-management-system", + "mentors": [ + "Mindaugas" + ], + "students": [ + "Erika", + "Rokas", + "Valentinas", + "Eligijus" + ] + }, + "pamainos": { + "name": "NFQ pamainu sistema", + "mentors": [ + "Paulius" + ], + "students": [ + "Liudas", + "Justina", + "Andrius" + ] + }, + "receptai": { + "name": "Receptai", + "mentors": [ + "Mantas" + ], + "students": [ + "Arnoldas", + "Arentas", + "Tautvydas" + ] + }, + "pulse": { + "name": "NFQ pulse", + "mentors": [ + "Lorenas" + ], + "students": [ + "Arvydas", + "Titas", + "Kristijonas", + "Andrius" + ] + }, + "lita": { + "name": "NFQ Petro atrankos problema akademijai", + "mentors": [ + "Paulius" + ], + "students": [ + "Kristina", + "Indrė", + "Dmitri" + ] + }, + "myfleet": { + "name": "MyFleet", + "mentors": [ + "Laurynas" + ], + "students": [ + "Artūras", + "Ignas", + "Jonas" + ] + }, + "career": { + "name": "NFQ Career Criteria Assessment", + "mentors": [ + "Erikas" + ], + "students": [ + "Matas", + "Andrius", + "Ainis" + ] + }, + "carparking": { + "name": "NFQ Car parking", + "mentors": [ + "Andrejus" + ], + "students": [ + "Kęstas", + "Lukas", + "Lukas" + ] + }, + "podcast": { + "name": "Krepšinio podcastai", + "mentors": [ + "Eligijus" + ], + "students": [ + "Edvardas", + "Nerijus", + "Kazimieras" + ] + }, + "Barakas": { + "name": "barakas", + "mentors": [ + "Armandas" + ], + "students": [ + "Raimondas", + "Mantas", + "Tomas" + ] + }, + "devcollab": { + "name": "Education sharing platform", + "mentors": [ + "Viktoras" + ], + "students": [ + "Karolis", + "Arnas", + "Evaldas", + "Algirdas" + ] + }, + "hacker'is po .mySubdomain &project=123": { + "name": "' OR 1 -- DROP DATABASE", + "mentors": [ + "Ponas Programišius" + ], + "students": [ + "Aurelijus", + "Ir jo \"geras\" draug'as" + ] + } +} \ No newline at end of file diff --git a/templates/home/index.html.twig b/templates/home/index.html.twig index c8f1a670b..154bab69f 100644 --- a/templates/home/index.html.twig +++ b/templates/home/index.html.twig @@ -6,16 +6,15 @@
    - +
    @@ -32,21 +31,21 @@

    {{ project.team }}

    -
    ssh {{ project.name | escape }}@deploy.nfqakademija.lt -p 2222
    +
    ssh {{ project.name }}@deploy.nfqakademija.lt -p 2222
    {% endfor %} {% endblock %} \ No newline at end of file diff --git a/templates/student/index.html.twig b/templates/student/index.html.twig index 202e99f8e..607eef4b0 100644 --- a/templates/student/index.html.twig +++ b/templates/student/index.html.twig @@ -19,14 +19,14 @@ {% if project is not defined or project is null %} Nenurodytas {% else %} - {{ project|escape }} + {{ project }} {% endif %} {% if name is not defined or name is null %} Nenurodytas {% else %} - {{ name|escape }} + {{ name }} {% endif %} @@ -43,6 +43,6 @@ {% endif %}
    {% endblock %} \ No newline at end of file From aecdd1364bdbf1773692c9a905ddf2d226c92346 Mon Sep 17 00:00:00 2001 From: Vytas Gavelis Date: Sun, 8 Dec 2019 21:16:50 +0200 Subject: [PATCH 13/14] fixed missing path command --- templates/home/index.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/home/index.html.twig b/templates/home/index.html.twig index 154bab69f..4c2d9064a 100644 --- a/templates/home/index.html.twig +++ b/templates/home/index.html.twig @@ -46,6 +46,6 @@ {% endfor %} {% endblock %} \ No newline at end of file From 42cd29d52529bad5ee83a38c1b618069940d03f4 Mon Sep 17 00:00:00 2001 From: Vytas Gavelis Date: Sun, 8 Dec 2019 21:47:32 +0200 Subject: [PATCH 14/14] fixed students.json link --- templates/home/index.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/home/index.html.twig b/templates/home/index.html.twig index 4c2d9064a..3227f0efb 100644 --- a/templates/home/index.html.twig +++ b/templates/home/index.html.twig @@ -46,6 +46,6 @@ {% endfor %} {% endblock %} \ No newline at end of file