<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>{% block title %}Corepetitus{% endblock %}</title>
{% for css_file in encore_entry_css_files('app') %}
<link rel="stylesheet" href="{{ css_file }}?v=5.1"/>
{% endfor %}
<link rel="manifest" href="/manifest.json">
<link rel="mask-icon" href="{{ asset('assets/images/safari-pinned-tab.svg') }}" color="#1b6690">
<link rel="icon" href="{{ asset('assets/images/core-logo-min.png') }}" type="image/png">
<meta name="msapplication-TileColor" content="#2d89ef">
<meta name="msapplication-config" content="{{ asset('/browserconfig.xml') }}">
<meta name="theme-color" content="#2d89ef">
{% block stylesheets %}
<style>
#loader {
transition: all 0.3s ease-in-out;
opacity: 1;
visibility: visible;
position: fixed;
height: 100vh;
width: 100%;
background: #fff;
z-index: 90000;
}
#loader.fadeOut {
opacity: 0;
visibility: hidden;
}
.spinner {
width: 40px;
height: 40px;
position: absolute;
top: calc(50% - 20px);
left: calc(50% - 20px);
background-color: #333;
border-radius: 100%;
-webkit-animation: sk-scaleout 1.0s infinite ease-in-out;
animation: sk-scaleout 1.0s infinite ease-in-out;
}
@-webkit-keyframes sk-scaleout {
0% {
-webkit-transform: scale(0)
}
100% {
-webkit-transform: scale(1.0);
opacity: 0;
}
}
@keyframes sk-scaleout {
0% {
-webkit-transform: scale(0);
transform: scale(0);
}
100% {
-webkit-transform: scale(1.0);
transform: scale(1.0);
opacity: 0;
}
}
</style>
{% endblock %}
</head>
<body class="{% block bodyclass %}app{% endblock %}">
<!-- @TOC -->
<!-- =================================================== -->
<!--
+ @Page Loader
+ @App Content
- #Left Sidebar
> $Sidebar Header
> $Sidebar Menu
- #Main
> $Topbar
> $App Screen Content
-->
<!-- @Page Loader -->
<!-- =================================================== -->
{% if app.environment != 'dev' %}
<div id='loader'>
<div class="spinner"></div>
</div>
{% endif %}
<!-- @App Content -->
<!-- =================================================== -->
{# <div class="{{ app.request.attributes.get('_route') }}"> #}
<div class="{% if is_granted('ROLE_GUARDIAN') or is_granted('ROLE_TEACHER') or is_granted('ROLE_CHILD') %}version_2{% endif %}">
<!-- ### Left side bar menu ### -->
{{ include('menu_components/side_menu/left_sidebar_menu_v2.html.twig') }}
<!-- #Main ============================ -->
{% if getInfoLines() is not empty %}
{% set infoLine = getInfoLines()|first %}
{% if is_granted('ROLE_TEACHER') and app.user.id == 517%}
{% else %}
<div class="wrapperrunngline">
<div class="marquee">
{% for i in 0..20 %}
<a target="_blank"
href="{{ infoLine.link }}">
<img src="http://corepetitus.lt/wp-content/uploads/2024/10/favicon.svg" alt="corepetitus">
{{ infoLine.description|replace({" ": " "})|raw }}
</a>
{% endfor %}
</div>
</div>
{% endif %}
{% endif %}
<div class="page-container">
<!-- ### $Topbar ### -->
{% if is_granted('IS_IMPERSONATOR') %}
<div class="peer" style="bottom: 0;z-index: 10000;position: fixed;">
<a class="btn btn-success" href="{{ impersonation_exit_path(path('dashboard') ) }}">Grįžti į savo
sesiją</a>
</div>
{% endif %}
{{ include('menu_components/header_nav_bar/header_nav_bar_new.html.twig') }}
<!-- ### $MainBody ### -->
{% block body %}
{% endblock %}
{% if is_granted("ROLE_TEACHER") and (survey_data is not defined or survey_data is empty) %}
{% set firstLessonSurveyData = getTeacherFirstLessonSurveyData() %}
{% if firstLessonSurveyData is not empty %}
{% include 'me/teacher/me_teacher_after_first_lesson_modal.html.twig' with {survey_data:firstLessonSurveyData} %}
{% endif %}
{% if show_preference_modal is defined and show_preference_modal %}
{% include 'me/teacher/me_teacher_auto_preferences_modal.html.twig'%}
{% endif %}
{% endif %}
{% if is_granted('ROLE_TEACHER') %}
{% if app.user.qrCode is null or app.user.qrCode.documentPath is null %}
{% include '/me/teacher/me_teacher_missing_qr_code_modal.html.twig' %}
{% endif %}
{% set lastLessonSurveyData = getTeacherLastLessonSurveyData() %}
{% if lastLessonSurveyData is not empty %}
{% include 'me/teacher/me_teacher_after_last_lesson_modal.html.twig' with {survey_data:lastLessonSurveyData} %}
{% endif %}
{% endif %}
{% if is_granted("ROLE_ADMIN") %}
{{ render(controller(
'App\\Controller\\BugReport\\BugReportController::form'
)) }}
{% endif %}
<!-- ### $App Screen Footer ### -->
<footer style="background: #FFF" class="bdT ta-c p-30 lh-0 fsz-sm c-grey-600">
<span>2026 Copyright © COREPETITUS.LT</span>
</footer>
</div>
</div>
{% set allowed_ips = ['84.15.151.106', '83.181.124.158', '78.56.131.247'] %}
{% if is_granted('ROLE_GUARDIAN') or is_granted('ROLE_TEACHER') or is_granted('ROLE_CHILD') %}
{{ include('me/chat_widget.html.twig') }}
{% endif %}
<script>
(function () {
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('/assets/service-worker.js');
}
})();
window.addEventListener('load', function () {
const loader = document.getElementById('loader');
if (loader) {
setTimeout(function () {
loader.classList.add('fadeOut');
}, 300);
}
});
</script>
{% block javascripts %}
{# <script src="{{ asset('assets/runtime.js') }}?v=v3"></script>#}
{# <script src="{{ asset('assets/app.js') }}?v=v3"></script>#}
{% for js_file in encore_entry_js_files('app') %}
{% set src = js_file|replace({'<script src="': '', '"></script>': ''}) %}
<script src="{{ src }}?v=3"></script>
{% endfor %}
{% if is_granted('ROLE_GUARDIAN') or is_granted('ROLE_TEACHER') %}
<script>
const unreadNotifs = {{ getUserNotificationCount() }};
if (unreadNotifs > 0 && !getCookie('ceNModal') && !window.location.href.includes('notifications')) {
Swal.fire({
html: `
<div class='card blue'>
<div class='card-body'>
<div class="icon">
<i style="font-size: 24px;
margin-bottom: 15px;" class="fa-solid fa-bell"></i>
</div>Svarbu! turi ${unreadNotifs} neperskaitytus pranešimus!</div>
</div>`,
showCancelButton: true,
confirmButtonColor: "#1AB2FE",
cancelButtonColor: "#d33",
confirmButtonText: "Peržiūrėti",
cancelButtonText: "Priminti vėliau",
customClass: {
container: "version_2",
icon: 'border-0'
}
}).then((result) => {
if (result.isConfirmed) {
setCookie('ceNModal', true, 30);
window.location = `{{ path('app_me_notification_index') }}`;
} else {
setCookie('ceNModal', true, 30);
}
})
}
</script>
{% endif %}
{% if is_granted('ROLE_TEACHER') and teacherHasLessonsToday() %}
<script>
(function () {
const storageKey = 'teacherLessonReviewReminder';
function getNextResetAt8AM() {
const now = new Date();
const reset = new Date(now);
reset.setHours(8, 0, 0, 0);
if (now.getTime() >= reset.getTime()) {
reset.setDate(reset.getDate() + 1);
}
return reset.getTime();
}
const storedUntil = parseInt(localStorage.getItem(storageKey) || '0', 10);
if (Date.now() < storedUntil) {
return;
}
localStorage.setItem(storageKey, String(getNextResetAt8AM()));
Swal.fire({
title: 'Primename',
customClass: "version_2",
html:`
<div class='card blue'>
<div class='card-body'>
<div class="icon">
<i style="font-size: 24px;
margin-bottom: 15px;" class="fa-solid fa-bell"></i>
</div>Mokiniai jus vertina po kiekvienos pamokos.</div>
</div>
`,
confirmButtonText: 'Ok',
});
})();
</script>
{% endif %}
{% if is_granted('ROLE_CHILD') %}
{% set childLessonReminder = getChildClosestLessonReminder() %}
{% if childLessonReminder %}
{% set childLessonReviewModalHtml %}
{% include 'child_lesson_review/_review_modal_content.html.twig' with {lesson: childLessonReminder} %}
{% endset %}
<script>
(function () {
const lesson = {{ childLessonReminder|json_encode|raw }};
const submitUrl = '{{ path('app_child_lesson_review_submit') }}';
const dismissUrl = '{{ path('app_child_lesson_review_dismiss') }}';
const originalTitle = document.title;
const alertTitle = '(1) Corepetitus įvertinimas';
let titleFlashTimer = null;
function startTitleFlash() {
if (titleFlashTimer) {
return;
}
let showAlert = false;
titleFlashTimer = setInterval(() => {
document.title = showAlert ? originalTitle : alertTitle;
showAlert = !showAlert;
}, 1000);
}
function stopTitleFlash() {
if (titleFlashTimer) {
clearInterval(titleFlashTimer);
titleFlashTimer = null;
}
document.title = originalTitle;
}
const now = Date.now();
const triggerAt = new Date(lesson.triggerAt).getTime();
const forceUntil = lesson.forceUntil ? new Date(lesson.forceUntil).getTime() : null;
if (forceUntil !== null && now >= forceUntil) {
return;
}
const fire = () => {
if (forceUntil !== null && Date.now() >= forceUntil) {
return;
}
startTitleFlash();
if (forceUntil !== null && forceUntil > Date.now()) {
setTimeout(stopTitleFlash, forceUntil - Date.now());
}
let selectedRating = null;
Swal.fire({
title: 'Įvertink pamoką',
customClass: { popup: 'version_2 child-lesson-review-swal' },
html: {{ childLessonReviewModalHtml|json_encode|raw }},
confirmButtonText: 'Pateikti',
confirmButtonColor: '#1AB2FE',
showCancelButton: false,
showCloseButton: true,
allowOutsideClick: false,
allowEscapeKey: false,
focusConfirm: false,
didOpen: () => {
document.querySelectorAll('.child-lesson-review-rating').forEach((btn) => {
btn.addEventListener('click', () => {
document.querySelectorAll('.child-lesson-review-rating').forEach((b) => b.classList.remove('is-selected'));
btn.classList.add('is-selected');
selectedRating = parseInt(btn.dataset.rating, 10);
});
});
},
preConfirm: () => {
if (!selectedRating) {
Swal.showValidationMessage('Pasirink įvertinimą');
return false;
}
const commentEl = document.getElementById('child-lesson-review-comment');
return {
rating: selectedRating,
comment: commentEl ? commentEl.value.trim() : '',
};
},
}).then(async (result) => {
if (result.dismiss) {
stopTitleFlash();
await fetch(dismissUrl, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ lessonId: lesson.lessonId }),
});
window.location.reload();
return;
}
if (!result.isConfirmed || !result.value) {
return;
}
try {
const response = await fetch(submitUrl, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
lessonId: lesson.lessonId,
rating: result.value.rating,
comment: result.value.comment,
}),
});
const data = await response.json();
if (!response.ok) {
throw new Error(data.message || 'Nepavyko išsaugoti');
}
stopTitleFlash();
await Swal.fire({
icon: 'success',
title: 'Ačiū!',
text: 'Jūsų atsiliepimas išsaugotas.',
confirmButtonText: 'Ok',
customClass: { popup: 'version_2' },
});
window.location.reload();
} catch (error) {
Swal.fire({
icon: 'error',
title: 'Klaida',
text: error.message || 'Nepavyko išsaugoti',
confirmButtonText: 'Ok',
customClass: { popup: 'version_2' },
});
}
});
};
if (now >= triggerAt) {
fire();
} else {
setTimeout(fire, triggerAt - now);
}
})();
</script>
{% endif %}
{% endif %}
{% endblock %}
</body>
</html>