diff --git a/assets/css/app.scss b/assets/css/app.scss index f955fad8f..b4a73bdb7 100644 --- a/assets/css/app.scss +++ b/assets/css/app.scss @@ -1,3 +1,4 @@ +$body-bg: #ff622b; // customize some Bootstrap variables $primary: darken(#428bca, 20%); diff --git a/public/students.json b/public/students.json new file mode 100644 index 000000000..c06cff4d5 --- /dev/null +++ b/public/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/src/Controller/HomeController.php b/src/Controller/HomeController.php index 90484f11f..3ae4b419e 100644 --- a/src/Controller/HomeController.php +++ b/src/Controller/HomeController.php @@ -3,17 +3,35 @@ namespace App\Controller; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; +use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Component\Routing\Annotation\Route; class HomeController extends AbstractController { /** * @Route("/", name="home") + * @param KernelInterface $kernel + * @return \Symfony\Component\HttpFoundation\Response */ - public function index() + public function index(KernelInterface $kernel) { + $projects = json_decode(file_get_contents($kernel->getProjectDir() . '/public/students.json'), true); + + $students = $this->groupByStudents($projects); return $this->render('home/index.html.twig', [ - 'someVariable' => 'NFQ Akademija', + 'someVariable' => $students, + 'projects' => $projects ]); } + + private function groupByStudents(array $projects) + { + $result = []; + foreach ($projects as $projectName => $project) { + foreach ($project['students'] as $student) { + $result[] = ['student' => $student, 'project' => $projectName, 'mentor' => $project['mentors'][0]]; + } + } + return $result; + } } diff --git a/src/Controller/StudentController.php b/src/Controller/StudentController.php new file mode 100644 index 000000000..148dd4f93 --- /dev/null +++ b/src/Controller/StudentController.php @@ -0,0 +1,27 @@ +get('name'); + $project = $request->get('project'); + + return $this->render('student/index.html.twig', [ + 'name' => $name, + 'project' => $project, + ]); + } +} diff --git a/templates/home/index.html.twig b/templates/home/index.html.twig index b1bd0115c..1be8b4aca 100644 --- a/templates/home/index.html.twig +++ b/templates/home/index.html.twig @@ -1,7 +1,59 @@ {% extends 'base.html.twig' %} -{% block title %}{{ someVariable }}{% endblock %} +{% block title %}Student{% endblock %} + + {% block body %} + + +
+
+ +
+ +
+
+ +
+ + +
+
+ + +
+ Duomenų failas +
+ {% endblock %} + + + -{% block body %} -
{{ someVariable }}
-{% endblock %} diff --git a/templates/student/index.html.twig b/templates/student/index.html.twig new file mode 100644 index 000000000..06437e23e --- /dev/null +++ b/templates/student/index.html.twig @@ -0,0 +1,32 @@ +{% extends 'base.html.twig' %} + +{% block body %} +
+ + + + + + + + + + + +
ProjektasStudentas
{{ project|escape }}{{ name|escape }}
+ + {% if name == 'Indrė' %} + + {% else %} + + {% endif %} +
+ +
+ Visi studentai +
+{% endblock %}