Commit 625a677b authored by Vladyslav Terebylo's avatar Vladyslav Terebylo
Browse files

Developed practise application

parent ab559549
This diff is collapsed.
This diff is collapsed.
body{padding-top:120px}iframe{overflow:hidden;border:none}.navbar .bi{margin-right:.25rem;font-size:1rem}#home .navbar,#help .navbar{background:linear-gradient(145deg, #375ee3 0%, #6543e0 80%)}#home .navbar-brand .nav-link,#help .navbar-brand .nav-link{display:inline-block;margin-right:-30px}#home{padding-top:0}#home .btn{padding:.5rem .9rem}.bs-docs-section{margin-top:4em}.bs-docs-section .page-header h1{padding:2rem 0;font-size:3rem}.dropdown-menu.show[aria-labelledby=themes]{display:flex;flex-wrap:wrap;width:420px}.dropdown-menu.show[aria-labelledby=themes] .dropdown-item{width:33.333333%}.dropdown-menu.show[aria-labelledby=themes] .dropdown-item:first-child{width:100%}.bs-component{position:relative}.bs-component+.bs-component{margin-top:1rem}.bs-component .card{margin-bottom:1rem}.bs-component .modal{position:relative;top:auto;right:auto;bottom:auto;left:auto;z-index:1;display:block}.bs-component .modal-dialog{width:90%}.bs-component .popover{position:relative;display:inline-block;width:220px;margin:20px}.source-button{position:absolute;top:0;right:0;z-index:100;display:none;font-weight:700}.source-button i{pointer-events:none}.source-button:hover{cursor:pointer}.bs-component:hover .source-button{display:block}#source-modal pre{max-height:calc(100vh - 11rem)}.progress{margin-bottom:10px}#footer{margin:5em 0}#footer li{float:left;margin-right:1.5em;margin-bottom:1.5em}#footer p{margin-bottom:0;clear:left}.splash{position:relative;padding:12em 0 6em;color:#fff;text-align:center;background-color:#375ee3;background-image:url("../img/splash.svg"),linear-gradient(145deg, #375ee3 0%, #6543e0 80%);background-repeat:no-repeat;background-size:cover}.splash .logo{width:160px}.splash h1{font-size:3em;color:#fff}.splash #social{margin:2em 0 3em}.splash .alert{margin:2em 0;border:none}.splash .sponsor a{color:#fff}.section-tout{padding:6em 0 1em;text-align:center;background-color:#eaf1f1;border-bottom:1px solid rgba(0,0,0,.05)}.section-tout .icon{display:flex;align-items:center;justify-content:center;width:80px;height:80px;margin:0 auto 1rem;font-size:2rem;line-height:1;color:rgba(255,255,255,.9);background:linear-gradient(145deg, #375ee3 0%, #6543e0 80%);border-radius:50%}.section-tout p{margin-bottom:5em}.section-preview{padding:4em 0}.section-preview .preview{margin-bottom:4em;background-color:#eaf1f1}.section-preview .preview .image{position:relative}.section-preview .preview .image img{width:100%;height:auto}.section-preview .preview .options{padding:2em;text-align:center;border-top:1px solid rgba(0,0,0,.125)}.section-preview .preview .options p{margin-bottom:2em}.section-preview .dropdown-menu{text-align:left}.section-preview .lead{margin-bottom:2em}.sponsor a{text-decoration:none}.sponsor #carbonads{max-width:240px;margin:0 auto}.sponsor .carbon-text{display:block;margin-top:1em;font-size:12px}.sponsor .carbon-poweredby{float:right;margin-top:1em;font-size:10px}[data-bs-theme=dark] .section-tout{background-color:#111}[data-bs-theme=dark] .section-preview .preview{background-color:#2b3036}@media(max-width: 767px){.splash{padding-top:8em}.splash .logo{width:100px}.splash h1{font-size:2em}#banner{margin-bottom:2em;text-align:center}}@media(min-width: 992px){.navbar-transparent{background:none !important}}.bs-component>.btn,.bs-component>.btn-toolbar>.btn-group,.bs-component>.btn-group,#home .section-preview .card .btn-group{margin-bottom:.25rem}
\ No newline at end of file
/**
* okaidia theme for JavaScript, CSS and HTML
* Loosely based on Monokai textmate theme by http://www.monokai.nl/
* @author ocodia
*/
code[class*="language-"],
pre[class*="language-"] {
color: #f8f8f2;
background: none;
text-shadow: 0 1px rgba(0, 0, 0, 0.3);
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
font-size: 1em;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
word-wrap: normal;
line-height: 1.5;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
/* Code blocks */
pre[class*="language-"] {
padding: 1em;
margin: .5em 0;
overflow: auto;
border-radius: 0.3em;
}
:not(pre) > code[class*="language-"],
pre[class*="language-"] {
background: #272822;
}
/* Inline code */
:not(pre) > code[class*="language-"] {
padding: .1em;
border-radius: .3em;
white-space: normal;
}
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: #8292a2;
}
.token.punctuation {
color: #f8f8f2;
}
.token.namespace {
opacity: .7;
}
.token.property,
.token.tag,
.token.constant,
.token.symbol,
.token.deleted {
color: #f92672;
}
.token.boolean,
.token.number {
color: #ae81ff;
}
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
color: #a6e22e;
}
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string,
.token.variable {
color: #f8f8f2;
}
.token.atrule,
.token.attr-value,
.token.function,
.token.class-name {
color: #e6db74;
}
.token.keyword {
color: #66d9ef;
}
.token.regex,
.token.important {
color: #fd971f;
}
.token.important,
.token.bold {
font-weight: bold;
}
.token.italic {
font-style: italic;
}
.token.entity {
cursor: help;
}
This diff is collapsed.
/* globals bootstrap:false, Prism:false */
(function () {
'use strict';
// Helper functions
function escapeHtml(html) {
return html.replace(/×/g, '×')
.replace(/«/g, '«')
.replace(/»/g, '»')
.replace(/←/g, '←')
.replace(/→/g, '→');
}
function cleanSource(html) {
// Escape HTML, split the lines to an Array, remove empty elements
// and finally remove the last element
let lines = escapeHtml(html).split('\n').filter(Boolean).slice(0, -1);
const indentSize = lines[0].length - lines[0].trim().length;
const re = new RegExp(' {' + indentSize + '}');
lines = lines.map(line => {
return re.test(line) ? line.slice(Math.max(0, indentSize)) : line;
});
return lines.join('\n');
}
// Add/remove `.navbar-transparent` on scroll; should probably be throttled later
function addNavbarTransparentClass() {
const navBarElement = document.querySelector('#home > .navbar');
if (!navBarElement) {
return;
}
window.addEventListener('scroll', () => {
const scroll = document.documentElement.scrollTop;
if (scroll > 50) {
navBarElement.classList.remove('navbar-transparent');
} else {
navBarElement.classList.add('navbar-transparent');
}
});
}
// Add source modals
function addSourceModals() {
const sourceModalElement = document.getElementById('source-modal');
if (!sourceModalElement) {
return;
}
sourceModalElement.querySelector('.btn-copy').addEventListener('click', (e) => {
if (navigator.clipboard) {
const code = sourceModalElement.querySelector('.modal-body pre').innerText;
navigator.clipboard.writeText(code);
}
const sourceModal = bootstrap.Modal.getOrCreateInstance(sourceModalElement);
sourceModal.hide();
});
document.body.addEventListener('click', event => {
if (!event.target.matches('.source-button')) {
return;
}
const sourceModal = bootstrap.Modal.getOrCreateInstance(sourceModalElement);
let html = event.target.parentNode.innerHTML;
html = Prism.highlight(cleanSource(html), Prism.languages.html, 'html');
sourceModalElement.querySelector('code').innerHTML = html;
sourceModal.show();
}, false);
}
// Toggle light and dark themes
function toggleThemeMenu() {
let themeMenu = document.querySelector('#theme-menu');
if (!themeMenu) return;
document.querySelectorAll('[data-bs-theme-value]').forEach(value => {
value.addEventListener('click', () => {
const theme = value.getAttribute('data-bs-theme-value');
document.documentElement.setAttribute('data-bs-theme', theme);
});
});
}
addNavbarTransparentClass();
addSourceModals();
toggleThemeMenu();
// Prevent empty `a` elements or `submit` buttons from navigating away
const targets = document.querySelectorAll('[href="#"], [type="submit"]');
for (const element of targets) {
element.addEventListener('click', event => {
event.preventDefault();
});
}
// Add the "View Source" buttons in each component
const bsComponents = document.querySelectorAll('.bs-component');
for (const element of bsComponents) {
const button = '<button class="source-button btn btn-primary btn-xs" type="button" tabindex="0"><i class="bi bi-code"></i></button>';
element.insertAdjacentHTML('beforeend', button);
}
// Initialize popovers
const popoverElements = document.querySelectorAll('[data-bs-toggle="popover"]');
for (const popover of popoverElements) {
new bootstrap.Popover(popover); // eslint-disable-line no-new
}
// Initialize tooltips
const tooltipElements = document.querySelectorAll('[data-bs-toggle="tooltip"]');
for (const tooltip of tooltipElements) {
new bootstrap.Tooltip(tooltip); // eslint-disable-line no-new
}
})();
This diff is collapsed.
......@@ -12,7 +12,7 @@ class HomepageController extends BaseController
/**
* @return Response
*/
#[Route('/', name: 'homepage_default')]
#[Route('/default', name: 'homepage_default')]
public function default(): Response
{
......
<?php
namespace App\Controller;
use App\Entity\Student;
use App\Form\StudentType;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\Form\FormError;
use Symfony\Component\HttpFoundation\Request;
use App\Repository\StudentRepository;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
class TerebyloController extends BaseController
{
/**
* @return Response
* @author Vladyslav Terebylo
*/
#[Route('/mainpage', name: 'mainpage')]
public function mainpage(): Response
{
$title = "Main page";
return $this->render("terebylo/mainpage.html.twig", array("title" => $title));
}
/**
* @param Request $request
* @param EntityManagerInterface $entityManager
* @return Response
* @author Vladyslav Terebylo
*/
#[Route('/save', name: 'save_new_student')]
public function save(Request $request, EntityManagerInterface $entityManager): Response
{
$title = "Save new student";
$student = new Student();
$form = $this->createForm(StudentType::class, $student);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$password = $form->get('plainPassword')->getData();
$passwordAgain = $form->get('plainPasswordAgain')->getData();
if ($password !== $passwordAgain) {
$form->get('plainPasswordAgain')->addError(new FormError('Password is not valid.'));
} else {
$student->setPassword(password_hash($password, PASSWORD_DEFAULT));
$entityManager->persist($student);
$entityManager->flush();
return $this->redirectToRoute('mainpage');
}
}
return $this->render("terebylo/save.html.twig", [
'title' => $title,
'form' => $form->createView()
]);
}
/**
* @param StudentRepository $studentRepository
* @return Response
* @author Vladyslav Terebylo
*/
#[Route('/student_list', name: 'student_list')]
public function get_student_list(StudentRepository $studentRepository): Response
{
$title = "All students";
$allStudents = $studentRepository->findAll();
return $this->render("terebylo/student_list.html.twig", [
"title" => $title,
"students" => $allStudents
]);
}
/**
* @param int $id
* @param Request $request
* @param EntityManagerInterface $entityManager
* @return Response
* @author Vladyslav Terebylo
*/
#[Route('/edit/{id}', name: 'edit_student_info')]
public function edit(
int $id,
Request $request,
EntityManagerInterface $entityManager
): Response
{
$title = "Update info";
$student = $entityManager->getRepository(Student::class)->find($id);
if (!$student) {
throw new NotFoundException("Student was not found");
}
$form = $this->createForm(StudentType::class, $student);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$password = $form->get('plainPassword')->getData();
$passwordAgain = $form->get('plainPasswordAgain')->getData();
if ($password !== $passwordAgain) {
$form->get('plainPasswordAgain')->addError(new FormError('Hesla se neshodují.'));
} else {
$student->setPassword(password_hash($password, PASSWORD_DEFAULT));
$entityManager->flush();
return $this->redirectToRoute('student_list');
}
}
return $this->render('terebylo/update.html.twig', [
'title' => $title,
'form' => $form->createView()
]);
}
/**
* @param int $id
* @param EntityManagerInterface $entityManager
* @return Response
* @author Vladyslav Terebylo
*/
#[Route('/remove/{id}', name: 'remove_student')]
public function removeStudent(int $id, EntityManagerInterface $entityManager): Response
{
$title = "Remove student";
$student = $entityManager->getRepository(Student::class)->find($id);
if (!$student) {
throw new NotFoundException("Student was not found");
}
$entityManager->remove($student);
$entityManager->flush();
return $this->redirectToRoute("mainpage");
}
}
\ No newline at end of file
......@@ -2,15 +2,31 @@
<html lang="cs">
<head>
<meta charset="utf-8">
<title>Symfony template</title>
<title>Terebylo maturita practise</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script>
</script>
<link rel="stylesheet" href="{{ asset('layouts/sketchy/css/bootstrap.css') }}">
<link rel="stylesheet" href="{{ asset('layouts/sketchy/css/prism-okaidia.css') }}">
<link rel="stylesheet" href="{{ asset('layouts/sketchy/css/custom.min.css') }}">
</head>
<body>
<div class="bs-docs-section clearfix">
{% block body %}
{% endblock %}
<div class="container">
<div class="page-header" id="banner">
<div class="row">
<div class="col-lg-4 col-md-5 col-sm-6"></div>
</div>
</div>
{% include 'navbar.html.twig' %}
<div class="container mt-4">
{% block body %}{% endblock %}
</div>
{% include 'footer.html.twig' %}
<script src="{{ asset('layouts/sketchy/js/bootstrap.bundle.min.js') }}"></script>
<script src="{{ asset('layouts/sketchy/js/prism.js') }}"></script>
</div>
</body>
</html>
<footer id="footer">
<div class="row">
<div class="col-lg-12">
<ul class="list-unstyled">
<li class="float-end"><a href="#top">Back to top</a></li>
<li><a href="https://blog.bootswatch.com/">Blog</a></li>
<li><a href="https://blog.bootswatch.com/rss/">RSS</a></li>
<li><a href="https://twitter.com/bootswatch">Twitter</a></li>
<li><a href="https://github.com/thomaspark/bootswatch">GitHub</a></li>
<li><a href="https://bootswatch.com/help/#api">API</a></li>
<li><a href="https://bootswatch.com/help/#donate">Donate</a></li>
</ul>
<p>Made by <a href="https://thomaspark.co/">Thomas Park</a>.</p>
<p>Code released under the <a href="https://github.com/thomaspark/bootswatch/blob/master/LICENSE">MIT License</a>.</p>
<p>Based on <a href="https://getbootstrap.com/" rel="nofollow">Bootstrap</a>. Icons from <a href="https://icons.getbootstrap.com/" rel="nofollow">Bootstrap Icons</a>. Web fonts from <a href="https://fonts.google.com/" rel="nofollow">Google</a>.</p>
</div>
</div>
</footer>
<div class="navbar navbar-expand-lg fixed-top bg-primary" data-bs-theme="dark">
<div class="container">
<a href="https://bootswatch.com/" class="navbar-brand">Bootswatch</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav">
<li class="nav-item dropdown" data-bs-theme="light">
<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" id="themes">Themes</a>
<div class="dropdown-menu" aria-labelledby="themes">
<a class="dropdown-item" href="../default/">Default</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="../cerulean/">Cerulean</a>
<a class="dropdown-item" href="../cosmo/">Cosmo</a>
<a class="dropdown-item" href="../cyborg/">Cyborg</a>
<a class="dropdown-item" href="../darkly/">Darkly</a>
<a class="dropdown-item" href="../flatly/">Flatly</a>
<a class="dropdown-item" href="../journal/">Journal</a>
<a class="dropdown-item" href="../litera/">Litera</a>
<a class="dropdown-item" href="../lumen/">Lumen</a>
<a class="dropdown-item" href="../lux/">Lux</a>
<a class="dropdown-item" href="../materia/">Materia</a>
<a class="dropdown-item" href="../minty/">Minty</a>
<a class="dropdown-item" href="../morph/">Morph</a>
<a class="dropdown-item" href="../pulse/">Pulse</a>
<a class="dropdown-item" href="../quartz/">Quartz</a>
<a class="dropdown-item" href="../sandstone/">Sandstone</a>
<a class="dropdown-item" href="../simplex/">Simplex</a>
<a class="dropdown-item" href="../sketchy/">Sketchy</a>
<a class="dropdown-item" href="../slate/">Slate</a>
<a class="dropdown-item" href="../solar/">Solar</a>
<a class="dropdown-item" href="../spacelab/">Spacelab</a>
<a class="dropdown-item" href="../superhero/">Superhero</a>
<a class="dropdown-item" href="../united/">United</a>
<a class="dropdown-item" href="../vapor/">Vapor</a>
<a class="dropdown-item" href="../yeti/">Yeti</a>
<a class="dropdown-item" href="../zephyr/">Zephyr</a>
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="https://bootswatch.com/help/">Help</a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://blog.bootswatch.com/">Blog</a>
</li>
<li class="nav-item dropdown" data-bs-theme="light">
<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" id="download">Sketchy</a>
<div class="dropdown-menu" aria-labelledby="download">
<a class="dropdown-item" rel="noopener" target="_blank" href="https://jsfiddle.net/bootswatch/qmLdbwyk/">Open in JSFiddle</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="../5/sketchy/bootstrap.css" download="">bootstrap.css</a>
<a class="dropdown-item" href="../5/sketchy/bootstrap.min.css" download="">bootstrap.min.css</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="../5/sketchy/bootstrap.rtl.css" download="">bootstrap.rtl.css</a>
<a class="dropdown-item" href="../5/sketchy/bootstrap.rtl.min.css" download="">bootstrap.rtl.min.css</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="../5/sketchy/_variables.scss" download="">_variables.scss</a>
<a class="dropdown-item" href="../5/sketchy/_bootswatch.scss" download="">_bootswatch.scss</a>
</div>
</li>
</ul>
<ul class="navbar-nav ms-md-auto">
<li class="nav-item">
<a target="_blank" rel="noopener" class="nav-link" href="https://github.com/thomaspark/bootswatch/"><i class="bi bi-github"></i><span class="d-lg-none ms-2">GitHub</span></a>
</li>
<li class="nav-item">
<a target="_blank" rel="noopener" class="nav-link" href="https://twitter.com/bootswatch"><i class="bi bi-twitter"></i><span class="d-lg-none ms-2">Twitter</span></a>
</li>
<li class="nav-item py-2 py-lg-1 col-12 col-lg-auto">
<div class="vr d-none d-lg-flex h-100 mx-lg-2 text-white"></div>
<hr class="d-lg-none my-2 text-white-50">
</li>
<li class="nav-item dropdown" data-bs-theme="light">
<a class="nav-link dropdown-toggle d-flex align-items-center" href="#" id="version-menu" aria-expanded="false" data-bs-toggle="dropdown" data-bs-display="static" aria-label="Toggle theme">
<span class="d-lg-none me-2">Bootstrap </span>
<span>v5.3</span>
</a>
<ul class="dropdown-menu dropdown-menu-end">
<li>
<a href="https://bootswatch.com/" class="dropdown-item d-flex align-items-center justify-content-between" aria-current="true">
<span class="ms-2">v5.3.x</span><i class="bi bi-check"></i>
</a>
</li>
<li>
<a href="https://bootswatch.com/4/" class="dropdown-item d-flex align-items-center justify-content-between">
<span class="ms-2">v4.6.2</span>
</a>
</li>
<li>
<a href="https://bootswatch.com/3/" class="dropdown-item d-flex align-items-center justify-content-between">
<span class="ms-2">v3.4.1</span>
</a>
</li>
<li>
<a href="https://bootswatch.com/2/" class="dropdown-item d-flex align-items-center justify-content-between">
<span class="ms-2">v2.3.2</span>
</a>
</li>
<li>
<hr class="dropdown-divider">
</li>
<li>
<a href="https://github.com/thomaspark/bootswatch/tags" class="dropdown-item d-flex align-items-center justify-content-between">
<span class="ms-2">All versions</span>
</a>
</li>
</ul>
</li>
<li class="nav-item py-2 py-lg-1 col-12 col-lg-auto">
<div class="vr d-none d-lg-flex h-100 mx-lg-2 text-white"></div>
<hr class="d-lg-none my-2 text-white-50">
</li>
<li class="nav-item dropdown" data-bs-theme="light">
<a class="nav-link dropdown-toggle d-flex align-items-center" href="#" id="theme-menu" aria-expanded="false" data-bs-toggle="dropdown" data-bs-display="static" aria-label="Toggle theme">
<i class="bi bi-circle-half"></i>
<span class="d-lg-none ms-2">Toggle theme</span>
</a>
<ul class="dropdown-menu dropdown-menu-end">
<li>
<button type="button" class="dropdown-item d-flex align-items-center" data-bs-theme-value="light" aria-pressed="false">
<i class="bi bi-sun-fill"></i><span class="ms-2">Light</span>
</button>
</li>
<li>
<button type="button" class="dropdown-item d-flex align-items-center" data-bs-theme-value="dark" aria-pressed="true">
<i class="bi bi-moon-stars-fill"></i><span class="ms-2">Dark</span>
</button>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
\ No newline at end of file
{% extends 'base.html.twig' %}
{% block body %}
<div class="row">
<div class="col-lg-12">
<h1>{{ title }}</h1>
<a href="{{ path('mainpage') }}">Main page</a><br><br>
<a href="{{ path('save_new_student') }}">Add new student</a><br><br>
<a href="{{ path('student_list') }}">View student list</a><br><br>
</div>
</div>
{% endblock %}
{% block stylesheets %}{% endblock %}
{% block javascripts %}{% endblock %}
\ No newline at end of file
{% extends 'base.html.twig' %}
{% block body %}
<div class="row">
<div class="col-lg-12">
<h1>{{ title }}</h1>
<a href="{{ path('mainpage') }}">Main page</a><br><br>
<a href="{{ path('save_new_student') }}">Add new student</a><br><br>
<a href="{{ path('student_list') }}">View student list</a><br><br>
<a href="{{ path('edit_student_info') }}">Edit student info</a><br><br>
<a href="{{ path('remove_student') }}">Remove student</a><br><br>
</div>
</div>
{% endblock %}
{% block stylesheets %}{% endblock %}
{% block javascripts %}{% endblock %}
\ No newline at end of file
{% extends 'base.html.twig' %}
{% block body %}
<div class="row">
<div class="col-lg-12">
<h1>{{ title }}</h1>
{{ form(form) }}
</div>
</div>
{% endblock %}
{% block stylesheets %}{% endblock %}
{% block javascripts %}{% endblock %}
\ No newline at end of file
{% extends 'base.html.twig' %}
{% block body %}
<h1>{{ title }}</h1>
<style>
table {
width: 100%;
border-collapse: collapse;
}
table th, table td {
padding: 10px 20px; /* Větší mezery mezi buňkami */
text-align: left;
}
table th {
background-color: #f2f2f2; /* Trochu barevného pozadí pro názvy sloupců */
}
table tr:nth-child(even) {
background-color: #f9f9f9; /* Střídání řádků pro lepší přehlednost */
}
a {
text-decoration: none;
color: #007bff;
}
a:hover {
text-decoration: underline;
}
</style>
<table border="1">
<thead>
<tr>
<th>Id</th>
<th>Name</th>
<th>Course</th>
<th>Level</th>
<th>Email</th>
<th>Modul1</th>
<th>Modul2</th>
<th>Modul3</th>
</tr>
</thead>
<tbody>
{% for student in students %}
<tr>
<td>{{ student.id }}</td>
<td>{{ student.name }}</td>
<td>{{ student.course }}</td>
<td>{{ student.level }}</td>
<td>{{ student.email }}</td>
<td>{{ student.modul1 ? '✔' : '✖' }}</td>
<td>{{ student.modul2 ? '✔' : '✖' }}</td>
<td>{{ student.modul3 ? '✔' : '✖' }}</td>
<td>
<a href="{{ path('edit_student_info', {'id': student.id}) }}">Edit student info</a><br><br>
<a href="{{ path('remove_student', {'id': student.id}) }}"
onclick="return confirm('Do you really want to remove this student?');">Remove student</a>
</td>
</tr>
{% else %}
<tr>
<td colspan="8">No students</td>
</tr>
{% endfor %}
</tbody>
</table>
<br><a href="{{ path('mainpage') }}">Back to main page</a>
{% endblock %}
{% extends 'base.html.twig' %}
{% block body %}
<div class="row">
<div class="col-lg-12">
<h1>{{ title }}</h1>
{{ form(form) }}
</div>
</div>
{% endblock %}
{% block stylesheets %}{% endblock %}
{% block javascripts %}{% endblock %}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment