var/cache/dev/twig/14/142baa4ac505d70c29c4096bfeb06bbc.php line 214

Open in your IDE?
  1. <?php
  2. use Twig\Environment;
  3. use Twig\Error\LoaderError;
  4. use Twig\Error\RuntimeError;
  5. use Twig\Extension\SandboxExtension;
  6. use Twig\Markup;
  7. use Twig\Sandbox\SecurityError;
  8. use Twig\Sandbox\SecurityNotAllowedTagError;
  9. use Twig\Sandbox\SecurityNotAllowedFilterError;
  10. use Twig\Sandbox\SecurityNotAllowedFunctionError;
  11. use Twig\Source;
  12. use Twig\Template;
  13. /* base.html.twig */
  14. class __TwigTemplate_34244db6dbe11d8b4ff1540d4bbb784f extends \Twig\Template
  15. {
  16. private $source;
  17. private $macros = [];
  18. public function __construct(Environment $env)
  19. {
  20. parent::__construct($env);
  21. $this->source = $this->getSourceContext();
  22. $this->parent = false;
  23. $this->blocks = [
  24. 'title' => [$this, 'block_title'],
  25. 'stylesheets' => [$this, 'block_stylesheets'],
  26. 'bodyclass' => [$this, 'block_bodyclass'],
  27. 'body' => [$this, 'block_body'],
  28. 'javascripts' => [$this, 'block_javascripts'],
  29. ];
  30. }
  31. protected function doDisplay(array $context, array $blocks = [])
  32. {
  33. $macros = $this->macros;
  34. $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  35. $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "base.html.twig"));
  36. $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  37. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "base.html.twig"));
  38. // line 1
  39. echo "<!DOCTYPE html>
  40. <html>
  41. <head>
  42. <meta charset=\"UTF-8\">
  43. <meta name=\"viewport\" content=\"width=device-width, initial-scale=1, shrink-to-fit=no\">
  44. <title>";
  45. // line 6
  46. $this->displayBlock('title', $context, $blocks);
  47. echo "</title>
  48. ";
  49. // line 7
  50. $context['_parent'] = $context;
  51. $context['_seq'] = twig_ensure_traversable($this->extensions['Symfony\WebpackEncoreBundle\Twig\EntryFilesTwigExtension']->getWebpackCssFiles("app"));
  52. foreach ($context['_seq'] as $context["_key"] => $context["css_file"]) {
  53. // line 8
  54. echo " <link rel=\"stylesheet\" href=\"";
  55. echo twig_escape_filter($this->env, $context["css_file"], "html", null, true);
  56. echo "?v=5.1\"/>
  57. ";
  58. }
  59. $_parent = $context['_parent'];
  60. unset($context['_seq'], $context['_iterated'], $context['_key'], $context['css_file'], $context['_parent'], $context['loop']);
  61. $context = array_intersect_key($context, $_parent) + $_parent;
  62. // line 10
  63. echo "
  64. <link rel=\"manifest\" href=\"/manifest.json\">
  65. <link rel=\"mask-icon\" href=\"";
  66. // line 12
  67. echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/images/safari-pinned-tab.svg"), "html", null, true);
  68. echo "\" color=\"#1b6690\">
  69. <link rel=\"icon\" href=\"";
  70. // line 13
  71. echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/images/core-logo-min.png"), "html", null, true);
  72. echo "\" type=\"image/png\">
  73. <meta name=\"msapplication-TileColor\" content=\"#2d89ef\">
  74. <meta name=\"msapplication-config\" content=\"";
  75. // line 15
  76. echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("/browserconfig.xml"), "html", null, true);
  77. echo "\">
  78. <meta name=\"theme-color\" content=\"#2d89ef\">
  79. ";
  80. // line 18
  81. $this->displayBlock('stylesheets', $context, $blocks);
  82. // line 71
  83. echo "</head>
  84. <body class=\"";
  85. // line 72
  86. $this->displayBlock('bodyclass', $context, $blocks);
  87. echo "\">
  88. <!-- @TOC -->
  89. <!-- =================================================== -->
  90. <!--
  91. + @Page Loader
  92. + @App Content
  93. - #Left Sidebar
  94. > \$Sidebar Header
  95. > \$Sidebar Menu
  96. - #Main
  97. > \$Topbar
  98. > \$App Screen Content
  99. -->
  100. <!-- @Page Loader -->
  101. <!-- =================================================== -->
  102. ";
  103. // line 89
  104. if ((twig_get_attribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 89, $this->source); })()), "environment", [], "any", false, false, false, 89) != "dev")) {
  105. // line 90
  106. echo " <div id='loader'>
  107. <div class=\"spinner\"></div>
  108. </div>
  109. ";
  110. }
  111. // line 94
  112. echo "
  113. <!-- @App Content -->
  114. <!-- =================================================== -->
  115. ";
  116. // line 98
  117. echo "
  118. <div class=\"";
  119. // line 99
  120. if ((($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_GUARDIAN") || $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_TEACHER")) || $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_CHILD"))) {
  121. echo "version_2";
  122. }
  123. echo "\">
  124. <!-- ### Left side bar menu ### -->
  125. ";
  126. // line 102
  127. echo twig_include($this->env, $context, "menu_components/side_menu/left_sidebar_menu_v2.html.twig");
  128. echo "
  129. <!-- #Main ============================ -->
  130. ";
  131. // line 104
  132. if ( !twig_test_empty($this->env->getRuntime('App\Twig\NotificationExtensionRuntime')->getInfoLines())) {
  133. // line 105
  134. echo " ";
  135. $context["infoLine"] = twig_first($this->env, $this->env->getRuntime('App\Twig\NotificationExtensionRuntime')->getInfoLines());
  136. // line 106
  137. echo " ";
  138. if (($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_TEACHER") && (twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 106, $this->source); })()), "user", [], "any", false, false, false, 106), "id", [], "any", false, false, false, 106) == 517))) {
  139. // line 107
  140. echo "
  141. ";
  142. } else {
  143. // line 109
  144. echo " <div class=\"wrapperrunngline\">
  145. <div class=\"marquee\">
  146. ";
  147. // line 111
  148. $context['_parent'] = $context;
  149. $context['_seq'] = twig_ensure_traversable(range(0, 20));
  150. foreach ($context['_seq'] as $context["_key"] => $context["i"]) {
  151. // line 112
  152. echo " <a target=\"_blank\"
  153. href=\"";
  154. // line 113
  155. echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["infoLine"]) || array_key_exists("infoLine", $context) ? $context["infoLine"] : (function () { throw new RuntimeError('Variable "infoLine" does not exist.', 113, $this->source); })()), "link", [], "any", false, false, false, 113), "html", null, true);
  156. echo "\">
  157. <img src=\"http://corepetitus.lt/wp-content/uploads/2024/10/favicon.svg\" alt=\"corepetitus\">
  158. ";
  159. // line 115
  160. echo twig_replace_filter(twig_get_attribute($this->env, $this->source, (isset($context["infoLine"]) || array_key_exists("infoLine", $context) ? $context["infoLine"] : (function () { throw new RuntimeError('Variable "infoLine" does not exist.', 115, $this->source); })()), "description", [], "any", false, false, false, 115), [" " => "&nbsp;"]);
  161. echo "
  162. </a>
  163. ";
  164. }
  165. $_parent = $context['_parent'];
  166. unset($context['_seq'], $context['_iterated'], $context['_key'], $context['i'], $context['_parent'], $context['loop']);
  167. $context = array_intersect_key($context, $_parent) + $_parent;
  168. // line 118
  169. echo " </div>
  170. </div>
  171. ";
  172. }
  173. // line 121
  174. echo "
  175. ";
  176. }
  177. // line 123
  178. echo "
  179. <div class=\"page-container\">
  180. <!-- ### \$Topbar ### -->
  181. ";
  182. // line 127
  183. if ($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("IS_IMPERSONATOR")) {
  184. // line 128
  185. echo " <div class=\"peer\" style=\"bottom: 0;z-index: 10000;position: fixed;\">
  186. <a class=\"btn btn-success\" href=\"";
  187. // line 129
  188. echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->getImpersonateExitPath($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("dashboard")), "html", null, true);
  189. echo "\">Grįžti į savo
  190. sesiją</a>
  191. </div>
  192. ";
  193. }
  194. // line 133
  195. echo "
  196. ";
  197. // line 136
  198. echo twig_include($this->env, $context, "menu_components/header_nav_bar/header_nav_bar_new.html.twig");
  199. echo "
  200. <!-- ### \$MainBody ### -->
  201. ";
  202. // line 139
  203. $this->displayBlock('body', $context, $blocks);
  204. // line 142
  205. echo " ";
  206. if (($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_TEACHER") && ( !array_key_exists("survey_data", $context) || twig_test_empty((isset($context["survey_data"]) || array_key_exists("survey_data", $context) ? $context["survey_data"] : (function () { throw new RuntimeError('Variable "survey_data" does not exist.', 142, $this->source); })()))))) {
  207. // line 143
  208. echo " ";
  209. $context["firstLessonSurveyData"] = $this->env->getRuntime('App\Twig\NotificationExtensionRuntime')->getTeacherFirstLessonSurveyData();
  210. // line 144
  211. echo " ";
  212. if ( !twig_test_empty((isset($context["firstLessonSurveyData"]) || array_key_exists("firstLessonSurveyData", $context) ? $context["firstLessonSurveyData"] : (function () { throw new RuntimeError('Variable "firstLessonSurveyData" does not exist.', 144, $this->source); })()))) {
  213. // line 145
  214. echo " ";
  215. $this->loadTemplate("me/teacher/me_teacher_after_first_lesson_modal.html.twig", "base.html.twig", 145)->display(twig_array_merge($context, ["survey_data" => (isset($context["firstLessonSurveyData"]) || array_key_exists("firstLessonSurveyData", $context) ? $context["firstLessonSurveyData"] : (function () { throw new RuntimeError('Variable "firstLessonSurveyData" does not exist.', 145, $this->source); })())]));
  216. // line 146
  217. echo " ";
  218. }
  219. // line 147
  220. echo " ";
  221. if ((array_key_exists("show_preference_modal", $context) && (isset($context["show_preference_modal"]) || array_key_exists("show_preference_modal", $context) ? $context["show_preference_modal"] : (function () { throw new RuntimeError('Variable "show_preference_modal" does not exist.', 147, $this->source); })()))) {
  222. // line 148
  223. echo " ";
  224. $this->loadTemplate("me/teacher/me_teacher_auto_preferences_modal.html.twig", "base.html.twig", 148)->display($context);
  225. // line 149
  226. echo " ";
  227. }
  228. // line 150
  229. echo " ";
  230. }
  231. // line 151
  232. echo "
  233. ";
  234. // line 152
  235. if ($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_TEACHER")) {
  236. // line 153
  237. echo " ";
  238. if (((null === twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 153, $this->source); })()), "user", [], "any", false, false, false, 153), "qrCode", [], "any", false, false, false, 153)) || (null === twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 153, $this->source); })()), "user", [], "any", false, false, false, 153), "qrCode", [], "any", false, false, false, 153), "documentPath", [], "any", false, false, false, 153)))) {
  239. // line 154
  240. echo " ";
  241. $this->loadTemplate("/me/teacher/me_teacher_missing_qr_code_modal.html.twig", "base.html.twig", 154)->display($context);
  242. // line 155
  243. echo " ";
  244. }
  245. // line 156
  246. echo " ";
  247. $context["lastLessonSurveyData"] = $this->env->getRuntime('App\Twig\NotificationExtensionRuntime')->getTeacherLastLessonSurveyData();
  248. // line 157
  249. echo " ";
  250. if ( !twig_test_empty((isset($context["lastLessonSurveyData"]) || array_key_exists("lastLessonSurveyData", $context) ? $context["lastLessonSurveyData"] : (function () { throw new RuntimeError('Variable "lastLessonSurveyData" does not exist.', 157, $this->source); })()))) {
  251. // line 158
  252. echo " ";
  253. $this->loadTemplate("me/teacher/me_teacher_after_last_lesson_modal.html.twig", "base.html.twig", 158)->display(twig_array_merge($context, ["survey_data" => (isset($context["lastLessonSurveyData"]) || array_key_exists("lastLessonSurveyData", $context) ? $context["lastLessonSurveyData"] : (function () { throw new RuntimeError('Variable "lastLessonSurveyData" does not exist.', 158, $this->source); })())]));
  254. // line 159
  255. echo " ";
  256. }
  257. // line 160
  258. echo " ";
  259. }
  260. // line 161
  261. echo "
  262. ";
  263. // line 162
  264. if ($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_ADMIN")) {
  265. // line 163
  266. echo " ";
  267. echo $this->env->getRuntime('Symfony\Bridge\Twig\Extension\HttpKernelRuntime')->renderFragment(Symfony\Bridge\Twig\Extension\HttpKernelExtension::controller("App\\Controller\\BugReport\\BugReportController::form"));
  268. // line 165
  269. echo "
  270. ";
  271. }
  272. // line 167
  273. echo " <!-- ### \$App Screen Footer ### -->
  274. <footer style=\"background: #FFF\" class=\"bdT ta-c p-30 lh-0 fsz-sm c-grey-600\">
  275. <span>2026 Copyright © COREPETITUS.LT</span>
  276. </footer>
  277. </div>
  278. </div>
  279. ";
  280. // line 173
  281. $context["allowed_ips"] = [0 => "84.15.151.106", 1 => "83.181.124.158", 2 => "78.56.131.247"];
  282. // line 174
  283. echo "
  284. ";
  285. // line 175
  286. if ((($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_GUARDIAN") || $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_TEACHER")) || $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_CHILD"))) {
  287. // line 176
  288. echo " ";
  289. echo twig_include($this->env, $context, "me/chat_widget.html.twig");
  290. echo "
  291. ";
  292. }
  293. // line 178
  294. echo "
  295. <script>
  296. (function () {
  297. if ('serviceWorker' in navigator) {
  298. navigator.serviceWorker.register('/assets/service-worker.js');
  299. }
  300. })();
  301. window.addEventListener('load', function () {
  302. const loader = document.getElementById('loader');
  303. if (loader) {
  304. setTimeout(function () {
  305. loader.classList.add('fadeOut');
  306. }, 300);
  307. }
  308. });
  309. </script>
  310. ";
  311. // line 195
  312. $this->displayBlock('javascripts', $context, $blocks);
  313. // line 423
  314. echo "
  315. </body>
  316. </html>
  317. ";
  318. $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  319. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  320. }
  321. // line 6
  322. public function block_title($context, array $blocks = [])
  323. {
  324. $macros = $this->macros;
  325. $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  326. $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "title"));
  327. $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  328. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "title"));
  329. echo "Corepetitus";
  330. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  331. $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  332. }
  333. // line 18
  334. public function block_stylesheets($context, array $blocks = [])
  335. {
  336. $macros = $this->macros;
  337. $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  338. $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "stylesheets"));
  339. $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  340. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "stylesheets"));
  341. // line 19
  342. echo " <style>
  343. #loader {
  344. transition: all 0.3s ease-in-out;
  345. opacity: 1;
  346. visibility: visible;
  347. position: fixed;
  348. height: 100vh;
  349. width: 100%;
  350. background: #fff;
  351. z-index: 90000;
  352. }
  353. #loader.fadeOut {
  354. opacity: 0;
  355. visibility: hidden;
  356. }
  357. .spinner {
  358. width: 40px;
  359. height: 40px;
  360. position: absolute;
  361. top: calc(50% - 20px);
  362. left: calc(50% - 20px);
  363. background-color: #333;
  364. border-radius: 100%;
  365. -webkit-animation: sk-scaleout 1.0s infinite ease-in-out;
  366. animation: sk-scaleout 1.0s infinite ease-in-out;
  367. }
  368. @-webkit-keyframes sk-scaleout {
  369. 0% {
  370. -webkit-transform: scale(0)
  371. }
  372. 100% {
  373. -webkit-transform: scale(1.0);
  374. opacity: 0;
  375. }
  376. }
  377. @keyframes sk-scaleout {
  378. 0% {
  379. -webkit-transform: scale(0);
  380. transform: scale(0);
  381. }
  382. 100% {
  383. -webkit-transform: scale(1.0);
  384. transform: scale(1.0);
  385. opacity: 0;
  386. }
  387. }
  388. </style>
  389. ";
  390. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  391. $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  392. }
  393. // line 72
  394. public function block_bodyclass($context, array $blocks = [])
  395. {
  396. $macros = $this->macros;
  397. $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  398. $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "bodyclass"));
  399. $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  400. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "bodyclass"));
  401. echo "app";
  402. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  403. $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  404. }
  405. // line 139
  406. public function block_body($context, array $blocks = [])
  407. {
  408. $macros = $this->macros;
  409. $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  410. $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "body"));
  411. $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  412. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "body"));
  413. // line 140
  414. echo "
  415. ";
  416. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  417. $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  418. }
  419. // line 195
  420. public function block_javascripts($context, array $blocks = [])
  421. {
  422. $macros = $this->macros;
  423. $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  424. $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "javascripts"));
  425. $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  426. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "javascripts"));
  427. // line 198
  428. echo "
  429. ";
  430. // line 199
  431. $context['_parent'] = $context;
  432. $context['_seq'] = twig_ensure_traversable($this->extensions['Symfony\WebpackEncoreBundle\Twig\EntryFilesTwigExtension']->getWebpackJsFiles("app"));
  433. foreach ($context['_seq'] as $context["_key"] => $context["js_file"]) {
  434. // line 200
  435. echo " ";
  436. $context["src"] = twig_replace_filter($context["js_file"], ["<script src=\"" => "", "\"></script>" => ""]);
  437. // line 201
  438. echo " <script src=\"";
  439. echo twig_escape_filter($this->env, (isset($context["src"]) || array_key_exists("src", $context) ? $context["src"] : (function () { throw new RuntimeError('Variable "src" does not exist.', 201, $this->source); })()), "html", null, true);
  440. echo "?v=3\"></script>
  441. ";
  442. }
  443. $_parent = $context['_parent'];
  444. unset($context['_seq'], $context['_iterated'], $context['_key'], $context['js_file'], $context['_parent'], $context['loop']);
  445. $context = array_intersect_key($context, $_parent) + $_parent;
  446. // line 203
  447. echo "
  448. ";
  449. // line 204
  450. if (($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_GUARDIAN") || $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_TEACHER"))) {
  451. // line 205
  452. echo " <script>
  453. const unreadNotifs = ";
  454. // line 206
  455. echo twig_escape_filter($this->env, $this->env->getRuntime('App\Twig\NotificationExtensionRuntime')->getUserNotificationCount(), "html", null, true);
  456. echo ";
  457. if (unreadNotifs > 0 && !getCookie('ceNModal') && !window.location.href.includes('notifications')) {
  458. Swal.fire({
  459. html: `
  460. <div class='card blue'>
  461. <div class='card-body'>
  462. <div class=\"icon\">
  463. <i style=\"font-size: 24px;
  464. margin-bottom: 15px;\" class=\"fa-solid fa-bell\"></i>
  465. </div>Svarbu! turi \${unreadNotifs} neperskaitytus pranešimus!</div>
  466. </div>`,
  467. showCancelButton: true,
  468. confirmButtonColor: \"#1AB2FE\",
  469. cancelButtonColor: \"#d33\",
  470. confirmButtonText: \"Peržiūrėti\",
  471. cancelButtonText: \"Priminti vėliau\",
  472. customClass: {
  473. container: \"version_2\",
  474. icon: 'border-0'
  475. }
  476. }).then((result) => {
  477. if (result.isConfirmed) {
  478. setCookie('ceNModal', true, 30);
  479. window.location = `";
  480. // line 229
  481. echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("app_me_notification_index");
  482. echo "`;
  483. } else {
  484. setCookie('ceNModal', true, 30);
  485. }
  486. })
  487. }
  488. </script>
  489. ";
  490. }
  491. // line 237
  492. echo "\t";
  493. if (($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_TEACHER") && $this->extensions['App\Twig\TeacherHasLessonsExtension']->teacherHasLessonsToday())) {
  494. // line 238
  495. echo " <script>
  496. (function () {
  497. const storageKey = 'teacherLessonReviewReminder';
  498. function getNextResetAt8AM() {
  499. const now = new Date();
  500. const reset = new Date(now);
  501. reset.setHours(8, 0, 0, 0);
  502. if (now.getTime() >= reset.getTime()) {
  503. reset.setDate(reset.getDate() + 1);
  504. }
  505. return reset.getTime();
  506. }
  507. const storedUntil = parseInt(localStorage.getItem(storageKey) || '0', 10);
  508. if (Date.now() < storedUntil) {
  509. return;
  510. }
  511. localStorage.setItem(storageKey, String(getNextResetAt8AM()));
  512. Swal.fire({
  513. title: 'Primename',
  514. customClass: \"version_2\",
  515. html:`
  516. <div class='card blue'>
  517. <div class='card-body'>
  518. <div class=\"icon\">
  519. <i style=\"font-size: 24px;
  520. margin-bottom: 15px;\" class=\"fa-solid fa-bell\"></i>
  521. </div>Mokiniai jus vertina po kiekvienos pamokos.</div>
  522. </div>
  523. `,
  524. confirmButtonText: 'Ok',
  525. });
  526. })();
  527. </script>
  528. ";
  529. }
  530. // line 275
  531. echo "\t
  532. \t";
  533. // line 276
  534. if ($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_CHILD")) {
  535. // line 277
  536. echo " ";
  537. $context["childLessonReminder"] = $this->extensions['App\Twig\ChildLessonReminderExtension']->getChildClosestLessonReminder();
  538. // line 278
  539. echo "
  540. ";
  541. // line 279
  542. if ((isset($context["childLessonReminder"]) || array_key_exists("childLessonReminder", $context) ? $context["childLessonReminder"] : (function () { throw new RuntimeError('Variable "childLessonReminder" does not exist.', 279, $this->source); })())) {
  543. // line 280
  544. echo " ";
  545. ob_start();
  546. echo "
  547. ";
  548. // line 281
  549. $this->loadTemplate("child_lesson_review/_review_modal_content.html.twig", "base.html.twig", 281)->display(twig_array_merge($context, ["lesson" => (isset($context["childLessonReminder"]) || array_key_exists("childLessonReminder", $context) ? $context["childLessonReminder"] : (function () { throw new RuntimeError('Variable "childLessonReminder" does not exist.', 281, $this->source); })())]));
  550. // line 282
  551. echo " ";
  552. $context["childLessonReviewModalHtml"] = ('' === $tmp = ob_get_clean()) ? '' : new Markup($tmp, $this->env->getCharset());
  553. // line 283
  554. echo " <script>
  555. (function () {
  556. const lesson = ";
  557. // line 285
  558. echo json_encode((isset($context["childLessonReminder"]) || array_key_exists("childLessonReminder", $context) ? $context["childLessonReminder"] : (function () { throw new RuntimeError('Variable "childLessonReminder" does not exist.', 285, $this->source); })()));
  559. echo ";
  560. const submitUrl = '";
  561. // line 286
  562. echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("app_child_lesson_review_submit");
  563. echo "';
  564. const dismissUrl = '";
  565. // line 287
  566. echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("app_child_lesson_review_dismiss");
  567. echo "';
  568. const originalTitle = document.title;
  569. const alertTitle = '(1) Corepetitus įvertinimas';
  570. let titleFlashTimer = null;
  571. function startTitleFlash() {
  572. if (titleFlashTimer) {
  573. return;
  574. }
  575. let showAlert = false;
  576. titleFlashTimer = setInterval(() => {
  577. document.title = showAlert ? originalTitle : alertTitle;
  578. showAlert = !showAlert;
  579. }, 1000);
  580. }
  581. function stopTitleFlash() {
  582. if (titleFlashTimer) {
  583. clearInterval(titleFlashTimer);
  584. titleFlashTimer = null;
  585. }
  586. document.title = originalTitle;
  587. }
  588. const now = Date.now();
  589. const triggerAt = new Date(lesson.triggerAt).getTime();
  590. const forceUntil = lesson.forceUntil ? new Date(lesson.forceUntil).getTime() : null;
  591. if (forceUntil !== null && now >= forceUntil) {
  592. return;
  593. }
  594. const fire = () => {
  595. if (forceUntil !== null && Date.now() >= forceUntil) {
  596. return;
  597. }
  598. startTitleFlash();
  599. if (forceUntil !== null && forceUntil > Date.now()) {
  600. setTimeout(stopTitleFlash, forceUntil - Date.now());
  601. }
  602. let selectedRating = null;
  603. Swal.fire({
  604. title: 'Įvertink pamoką',
  605. customClass: { popup: 'version_2 child-lesson-review-swal' },
  606. html: ";
  607. // line 334
  608. echo json_encode((isset($context["childLessonReviewModalHtml"]) || array_key_exists("childLessonReviewModalHtml", $context) ? $context["childLessonReviewModalHtml"] : (function () { throw new RuntimeError('Variable "childLessonReviewModalHtml" does not exist.', 334, $this->source); })()));
  609. echo ",
  610. confirmButtonText: 'Pateikti',
  611. confirmButtonColor: '#1AB2FE',
  612. showCancelButton: false,
  613. showCloseButton: true,
  614. allowOutsideClick: false,
  615. allowEscapeKey: false,
  616. focusConfirm: false,
  617. didOpen: () => {
  618. document.querySelectorAll('.child-lesson-review-rating').forEach((btn) => {
  619. btn.addEventListener('click', () => {
  620. document.querySelectorAll('.child-lesson-review-rating').forEach((b) => b.classList.remove('is-selected'));
  621. btn.classList.add('is-selected');
  622. selectedRating = parseInt(btn.dataset.rating, 10);
  623. });
  624. });
  625. },
  626. preConfirm: () => {
  627. if (!selectedRating) {
  628. Swal.showValidationMessage('Pasirink įvertinimą');
  629. return false;
  630. }
  631. const commentEl = document.getElementById('child-lesson-review-comment');
  632. return {
  633. rating: selectedRating,
  634. comment: commentEl ? commentEl.value.trim() : '',
  635. };
  636. },
  637. }).then(async (result) => {
  638. if (result.dismiss) {
  639. stopTitleFlash();
  640. await fetch(dismissUrl, {
  641. method: 'POST',
  642. headers: { 'Content-Type': 'application/json' },
  643. body: JSON.stringify({ lessonId: lesson.lessonId }),
  644. });
  645. window.location.reload();
  646. return;
  647. }
  648. if (!result.isConfirmed || !result.value) {
  649. return;
  650. }
  651. try {
  652. const response = await fetch(submitUrl, {
  653. method: 'POST',
  654. headers: { 'Content-Type': 'application/json' },
  655. body: JSON.stringify({
  656. lessonId: lesson.lessonId,
  657. rating: result.value.rating,
  658. comment: result.value.comment,
  659. }),
  660. });
  661. const data = await response.json();
  662. if (!response.ok) {
  663. throw new Error(data.message || 'Nepavyko išsaugoti');
  664. }
  665. stopTitleFlash();
  666. await Swal.fire({
  667. icon: 'success',
  668. title: 'Ačiū!',
  669. text: 'Jūsų atsiliepimas išsaugotas.',
  670. confirmButtonText: 'Ok',
  671. customClass: { popup: 'version_2' },
  672. });
  673. window.location.reload();
  674. } catch (error) {
  675. Swal.fire({
  676. icon: 'error',
  677. title: 'Klaida',
  678. text: error.message || 'Nepavyko išsaugoti',
  679. confirmButtonText: 'Ok',
  680. customClass: { popup: 'version_2' },
  681. });
  682. }
  683. });
  684. };
  685. if (now >= triggerAt) {
  686. fire();
  687. } else {
  688. setTimeout(fire, triggerAt - now);
  689. }
  690. })();
  691. </script>
  692. ";
  693. }
  694. // line 421
  695. echo " ";
  696. }
  697. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  698. $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  699. }
  700. public function getTemplateName()
  701. {
  702. return "base.html.twig";
  703. }
  704. public function isTraitable()
  705. {
  706. return false;
  707. }
  708. public function getDebugInfo()
  709. {
  710. return array ( 766 => 421, 676 => 334, 626 => 287, 622 => 286, 618 => 285, 614 => 283, 611 => 282, 609 => 281, 604 => 280, 602 => 279, 599 => 278, 596 => 277, 594 => 276, 591 => 275, 552 => 238, 549 => 237, 538 => 229, 512 => 206, 509 => 205, 507 => 204, 504 => 203, 495 => 201, 492 => 200, 488 => 199, 485 => 198, 475 => 195, 464 => 140, 454 => 139, 435 => 72, 374 => 19, 364 => 18, 345 => 6, 332 => 423, 330 => 195, 311 => 178, 305 => 176, 303 => 175, 300 => 174, 298 => 173, 290 => 167, 286 => 165, 283 => 163, 281 => 162, 278 => 161, 275 => 160, 272 => 159, 269 => 158, 266 => 157, 263 => 156, 260 => 155, 257 => 154, 254 => 153, 252 => 152, 249 => 151, 246 => 150, 243 => 149, 240 => 148, 237 => 147, 234 => 146, 231 => 145, 228 => 144, 225 => 143, 222 => 142, 220 => 139, 214 => 136, 209 => 133, 202 => 129, 199 => 128, 197 => 127, 191 => 123, 187 => 121, 182 => 118, 173 => 115, 168 => 113, 165 => 112, 161 => 111, 157 => 109, 153 => 107, 150 => 106, 147 => 105, 145 => 104, 140 => 102, 132 => 99, 129 => 98, 124 => 94, 118 => 90, 116 => 89, 96 => 72, 93 => 71, 91 => 18, 85 => 15, 80 => 13, 76 => 12, 72 => 10, 63 => 8, 59 => 7, 55 => 6, 48 => 1,);
  711. }
  712. public function getSourceContext()
  713. {
  714. return new Source("<!DOCTYPE html>
  715. <html>
  716. <head>
  717. <meta charset=\"UTF-8\">
  718. <meta name=\"viewport\" content=\"width=device-width, initial-scale=1, shrink-to-fit=no\">
  719. <title>{% block title %}Corepetitus{% endblock %}</title>
  720. {% for css_file in encore_entry_css_files('app') %}
  721. <link rel=\"stylesheet\" href=\"{{ css_file }}?v=5.1\"/>
  722. {% endfor %}
  723. <link rel=\"manifest\" href=\"/manifest.json\">
  724. <link rel=\"mask-icon\" href=\"{{ asset('assets/images/safari-pinned-tab.svg') }}\" color=\"#1b6690\">
  725. <link rel=\"icon\" href=\"{{ asset('assets/images/core-logo-min.png') }}\" type=\"image/png\">
  726. <meta name=\"msapplication-TileColor\" content=\"#2d89ef\">
  727. <meta name=\"msapplication-config\" content=\"{{ asset('/browserconfig.xml') }}\">
  728. <meta name=\"theme-color\" content=\"#2d89ef\">
  729. {% block stylesheets %}
  730. <style>
  731. #loader {
  732. transition: all 0.3s ease-in-out;
  733. opacity: 1;
  734. visibility: visible;
  735. position: fixed;
  736. height: 100vh;
  737. width: 100%;
  738. background: #fff;
  739. z-index: 90000;
  740. }
  741. #loader.fadeOut {
  742. opacity: 0;
  743. visibility: hidden;
  744. }
  745. .spinner {
  746. width: 40px;
  747. height: 40px;
  748. position: absolute;
  749. top: calc(50% - 20px);
  750. left: calc(50% - 20px);
  751. background-color: #333;
  752. border-radius: 100%;
  753. -webkit-animation: sk-scaleout 1.0s infinite ease-in-out;
  754. animation: sk-scaleout 1.0s infinite ease-in-out;
  755. }
  756. @-webkit-keyframes sk-scaleout {
  757. 0% {
  758. -webkit-transform: scale(0)
  759. }
  760. 100% {
  761. -webkit-transform: scale(1.0);
  762. opacity: 0;
  763. }
  764. }
  765. @keyframes sk-scaleout {
  766. 0% {
  767. -webkit-transform: scale(0);
  768. transform: scale(0);
  769. }
  770. 100% {
  771. -webkit-transform: scale(1.0);
  772. transform: scale(1.0);
  773. opacity: 0;
  774. }
  775. }
  776. </style>
  777. {% endblock %}
  778. </head>
  779. <body class=\"{% block bodyclass %}app{% endblock %}\">
  780. <!-- @TOC -->
  781. <!-- =================================================== -->
  782. <!--
  783. + @Page Loader
  784. + @App Content
  785. - #Left Sidebar
  786. > \$Sidebar Header
  787. > \$Sidebar Menu
  788. - #Main
  789. > \$Topbar
  790. > \$App Screen Content
  791. -->
  792. <!-- @Page Loader -->
  793. <!-- =================================================== -->
  794. {% if app.environment != 'dev' %}
  795. <div id='loader'>
  796. <div class=\"spinner\"></div>
  797. </div>
  798. {% endif %}
  799. <!-- @App Content -->
  800. <!-- =================================================== -->
  801. {# <div class=\"{{ app.request.attributes.get('_route') }}\"> #}
  802. <div class=\"{% if is_granted('ROLE_GUARDIAN') or is_granted('ROLE_TEACHER') or is_granted('ROLE_CHILD') %}version_2{% endif %}\">
  803. <!-- ### Left side bar menu ### -->
  804. {{ include('menu_components/side_menu/left_sidebar_menu_v2.html.twig') }}
  805. <!-- #Main ============================ -->
  806. {% if getInfoLines() is not empty %}
  807. {% set infoLine = getInfoLines()|first %}
  808. {% if is_granted('ROLE_TEACHER') and app.user.id == 517%}
  809. {% else %}
  810. <div class=\"wrapperrunngline\">
  811. <div class=\"marquee\">
  812. {% for i in 0..20 %}
  813. <a target=\"_blank\"
  814. href=\"{{ infoLine.link }}\">
  815. <img src=\"http://corepetitus.lt/wp-content/uploads/2024/10/favicon.svg\" alt=\"corepetitus\">
  816. {{ infoLine.description|replace({\" \": \"&nbsp;\"})|raw }}
  817. </a>
  818. {% endfor %}
  819. </div>
  820. </div>
  821. {% endif %}
  822. {% endif %}
  823. <div class=\"page-container\">
  824. <!-- ### \$Topbar ### -->
  825. {% if is_granted('IS_IMPERSONATOR') %}
  826. <div class=\"peer\" style=\"bottom: 0;z-index: 10000;position: fixed;\">
  827. <a class=\"btn btn-success\" href=\"{{ impersonation_exit_path(path('dashboard') ) }}\">Grįžti į savo
  828. sesiją</a>
  829. </div>
  830. {% endif %}
  831. {{ include('menu_components/header_nav_bar/header_nav_bar_new.html.twig') }}
  832. <!-- ### \$MainBody ### -->
  833. {% block body %}
  834. {% endblock %}
  835. {% if is_granted(\"ROLE_TEACHER\") and (survey_data is not defined or survey_data is empty) %}
  836. {% set firstLessonSurveyData = getTeacherFirstLessonSurveyData() %}
  837. {% if firstLessonSurveyData is not empty %}
  838. {% include 'me/teacher/me_teacher_after_first_lesson_modal.html.twig' with {survey_data:firstLessonSurveyData} %}
  839. {% endif %}
  840. {% if show_preference_modal is defined and show_preference_modal %}
  841. {% include 'me/teacher/me_teacher_auto_preferences_modal.html.twig'%}
  842. {% endif %}
  843. {% endif %}
  844. {% if is_granted('ROLE_TEACHER') %}
  845. {% if app.user.qrCode is null or app.user.qrCode.documentPath is null %}
  846. {% include '/me/teacher/me_teacher_missing_qr_code_modal.html.twig' %}
  847. {% endif %}
  848. {% set lastLessonSurveyData = getTeacherLastLessonSurveyData() %}
  849. {% if lastLessonSurveyData is not empty %}
  850. {% include 'me/teacher/me_teacher_after_last_lesson_modal.html.twig' with {survey_data:lastLessonSurveyData} %}
  851. {% endif %}
  852. {% endif %}
  853. {% if is_granted(\"ROLE_ADMIN\") %}
  854. {{ render(controller(
  855. 'App\\\\Controller\\\\BugReport\\\\BugReportController::form'
  856. )) }}
  857. {% endif %}
  858. <!-- ### \$App Screen Footer ### -->
  859. <footer style=\"background: #FFF\" class=\"bdT ta-c p-30 lh-0 fsz-sm c-grey-600\">
  860. <span>2026 Copyright © COREPETITUS.LT</span>
  861. </footer>
  862. </div>
  863. </div>
  864. {% set allowed_ips = ['84.15.151.106', '83.181.124.158', '78.56.131.247'] %}
  865. {% if is_granted('ROLE_GUARDIAN') or is_granted('ROLE_TEACHER') or is_granted('ROLE_CHILD') %}
  866. {{ include('me/chat_widget.html.twig') }}
  867. {% endif %}
  868. <script>
  869. (function () {
  870. if ('serviceWorker' in navigator) {
  871. navigator.serviceWorker.register('/assets/service-worker.js');
  872. }
  873. })();
  874. window.addEventListener('load', function () {
  875. const loader = document.getElementById('loader');
  876. if (loader) {
  877. setTimeout(function () {
  878. loader.classList.add('fadeOut');
  879. }, 300);
  880. }
  881. });
  882. </script>
  883. {% block javascripts %}
  884. {# <script src=\"{{ asset('assets/runtime.js') }}?v=v3\"></script>#}
  885. {# <script src=\"{{ asset('assets/app.js') }}?v=v3\"></script>#}
  886. {% for js_file in encore_entry_js_files('app') %}
  887. {% set src = js_file|replace({'<script src=\"': '', '\"></script>': ''}) %}
  888. <script src=\"{{ src }}?v=3\"></script>
  889. {% endfor %}
  890. {% if is_granted('ROLE_GUARDIAN') or is_granted('ROLE_TEACHER') %}
  891. <script>
  892. const unreadNotifs = {{ getUserNotificationCount() }};
  893. if (unreadNotifs > 0 && !getCookie('ceNModal') && !window.location.href.includes('notifications')) {
  894. Swal.fire({
  895. html: `
  896. <div class='card blue'>
  897. <div class='card-body'>
  898. <div class=\"icon\">
  899. <i style=\"font-size: 24px;
  900. margin-bottom: 15px;\" class=\"fa-solid fa-bell\"></i>
  901. </div>Svarbu! turi \${unreadNotifs} neperskaitytus pranešimus!</div>
  902. </div>`,
  903. showCancelButton: true,
  904. confirmButtonColor: \"#1AB2FE\",
  905. cancelButtonColor: \"#d33\",
  906. confirmButtonText: \"Peržiūrėti\",
  907. cancelButtonText: \"Priminti vėliau\",
  908. customClass: {
  909. container: \"version_2\",
  910. icon: 'border-0'
  911. }
  912. }).then((result) => {
  913. if (result.isConfirmed) {
  914. setCookie('ceNModal', true, 30);
  915. window.location = `{{ path('app_me_notification_index') }}`;
  916. } else {
  917. setCookie('ceNModal', true, 30);
  918. }
  919. })
  920. }
  921. </script>
  922. {% endif %}
  923. \t{% if is_granted('ROLE_TEACHER') and teacherHasLessonsToday() %}
  924. <script>
  925. (function () {
  926. const storageKey = 'teacherLessonReviewReminder';
  927. function getNextResetAt8AM() {
  928. const now = new Date();
  929. const reset = new Date(now);
  930. reset.setHours(8, 0, 0, 0);
  931. if (now.getTime() >= reset.getTime()) {
  932. reset.setDate(reset.getDate() + 1);
  933. }
  934. return reset.getTime();
  935. }
  936. const storedUntil = parseInt(localStorage.getItem(storageKey) || '0', 10);
  937. if (Date.now() < storedUntil) {
  938. return;
  939. }
  940. localStorage.setItem(storageKey, String(getNextResetAt8AM()));
  941. Swal.fire({
  942. title: 'Primename',
  943. customClass: \"version_2\",
  944. html:`
  945. <div class='card blue'>
  946. <div class='card-body'>
  947. <div class=\"icon\">
  948. <i style=\"font-size: 24px;
  949. margin-bottom: 15px;\" class=\"fa-solid fa-bell\"></i>
  950. </div>Mokiniai jus vertina po kiekvienos pamokos.</div>
  951. </div>
  952. `,
  953. confirmButtonText: 'Ok',
  954. });
  955. })();
  956. </script>
  957. {% endif %}
  958. \t
  959. \t{% if is_granted('ROLE_CHILD') %}
  960. {% set childLessonReminder = getChildClosestLessonReminder() %}
  961. {% if childLessonReminder %}
  962. {% set childLessonReviewModalHtml %}
  963. {% include 'child_lesson_review/_review_modal_content.html.twig' with {lesson: childLessonReminder} %}
  964. {% endset %}
  965. <script>
  966. (function () {
  967. const lesson = {{ childLessonReminder|json_encode|raw }};
  968. const submitUrl = '{{ path('app_child_lesson_review_submit') }}';
  969. const dismissUrl = '{{ path('app_child_lesson_review_dismiss') }}';
  970. const originalTitle = document.title;
  971. const alertTitle = '(1) Corepetitus įvertinimas';
  972. let titleFlashTimer = null;
  973. function startTitleFlash() {
  974. if (titleFlashTimer) {
  975. return;
  976. }
  977. let showAlert = false;
  978. titleFlashTimer = setInterval(() => {
  979. document.title = showAlert ? originalTitle : alertTitle;
  980. showAlert = !showAlert;
  981. }, 1000);
  982. }
  983. function stopTitleFlash() {
  984. if (titleFlashTimer) {
  985. clearInterval(titleFlashTimer);
  986. titleFlashTimer = null;
  987. }
  988. document.title = originalTitle;
  989. }
  990. const now = Date.now();
  991. const triggerAt = new Date(lesson.triggerAt).getTime();
  992. const forceUntil = lesson.forceUntil ? new Date(lesson.forceUntil).getTime() : null;
  993. if (forceUntil !== null && now >= forceUntil) {
  994. return;
  995. }
  996. const fire = () => {
  997. if (forceUntil !== null && Date.now() >= forceUntil) {
  998. return;
  999. }
  1000. startTitleFlash();
  1001. if (forceUntil !== null && forceUntil > Date.now()) {
  1002. setTimeout(stopTitleFlash, forceUntil - Date.now());
  1003. }
  1004. let selectedRating = null;
  1005. Swal.fire({
  1006. title: 'Įvertink pamoką',
  1007. customClass: { popup: 'version_2 child-lesson-review-swal' },
  1008. html: {{ childLessonReviewModalHtml|json_encode|raw }},
  1009. confirmButtonText: 'Pateikti',
  1010. confirmButtonColor: '#1AB2FE',
  1011. showCancelButton: false,
  1012. showCloseButton: true,
  1013. allowOutsideClick: false,
  1014. allowEscapeKey: false,
  1015. focusConfirm: false,
  1016. didOpen: () => {
  1017. document.querySelectorAll('.child-lesson-review-rating').forEach((btn) => {
  1018. btn.addEventListener('click', () => {
  1019. document.querySelectorAll('.child-lesson-review-rating').forEach((b) => b.classList.remove('is-selected'));
  1020. btn.classList.add('is-selected');
  1021. selectedRating = parseInt(btn.dataset.rating, 10);
  1022. });
  1023. });
  1024. },
  1025. preConfirm: () => {
  1026. if (!selectedRating) {
  1027. Swal.showValidationMessage('Pasirink įvertinimą');
  1028. return false;
  1029. }
  1030. const commentEl = document.getElementById('child-lesson-review-comment');
  1031. return {
  1032. rating: selectedRating,
  1033. comment: commentEl ? commentEl.value.trim() : '',
  1034. };
  1035. },
  1036. }).then(async (result) => {
  1037. if (result.dismiss) {
  1038. stopTitleFlash();
  1039. await fetch(dismissUrl, {
  1040. method: 'POST',
  1041. headers: { 'Content-Type': 'application/json' },
  1042. body: JSON.stringify({ lessonId: lesson.lessonId }),
  1043. });
  1044. window.location.reload();
  1045. return;
  1046. }
  1047. if (!result.isConfirmed || !result.value) {
  1048. return;
  1049. }
  1050. try {
  1051. const response = await fetch(submitUrl, {
  1052. method: 'POST',
  1053. headers: { 'Content-Type': 'application/json' },
  1054. body: JSON.stringify({
  1055. lessonId: lesson.lessonId,
  1056. rating: result.value.rating,
  1057. comment: result.value.comment,
  1058. }),
  1059. });
  1060. const data = await response.json();
  1061. if (!response.ok) {
  1062. throw new Error(data.message || 'Nepavyko išsaugoti');
  1063. }
  1064. stopTitleFlash();
  1065. await Swal.fire({
  1066. icon: 'success',
  1067. title: 'Ačiū!',
  1068. text: 'Jūsų atsiliepimas išsaugotas.',
  1069. confirmButtonText: 'Ok',
  1070. customClass: { popup: 'version_2' },
  1071. });
  1072. window.location.reload();
  1073. } catch (error) {
  1074. Swal.fire({
  1075. icon: 'error',
  1076. title: 'Klaida',
  1077. text: error.message || 'Nepavyko išsaugoti',
  1078. confirmButtonText: 'Ok',
  1079. customClass: { popup: 'version_2' },
  1080. });
  1081. }
  1082. });
  1083. };
  1084. if (now >= triggerAt) {
  1085. fire();
  1086. } else {
  1087. setTimeout(fire, triggerAt - now);
  1088. }
  1089. })();
  1090. </script>
  1091. {% endif %}
  1092. {% endif %}
  1093. {% endblock %}
  1094. </body>
  1095. </html>
  1096. ", "base.html.twig", "/var/www/project/templates/base.html.twig");
  1097. }
  1098. }