Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions assets/css/app.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
$body-bg: #bec3d1;

// customize some Bootstrap variables
$primary: darken(#428bca, 20%);

Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.*"
Expand Down
172 changes: 171 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions config/bundles.php
Original file line number Diff line number Diff line change
Expand Up @@ -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],
];
6 changes: 6 additions & 0 deletions config/packages/dev/web_profiler.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
web_profiler:
toolbar: true
intercept_redirects: false

framework:
profiler: { only_exceptions: false }
6 changes: 6 additions & 0 deletions config/packages/test/web_profiler.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
web_profiler:
toolbar: false
intercept_redirects: false

framework:
profiler: { collect: false }
7 changes: 7 additions & 0 deletions config/routes/dev/web_profiler.yaml
Original file line number Diff line number Diff line change
@@ -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
8 changes: 5 additions & 3 deletions src/Controller/HomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
]);
}
}
26 changes: 26 additions & 0 deletions src/Controller/StudentController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

namespace App\Controller;


use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;

class StudentController extends AbstractController
{
/**
* @Route("/student", name="student")
*/
public function index(Request $request)
{
$data = file_get_contents('https://hw1.nfq2019.online/students.json');
$students=json_decode($data, true);
$name = $request->get('student');

return $this->render('student/index.html.twig', [
'HomeController' => $name,
]);

}
}
32 changes: 32 additions & 0 deletions src/Controller/TeamController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

namespace App\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Component\Routing\Annotation\Route;

class TeamController extends AbstractController
{
/**
* @Route("/team", name="team")
*/
public function index(KernelInterface $request)
{
$a = $request->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;
}
}
20 changes: 20 additions & 0 deletions symfony.lock
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,9 @@
"symfony/polyfill-php73": {
"version": "v1.12.0"
},
"symfony/profiler-pack": {
"version": "v1.0.4"
},
"symfony/routing": {
"version": "4.2",
"recipe": {
Expand Down Expand Up @@ -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": {
Expand Down
31 changes: 29 additions & 2 deletions templates/home/index.html.twig
Original file line number Diff line number Diff line change
@@ -1,7 +1,34 @@
{% extends 'base.html.twig' %}

{% block title %}{{ someVariable }}{% endblock %}
{% block title %}{% endblock %}

{% block body %}
<div class="nfq-academy">{{ someVariable }}</div>

<ul class="list-group m-4">
<li class="list-group-item list-group-item-info">Komandos</li>

{% for team in process %}
<li class="list-group-item">
<div>
<h4>Komanda: <strong>{{ team["name"] }}</strong></h4>
<h4>Vadovas: <strong>{{ team["mentors"] [0] }}</strong></h4>
Komandos nariai:
<ul>
{% for student in team["students"] %}
<li>
<a href="{{ path('student', {'student':student}) }}">{{student}}</a>
</li>
{% endfor %}
</ul>
</div>
</li>
{% endfor %}
</ul>

<a href="{{ path('student') }}">Student</a>
<a href="{{ path('home') }}?student={{ '' }}"

{% endblock %}



Loading