var/cache/dev/twig/a6/a6e9e810dd2f0541ad095b609db3e70e.php line 318

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. /* menu_components/header_nav_bar/header_nav_bar_new.html.twig */
  14. class __TwigTemplate_10ce75542339d552838fb96c9037289a 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. 'stylesheets' => [$this, 'block_stylesheets'],
  25. 'javascripts' => [$this, 'block_javascripts'],
  26. ];
  27. $macros["_self"] = $this->macros["_self"] = $this;
  28. }
  29. protected function doDisplay(array $context, array $blocks = [])
  30. {
  31. $macros = $this->macros;
  32. $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  33. $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "menu_components/header_nav_bar/header_nav_bar_new.html.twig"));
  34. $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  35. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "menu_components/header_nav_bar/header_nav_bar_new.html.twig"));
  36. // line 1
  37. echo "<div class=\"header navbar\">
  38. <div class=\"header-container\">
  39. <ul class=\"nav-left\">
  40. <li>
  41. <a id='sidebar-toggle' class=\"sidebar-toggle\" href=\"javascript:void(0);\">
  42. <i class=\"fa-solid fa-bars\"></i>
  43. <i class=\"fa-solid fa-xmark\"></i>
  44. </a>
  45. <a class=\"sidebar-link mobile-logo\" href=\"";
  46. // line 9
  47. echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("dashboard");
  48. echo "\">
  49. <img src=\"";
  50. // line 10
  51. echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/images/core-logo-full.png"), "html", null, true);
  52. echo "\" alt=\"logo\"/>
  53. </a>
  54. </li>
  55. </ul>
  56. <ul class=\"nav-mid p-0\">
  57. <div class=\"header-lesson-list\">
  58. ";
  59. // line 16
  60. $context["lessonExtension"] = $this->env->getRuntime('App\Twig\NotificationExtensionRuntime')->getNewestLessons();
  61. // line 17
  62. echo " ";
  63. $context['_parent'] = $context;
  64. $context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, (isset($context["lessonExtension"]) || array_key_exists("lessonExtension", $context) ? $context["lessonExtension"] : (function () { throw new RuntimeError('Variable "lessonExtension" does not exist.', 17, $this->source); })()), "lessons", [], "any", false, false, false, 17));
  65. foreach ($context['_seq'] as $context["_key"] => $context["lesson"]) {
  66. // line 18
  67. echo " ";
  68. $context["wasOnline"] = (((twig_get_attribute($this->env, $this->source, $context["lesson"], "attendedAtTeacher", [], "any", false, false, false, 18) && twig_get_attribute($this->env, $this->source, $context["lesson"], "attendedAtChild", [], "any", false, false, false, 18))) ? (true) : (false));
  69. // line 19
  70. echo " <div class=\"card has-timer active h-100p \">
  71. <div class=\"card-body\">
  72. <div class=\"card-item h-100p\"
  73. data-start=\"";
  74. // line 22
  75. ((twig_get_attribute($this->env, $this->source, $context["lesson"], "startTime", [], "any", false, false, false, 22)) ? (print (twig_escape_filter($this->env, twig_date_format_filter($this->env, twig_get_attribute($this->env, $this->source, $context["lesson"], "startTime", [], "any", false, false, false, 22), "Y-m-d H:i"), "html", null, true))) : (print ("")));
  76. echo "\"
  77. data-end=\"";
  78. // line 23
  79. ((twig_get_attribute($this->env, $this->source, $context["lesson"], "endTime", [], "any", false, false, false, 23)) ? (print (twig_escape_filter($this->env, twig_date_format_filter($this->env, twig_get_attribute($this->env, $this->source, $context["lesson"], "endTime", [], "any", false, false, false, 23), "Y-m-d H:i"), "html", null, true))) : (print ("")));
  80. echo "\"
  81. data-lesson-id=\"";
  82. // line 24
  83. echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["lesson"], "id", [], "any", false, false, false, 24), "html", null, true);
  84. echo "\">
  85. <div class=\"discipline\">
  86. <div class=\"name\">";
  87. // line 26
  88. echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["lesson"], "discipline", [], "any", false, false, false, 26), "displayName", [], "any", false, false, false, 26), "html", null, true);
  89. echo "</div>
  90. </div>
  91. <div class=\"users ";
  92. // line 28
  93. echo (((isset($context["wasOnline"]) || array_key_exists("wasOnline", $context) ? $context["wasOnline"] : (function () { throw new RuntimeError('Variable "wasOnline" does not exist.', 28, $this->source); })())) ? ("was-joined") : (""));
  94. echo "\">
  95. <div class=\"teacher\">
  96. <div class=\"status\">
  97. <div class=\"box ";
  98. // line 31
  99. echo ((twig_get_attribute($this->env, $this->source, $context["lesson"], "statusTeacher", [], "any", false, false, false, 31)) ? ("joined") : ("not-joined"));
  100. echo "\"></div>
  101. </div>
  102. <div class=\"label-wrap\">
  103. <div class=\"text\">";
  104. // line 34
  105. echo $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Korepetitorius:", [], "messages");
  106. echo "</div>
  107. <div class=\"name\">";
  108. // line 35
  109. $context["name"] = twig_split_filter($this->env, twig_get_attribute($this->env, $this->source, $context["lesson"], "teacher", [], "any", false, false, false, 35), " ");
  110. echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["name"]) || array_key_exists("name", $context) ? $context["name"] : (function () { throw new RuntimeError('Variable "name" does not exist.', 35, $this->source); })()), 0, [], "array", false, false, false, 35), "html", null, true);
  111. echo "</div>
  112. </div>
  113. </div>
  114. <div class=\"student\">
  115. <div class=\"status\">
  116. <div class=\"box ";
  117. // line 40
  118. echo ((twig_get_attribute($this->env, $this->source, $context["lesson"], "statusChild", [], "any", false, false, false, 40)) ? ("joined") : ("not-joined"));
  119. echo "\"></div>
  120. </div>
  121. <div class=\"label-wrap\">
  122. <div class=\"text\">";
  123. // line 43
  124. echo $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Mokinys:", [], "messages");
  125. echo "</div>
  126. <div class=\"name\">";
  127. // line 44
  128. echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["lesson"], "child", [], "any", false, false, false, 44), "fullname", [], "any", false, false, false, 44), "html", null, true);
  129. echo "</div>
  130. </div>
  131. </div>
  132. </div>
  133. ";
  134. // line 49
  135. echo " ";
  136. // line 50
  137. echo " ";
  138. // line 51
  139. echo " ";
  140. // line 52
  141. echo " ";
  142. // line 53
  143. echo " ";
  144. // line 54
  145. echo " <div class=\"actions\">
  146. <div class=\"notice\"></div>
  147. <button class='btn btn-success join-lesson'
  148. ";
  149. // line 57
  150. echo ((twig_get_attribute($this->env, $this->source, $context["lesson"], "getLessonJoin", [], "method", false, false, false, 57)) ? ("") : ("disabled"));
  151. echo "
  152. data-href=\"";
  153. // line 58
  154. echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("unicko_router", ["id" => twig_get_attribute($this->env, $this->source, $context["lesson"], "id", [], "any", false, false, false, 58)]), "html", null, true);
  155. echo "\">
  156. Jungtis
  157. </button>
  158. </div>
  159. </div>
  160. </div>
  161. </div>
  162. ";
  163. }
  164. $_parent = $context['_parent'];
  165. unset($context['_seq'], $context['_iterated'], $context['_key'], $context['lesson'], $context['_parent'], $context['loop']);
  166. $context = array_intersect_key($context, $_parent) + $_parent;
  167. // line 67
  168. echo " </div>
  169. </ul>
  170. <ul class=\"nav-right\">
  171. ";
  172. // line 71
  173. if ($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_ADMIN")) {
  174. // line 72
  175. echo " ";
  176. // line 82
  177. echo " ";
  178. echo twig_call_macro($macros["_self"], "macro_counter_badge", ["/guardian_register/registrations", "fa-user-plus", $this->env->getRuntime('App\Twig\AdminCountersExtensionRuntime')->getNewRegistrationsCount(), "Naujos registracijos"], 82, $context, $this->getSourceContext());
  179. echo "
  180. ";
  181. // line 83
  182. echo twig_call_macro($macros["_self"], "macro_counter_badge", ["/child_preference_assigment/", "fa-list-check", $this->env->getRuntime('App\Twig\AdminCountersExtensionRuntime')->getPendingAssignmentsCount(), "Priskyrimo laukia"], 83, $context, $this->getSourceContext());
  183. echo "
  184. <li class=\"admin-counter-item dropdown bug-report\">
  185. <a href=\"javascript:void(0);\" title=\"Klaidos\">
  186. <span class=\"counter-icon-wrap\">
  187. <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"22\" height=\"22\" fill=\"currentColor\" class=\"bi bi-bug\" viewBox=\"0 0 16 16\">
  188. <path d=\"M4.355.522a.5.5 0 0 1 .623.333l.291.956A5 5 0 0 1 8 1c1.007 0 1.946.298 2.731.811l.29-.956a.5.5 0 1 1 .957.29l-.41 1.352A5 5 0 0 1 13 6h.5a.5.5 0 0 0 .5-.5V5a.5.5 0 0 1 1 0v.5A1.5 1.5 0 0 1 13.5 7H13v1h1.5a.5.5 0 0 1 0 1H13v1h.5a1.5 1.5 0 0 1 1.5 1.5v.5a.5.5 0 1 1-1 0v-.5a.5.5 0 0 0-.5-.5H13a5 5 0 0 1-10 0h-.5a.5.5 0 0 0-.5.5v.5a.5.5 0 1 1-1 0v-.5A1.5 1.5 0 0 1 2.5 10H3V9H1.5a.5.5 0 0 1 0-1H3V7h-.5A1.5 1.5 0 0 1 1 5.5V5a.5.5 0 0 1 1 0v.5a.5.5 0 0 0 .5.5H3c0-1.364.547-2.601 1.432-3.503l-.41-1.352a.5.5 0 0 1 .333-.623M4 7v4a4 4 0 0 0 3.5 3.97V7zm4.5 0v7.97A4 4 0 0 0 12 11V7zM12 6a4 4 0 0 0-1.334-2.982A3.98 3.98 0 0 0 8 2a3.98 3.98 0 0 0-2.667 1.018A4 4 0 0 0 4 6z\"/>
  189. </svg>
  190. </span>
  191. </a>
  192. </li>
  193. ";
  194. }
  195. // line 94
  196. echo " ";
  197. // line 95
  198. echo " ";
  199. if (($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_GUARDIAN") || $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_CHILD"))) {
  200. // line 96
  201. echo " <li class=\"dropdown\">
  202. <a href=\"https://pagalba.corepetitus.lt/hc/lt/sections/22038273075346-Klientams\"
  203. class=\"peers fxw-nw ai-c lh-1\">
  204. <div class=\"peer\">
  205. <i class=\"fa-solid fa-circle-question\"></i>
  206. </div>
  207. </a>
  208. </li>
  209. ";
  210. }
  211. // line 105
  212. echo " ";
  213. if ($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_TEACHER")) {
  214. // line 106
  215. echo " <li class=\"dropdown\">
  216. <a href=\"https://pagalba.corepetitus.lt/hc/lt/sections/22038256444690-Korepetitoriams\"
  217. class=\"peers fxw-nw ai-c lh-1\">
  218. <div class=\"peer\">
  219. <i class=\"fa-solid fa-circle-question\"></i>
  220. </div>
  221. </a>
  222. ";
  223. // line 114
  224. echo " ";
  225. // line 115
  226. echo " ";
  227. // line 116
  228. echo " ";
  229. // line 117
  230. echo " ";
  231. // line 118
  232. echo " ";
  233. // line 119
  234. echo " ";
  235. // line 120
  236. echo " ";
  237. // line 121
  238. echo " ";
  239. // line 122
  240. echo " ";
  241. // line 123
  242. echo " ";
  243. // line 124
  244. echo " ";
  245. // line 125
  246. echo " ";
  247. // line 126
  248. echo " ";
  249. // line 127
  250. echo " ";
  251. // line 128
  252. echo " ";
  253. // line 129
  254. echo " ";
  255. // line 130
  256. echo " ";
  257. // line 131
  258. echo " ";
  259. // line 132
  260. echo " ";
  261. // line 133
  262. echo " ";
  263. // line 134
  264. echo " ";
  265. // line 135
  266. echo " ";
  267. // line 136
  268. echo " ";
  269. // line 137
  270. echo " ";
  271. // line 138
  272. echo " </li>
  273. <li class=\"nav-badge\">
  274. <a href=\"";
  275. // line 140
  276. echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("app_salary_vacation");
  277. echo "\" class=\"peers\">
  278. <div class=\"peer\">
  279. <img class=\"w-3r\"
  280. src=\"";
  281. // line 143
  282. echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl((("assets/images/badge_" . 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.', 143, $this->source); })()), "user", [], "any", false, false, false, 143), "levelInfo", [], "any", false, false, false, 143), "badge", [], "any", false, false, false, 143)) . ".svg")), "html", null, true);
  283. echo "\" alt=\"\">
  284. </div>
  285. </a>
  286. </li>
  287. ";
  288. }
  289. // line 148
  290. echo "
  291. <li class=\"";
  292. // line 149
  293. echo (($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_ADMIN")) ? ("admin-counter-item ") : (""));
  294. echo "notifications dropdown\">
  295. <a href=\"\" class=\"dropdown-toggle user-notifications no-after ";
  296. // line 150
  297. echo (($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_ADMIN")) ? ("") : ("peers fxw-nw ai-c lh-1"));
  298. echo "\"
  299. data-toggle=\"dropdown\">
  300. ";
  301. // line 152
  302. if ($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_ADMIN")) {
  303. // line 153
  304. echo " <span class=\"counter-icon-wrap\">
  305. <i class=\"fa fa-bell ";
  306. // line 154
  307. if ($this->env->getRuntime('App\Twig\NotificationExtensionRuntime')->getUserNotificationCount()) {
  308. echo "ring";
  309. }
  310. echo "\"></i>
  311. <span class=\"badge badge-pill ";
  312. // line 155
  313. echo ((($this->env->getRuntime('App\Twig\NotificationExtensionRuntime')->getUserNotificationCount() > 0)) ? ("badge-danger") : ("badge-secondary"));
  314. echo "\">";
  315. echo twig_escape_filter($this->env, $this->env->getRuntime('App\Twig\NotificationExtensionRuntime')->getUserNotificationCount(), "html", null, true);
  316. echo "</span>
  317. </span>
  318. ";
  319. } else {
  320. // line 158
  321. echo " <div class=\"peer\">
  322. <i class=\"fa fa-bell ";
  323. // line 159
  324. if ($this->env->getRuntime('App\Twig\NotificationExtensionRuntime')->getUserNotificationCount()) {
  325. echo "ring";
  326. }
  327. echo "\">
  328. ";
  329. // line 160
  330. if ($this->env->getRuntime('App\Twig\NotificationExtensionRuntime')->getUserNotificationCount()) {
  331. // line 161
  332. echo " <span class=\"badge badge-danger badge-pill user-notification-badge\"><span class=\"number\">";
  333. echo twig_escape_filter($this->env, $this->env->getRuntime('App\Twig\NotificationExtensionRuntime')->getUserNotificationCount(), "html", null, true);
  334. echo "</span></span>
  335. ";
  336. }
  337. // line 163
  338. echo " </i>
  339. </div>
  340. ";
  341. }
  342. // line 166
  343. echo " </a>
  344. <ul class=\"dropdown-menu\" aria-labelledby=\"dropdownMenuButton1\" data-bs-popper=\"none\">
  345. <li class=\"notification-title\"><i class=\"fa fa-bell pR-10\"></i> <span class=\"text\">Pranešimai</span>
  346. </li>
  347. ";
  348. // line 170
  349. if ((twig_length_filter($this->env, twig_get_attribute($this->env, $this->source, $this->env->getRuntime('App\Twig\NotificationExtensionRuntime')->getUserNotificationData(), "notifications", [], "any", false, false, false, 170)) > 0)) {
  350. // line 171
  351. echo " ";
  352. $context['_parent'] = $context;
  353. $context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, $this->env->getRuntime('App\Twig\NotificationExtensionRuntime')->getUserNotificationData(), "notifications", [], "any", false, false, false, 171));
  354. foreach ($context['_seq'] as $context["_key"] => $context["notification"]) {
  355. // line 172
  356. echo " <li class=\"\">
  357. <a href=\"";
  358. // line 173
  359. echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("app_me_notification_index_id", ["id" => twig_get_attribute($this->env, $this->source, $context["notification"], "id", [], "any", false, false, false, 173)]), "html", null, true);
  360. echo "\"
  361. class=\"";
  362. // line 174
  363. echo ((twig_get_attribute($this->env, $this->source, $context["notification"], "seen", [], "any", false, false, false, 174)) ? ("") : ("new"));
  364. echo " peers fxw-nw td-n bdB c-grey-800 cH-blue bgcH-grey-100\">
  365. <div class=\"peer mR-10\">
  366. <div class=\"image w-3r\"
  367. style=\"background-image: url(";
  368. // line 177
  369. echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["notification"], "createdBy", [], "any", false, false, false, 177), "profileImagePath", [], "any", false, false, false, 177), "html", null, true);
  370. echo ")\"></div>
  371. </div>
  372. <div class=\"peer peer-greed\">
  373. <div>
  374. <div class=\"peers jc-sb fxw-nw mB-5\">
  375. <div class=\"peer\"><p
  376. class=\"fw-500 mB-0\">";
  377. // line 183
  378. echo twig_escape_filter($this->env, twig_truncate_filter($this->env, twig_get_attribute($this->env, $this->source, $context["notification"], "topic", [], "any", false, false, false, 183), 25, false), "html", null, true);
  379. echo "</p>
  380. </div>
  381. <div class=\"peer alt-text\">
  382. <small class=\"fsz-xs\">prieš ";
  383. // line 186
  384. echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["notification"], "getAgo", [0 => 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.', 186, $this->source); })()), "user", [], "any", false, false, false, 186)], "method", false, false, false, 186), "html", null, true);
  385. echo "</small>
  386. </div>
  387. </div>
  388. <span class=\"sub-headline\">";
  389. // line 189
  390. echo twig_first($this->env, twig_split_filter($this->env, twig_truncate_filter($this->env, twig_striptags(twig_get_attribute($this->env, $this->source, $context["notification"], "message", [], "any", false, false, false, 189)), 60, true), "."));
  391. echo "</span>
  392. </div>
  393. </div>
  394. </a>
  395. </li>
  396. ";
  397. }
  398. $_parent = $context['_parent'];
  399. unset($context['_seq'], $context['_iterated'], $context['_key'], $context['notification'], $context['_parent'], $context['loop']);
  400. $context = array_intersect_key($context, $_parent) + $_parent;
  401. // line 195
  402. echo " ";
  403. } else {
  404. // line 196
  405. echo " <li class=\"c-grey-600 cH-blue td-n ta-c p-10\">Pranešimų nėra</li>
  406. ";
  407. }
  408. // line 198
  409. echo " <li class=\"notification-title ta-c\">
  410. <span>
  411. <a href=\"";
  412. // line 200
  413. echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("app_me_notification_index");
  414. echo "\" class=\"td-n\">Visi pranešimai
  415. <i class=\"ti-angle-right fsz-xs mL-10\"></i>
  416. </a>
  417. </span>
  418. </li>
  419. </ul>
  420. </li>
  421. ";
  422. // line 208
  423. if ($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_TEACHER")) {
  424. // line 209
  425. echo " ";
  426. $context["teacherPublicProfiles"] = ((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["app"] ?? null), "user", [], "any", false, true, false, 209), "teacherPublicProfiles", [], "any", true, true, false, 209)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["app"] ?? null), "user", [], "any", false, true, false, 209), "teacherPublicProfiles", [], "any", false, false, false, 209), [])) : ([]));
  427. // line 210
  428. echo " ";
  429. $context["teacherEditablePublicProfiles"] = twig_array_filter($this->env, (isset($context["teacherPublicProfiles"]) || array_key_exists("teacherPublicProfiles", $context) ? $context["teacherPublicProfiles"] : (function () { throw new RuntimeError('Variable "teacherPublicProfiles" does not exist.', 210, $this->source); })()), function ($__publicProfile__) use ($context, $macros) { $context["publicProfile"] = $__publicProfile__; return twig_in_filter(twig_get_attribute($this->env, $this->source, (isset($context["publicProfile"]) || array_key_exists("publicProfile", $context) ? $context["publicProfile"] : (function () { throw new RuntimeError('Variable "publicProfile" does not exist.', 210, $this->source); })()), "status", [], "any", false, false, false, 210), [0 => twig_constant("App\\Entity\\TeacherPublicProfile::STATUS_IN_REVIEW"), 1 => twig_constant("App\\Entity\\TeacherPublicProfile::STATUS_REJECTED")]); });
  430. // line 211
  431. echo " ";
  432. $context["teacherConfirmedPublicProfiles"] = twig_array_filter($this->env, (isset($context["teacherPublicProfiles"]) || array_key_exists("teacherPublicProfiles", $context) ? $context["teacherPublicProfiles"] : (function () { throw new RuntimeError('Variable "teacherPublicProfiles" does not exist.', 211, $this->source); })()), function ($__publicProfile__) use ($context, $macros) { $context["publicProfile"] = $__publicProfile__; return (twig_get_attribute($this->env, $this->source, (isset($context["publicProfile"]) || array_key_exists("publicProfile", $context) ? $context["publicProfile"] : (function () { throw new RuntimeError('Variable "publicProfile" does not exist.', 211, $this->source); })()), "status", [], "any", false, false, false, 211) == twig_constant("App\\Entity\\TeacherPublicProfile::STATUS_CONFIRMED")); });
  433. // line 212
  434. echo " ";
  435. $context["teacherPublicProfile"] = ((twig_length_filter($this->env, (isset($context["teacherEditablePublicProfiles"]) || array_key_exists("teacherEditablePublicProfiles", $context) ? $context["teacherEditablePublicProfiles"] : (function () { throw new RuntimeError('Variable "teacherEditablePublicProfiles" does not exist.', 212, $this->source); })()))) ? (twig_first($this->env, (isset($context["teacherEditablePublicProfiles"]) || array_key_exists("teacherEditablePublicProfiles", $context) ? $context["teacherEditablePublicProfiles"] : (function () { throw new RuntimeError('Variable "teacherEditablePublicProfiles" does not exist.', 212, $this->source); })()))) : (((twig_length_filter($this->env, (isset($context["teacherConfirmedPublicProfiles"]) || array_key_exists("teacherConfirmedPublicProfiles", $context) ? $context["teacherConfirmedPublicProfiles"] : (function () { throw new RuntimeError('Variable "teacherConfirmedPublicProfiles" does not exist.', 212, $this->source); })()))) ? (twig_first($this->env, (isset($context["teacherConfirmedPublicProfiles"]) || array_key_exists("teacherConfirmedPublicProfiles", $context) ? $context["teacherConfirmedPublicProfiles"] : (function () { throw new RuntimeError('Variable "teacherConfirmedPublicProfiles" does not exist.', 212, $this->source); })()))) : (null))));
  436. // line 213
  437. echo " ";
  438. $context["isTeacherPublicProfileCanceled"] = ((isset($context["teacherPublicProfile"]) || array_key_exists("teacherPublicProfile", $context) ? $context["teacherPublicProfile"] : (function () { throw new RuntimeError('Variable "teacherPublicProfile" does not exist.', 213, $this->source); })()) && (twig_get_attribute($this->env, $this->source, (isset($context["teacherPublicProfile"]) || array_key_exists("teacherPublicProfile", $context) ? $context["teacherPublicProfile"] : (function () { throw new RuntimeError('Variable "teacherPublicProfile" does not exist.', 213, $this->source); })()), "status", [], "any", false, false, false, 213) == twig_constant("App\\Entity\\TeacherPublicProfile::STATUS_REJECTED")));
  439. // line 214
  440. echo " ";
  441. if (( !(isset($context["teacherPublicProfile"]) || array_key_exists("teacherPublicProfile", $context) ? $context["teacherPublicProfile"] : (function () { throw new RuntimeError('Variable "teacherPublicProfile" does not exist.', 214, $this->source); })()) || (isset($context["isTeacherPublicProfileCanceled"]) || array_key_exists("isTeacherPublicProfileCanceled", $context) ? $context["isTeacherPublicProfileCanceled"] : (function () { throw new RuntimeError('Variable "isTeacherPublicProfileCanceled" does not exist.', 214, $this->source); })()))) {
  442. // line 215
  443. echo " <li class=\"nav-fill-profile-item\">
  444. <span class=\"nav-fill-profile-btn\"";
  445. // line 216
  446. if ((isset($context["isTeacherPublicProfileCanceled"]) || array_key_exists("isTeacherPublicProfileCanceled", $context) ? $context["isTeacherPublicProfileCanceled"] : (function () { throw new RuntimeError('Variable "isTeacherPublicProfileCanceled" does not exist.', 216, $this->source); })())) {
  447. echo " style=\"border-color:#dc3545;color:#dc3545;\"";
  448. }
  449. echo ">
  450. <a href=\"";
  451. // line 217
  452. echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("me_teacher_public_profile");
  453. echo "\" class=\"td-n\"";
  454. if ((isset($context["isTeacherPublicProfileCanceled"]) || array_key_exists("isTeacherPublicProfileCanceled", $context) ? $context["isTeacherPublicProfileCanceled"] : (function () { throw new RuntimeError('Variable "isTeacherPublicProfileCanceled" does not exist.', 217, $this->source); })())) {
  455. echo " style=\"color:#dc3545;\"";
  456. }
  457. echo ">
  458. <i class=\"fas fa-exclamation-triangle\" style=\"margin-right:6px;\"></i>";
  459. // line 218
  460. echo $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Reikia užpildyti viešą profilį", [], "messages");
  461. // line 219
  462. echo " </a>
  463. </span>
  464. </li>
  465. ";
  466. }
  467. // line 223
  468. echo " ";
  469. }
  470. // line 224
  471. echo " <li class=\"dropdown\">
  472. <a href=\"\" class=\"dropdown-toggle no-after peers fxw-nw ai-c lh-1\" data-toggle=\"dropdown\">
  473. <div class=\"peer\">
  474. <img class=\"w-2r bdrs-50p\"
  475. src=\"";
  476. // line 228
  477. if (((twig_get_attribute($this->env, $this->source, ($context["app"] ?? null), "user", [], "any", true, true, false, 228) && !(null === 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.', 228, $this->source); })()), "user", [], "any", false, false, false, 228))) && !(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.', 228, $this->source); })()), "user", [], "any", false, false, false, 228), "profileImagePath", [], "any", false, false, false, 228)))) {
  478. echo twig_escape_filter($this->env, 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.', 228, $this->source); })()), "user", [], "any", false, false, false, 228), "profileImagePath", [], "any", false, false, false, 228), "html", null, true);
  479. } else {
  480. echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/images/default.png"), "html", null, true);
  481. }
  482. echo "\"
  483. alt=\"\">
  484. </div>
  485. <div class=\"peer pl-2\">
  486. <span class=\" user-name\">";
  487. // line 232
  488. if (((twig_get_attribute($this->env, $this->source, ($context["app"] ?? null), "user", [], "any", true, true, false, 232) && !(null === 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.', 232, $this->source); })()), "user", [], "any", false, false, false, 232))) && !(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.', 232, $this->source); })()), "user", [], "any", false, false, false, 232), "fullname", [], "any", false, false, false, 232)))) {
  489. echo twig_escape_filter($this->env, 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.', 232, $this->source); })()), "user", [], "any", false, false, false, 232), "fullname", [], "any", false, false, false, 232), "html", null, true);
  490. }
  491. echo "</span>
  492. </div>
  493. </a>
  494. <ul class=\"dropdown-menu \">
  495. ";
  496. // line 236
  497. if ($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_TEACHER")) {
  498. // line 237
  499. echo " <li>
  500. ";
  501. // line 238
  502. if ( !(isset($context["teacherPublicProfile"]) || array_key_exists("teacherPublicProfile", $context) ? $context["teacherPublicProfile"] : (function () { throw new RuntimeError('Variable "teacherPublicProfile" does not exist.', 238, $this->source); })())) {
  503. // line 239
  504. echo " <a href=\"";
  505. echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("me_teacher_public_profile");
  506. echo "\" class=\"menu-item fill-profile-dropdown-link\" style=\"color:#e08c00;font-weight:600;display:flex;align-items:center;\">
  507. <i class=\"fas fa-exclamation-triangle\" style=\"padding-left:25px;margin-right:4px;flex-shrink:0;\"></i><span style=\"padding:0;margin:0;font-weight:700;\">";
  508. // line 240
  509. echo $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Užpildyk savo viešą profilį", [], "messages");
  510. echo "</span>
  511. </a>
  512. ";
  513. } elseif ((twig_get_attribute($this->env, $this->source, // line 242
  514. (isset($context["teacherPublicProfile"]) || array_key_exists("teacherPublicProfile", $context) ? $context["teacherPublicProfile"] : (function () { throw new RuntimeError('Variable "teacherPublicProfile" does not exist.', 242, $this->source); })()), "status", [], "any", false, false, false, 242) == twig_constant("App\\Entity\\TeacherPublicProfile::STATUS_REJECTED"))) {
  515. // line 243
  516. echo " <a href=\"";
  517. echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("me_teacher_public_profile");
  518. echo "\" class=\"menu-item fill-profile-dropdown-link\" style=\"color:#dc3545;font-weight:600;display:flex;align-items:center;\">
  519. <i class=\"fas fa-exclamation-triangle\" style=\"padding-left:25px;margin-right:4px;flex-shrink:0;\"></i><span style=\"padding:0;margin:0;font-weight:700;\">";
  520. // line 244
  521. echo $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Užpildyk savo viešą profilį", [], "messages");
  522. echo "</span>
  523. </a>
  524. ";
  525. } else {
  526. // line 247
  527. echo " <a href=\"";
  528. echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("me_teacher_public_profile");
  529. echo "\" class=\"menu-item\">
  530. <span>";
  531. // line 248
  532. echo $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Public Profile", [], "messages");
  533. echo "</span>
  534. </a>
  535. ";
  536. }
  537. // line 251
  538. echo " </li>
  539. <li class=\"divider\"></li>
  540. ";
  541. }
  542. // line 254
  543. echo " <li>
  544. <a href=\"";
  545. // line 255
  546. echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("me_edit");
  547. echo "\" class=\"menu-item\">
  548. <span>";
  549. // line 256
  550. echo $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Edit Profile", [], "messages");
  551. echo "</span>
  552. </a>
  553. </li>
  554. <li>
  555. <a href=\"/logout\" class=\"menu-item\">
  556. <span>";
  557. // line 261
  558. echo $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Logout", [], "messages");
  559. echo "</span>
  560. </a>
  561. </li>
  562. </ul>
  563. </li>
  564. <li>
  565. <a id=\"sidebar-toggle\" class=\"sidebar-toggle\" href=\"javascript:void(0);\">
  566. <i class=\"fa-solid fa-bars\"></i>
  567. <i class=\"fa-solid fa-xmark\"></i>
  568. </a>
  569. </li>
  570. </ul>
  571. </div>
  572. </div>
  573. ";
  574. // line 275
  575. if ( !$this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_ADMIN")) {
  576. // line 276
  577. echo " ";
  578. $this->displayBlock('stylesheets', $context, $blocks);
  579. // line 278
  580. echo " ";
  581. $this->displayBlock('javascripts', $context, $blocks);
  582. // line 573
  583. echo "
  584. ";
  585. }
  586. $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  587. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  588. }
  589. // line 276
  590. public function block_stylesheets($context, array $blocks = [])
  591. {
  592. $macros = $this->macros;
  593. $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  594. $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "stylesheets"));
  595. $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  596. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "stylesheets"));
  597. // line 277
  598. echo " ";
  599. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  600. $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  601. }
  602. // line 278
  603. public function block_javascripts($context, array $blocks = [])
  604. {
  605. $macros = $this->macros;
  606. $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  607. $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "javascripts"));
  608. $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  609. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "javascripts"));
  610. // line 280
  611. echo " <script>
  612. document.addEventListener(\"DOMContentLoaded\", function(event) {
  613. \$('.card.has-timer').each(function (index, item) {
  614. CountDownTimer(item);
  615. })
  616. \$('.move-lesson').on('click', function () {
  617. Swal.fire({
  618. title: \"Ar tikrai?\",
  619. text: \"Norint perkelti užsiėmimą į naują dieną ir laiką privaloma susitarti su mokinio ar mokinio tėvais/ globėjais. Nesusitarus, perkelti draudžiama.\",
  620. icon: \"warning\",
  621. showCancelButton: true,
  622. confirmButtonColor: \"#3085d6\",
  623. cancelButtonColor: \"#d33\",
  624. confirmButtonText: \"Tėvai/mokinys sutiko\",
  625. cancelButtonText: \"Dar nesusitariau\",
  626. customClass: {container: \"version_2\"},
  627. }).then((result) => {
  628. if (result.isConfirmed) {
  629. initLessonMoveModal(this.getAttribute('data-lesson'))
  630. }
  631. })
  632. })
  633. \$('.missed-lesson').on('click', function () {
  634. let modal = \$('#missedLessonModal');
  635. modal.modal().show();
  636. modal.attr('data-lesson', this.getAttribute('data-lesson'))
  637. })
  638. \$('#modal .modal-save').on('click', function (e) {
  639. e.stopPropagation()
  640. if (\$('.modal-body form').get(0).reportValidity()) {
  641. if (confirm(\"Ar tikrai norite perkelti šią pamoką?\")) {
  642. let lessonId = this.getAttribute('lesson');
  643. let url = `";
  644. // line 314
  645. echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("me_teacher_lesson_move", ["id" => "id"]);
  646. echo "`;
  647. url = url.replace('id', lessonId);
  648. \$.ajax({
  649. type: 'POST',
  650. url: url,
  651. data: \$('.modal-body form').serialize(),
  652. success: function (res) {
  653. \$('#modal').modal('hide')
  654. \$('#modal .modal-footer .modal-save').removeAttr('lesson')
  655. window.location.reload()
  656. },
  657. error: function (error) {
  658. toastr.error(error.responseJSON.status);
  659. }
  660. });
  661. }
  662. }
  663. })
  664. let searchParams = new URLSearchParams(window.location.search)
  665. if (searchParams.has('action') && searchParams.get('action') == 'missed') {// true
  666. initModal('Informacija', `
  667. <p>Kadangi kita pusė neinformuotai praleido užsiėmimą (neprisijungė laiku), užsiėmimas laikomas kaip kitos pusės neinformuotai praleistas.</p>
  668. <p>Klientas už tokį korepetitoriaus praleistą užsiėmimą pinigų nemoka. Esant galimybei, korepetitorius susisieks su Jumis ir sutars naują laiką užsiėmimui atidirbti.</p>
  669. <p>Korepetitorius už tokį mokinio praleistą užsiėmimą atlygį gauna ir klientas už mokinio neinformuotai praleistą užsiėmimą moka pilną kainą. Esant galimybei, korepetitorius susisieks su Jumis ir sutars naują laiką užsiėmimui atidirbti.</p>`);
  670. let url = document.location.href;
  671. window.history.pushState({}, \"\", url.split(\"?\")[0]);
  672. }
  673. if (searchParams.has('action') && searchParams.get('action') == 'moved') {// true
  674. initModal('Informacija', `
  675. <div class=\"ta-c\">
  676. <p>Korepetitorius šį užsiėmimą ką tik perkėlė ir užsiėmimas vyks kitu laiku!</p>
  677. <p>Pradinė užsiėmimo data ir laikas:<br>\${searchParams.get('from')}</p>
  678. <p>Nauja užsiėmimo data ir laikas:<br>\${searchParams.get('to')}</p>
  679. </div>`);
  680. let url = document.location.href;
  681. window.history.pushState({}, \"\", url.split(\"?\")[0]);
  682. }
  683. if (searchParams.has('action') && searchParams.get('action') == 'denied') {// true
  684. initModal('Šiuo metu nėra galimybės prisijungti prie užsiėmimo.', `
  685. <div class=\"ta-c\">
  686. <p><b>Taip yra dėl vienos iš žemiau pateiktų priežasčių:</b></p>
  687. <p>A) šiuo metu vienas vartotojas jau yra prisijungęs (mokinys arba tėvas/ globėjas);</p>
  688. <p>B) jūs neplanuotai atsijungėte nuo užsiėmimo.</p>
  689. <p><b>JEI NORITE PRISIJUNGTI:</b></p>
  690. <p>A) atveju privaloma, jog vienas vartotojas atsijungtų ir tik tada galės prisijungti kitas vartotojas;</p>
  691. <p>B) atveju vėl galėsite prisijungti 60 sekundžių eigoje nuo neplanuoto atsijungimo;</p>
  692. </div>`);
  693. let url = document.location.href;
  694. // window.history.pushState({}, \"\", url.split(\"?\")[0]);
  695. }
  696. // create new scope
  697. var timer;
  698. // bind event handler
  699. \$('.join-lesson').on('click', function () {
  700. var buttonClicked = this;
  701. if (timer) {
  702. clearTimeout(timer);
  703. }
  704. timer = setTimeout(function () {
  705. window.open(buttonClicked.getAttribute('data-href'), \"_blank\")
  706. }, 700, buttonClicked);
  707. });
  708. })
  709. function initModal(header, body, footerVisible = false) {
  710. let modal = \$('#modal').modal();
  711. modal.find('.modal-header .modal-title').html(header)
  712. modal.find('.modal-body .content').html(body)
  713. if (footerVisible) {
  714. modal.find('.modal-footer').show();
  715. } else {
  716. modal.find('.modal-footer').hide();
  717. }
  718. modal.show();
  719. }
  720. function initLessonMoveModal(lessonId) {
  721. let url = `";
  722. // line 394
  723. echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("me_teacher_lesson_move", ["id" => "id"]);
  724. echo "`;
  725. url = url.replace('id', lessonId);
  726. \$('#modal .modal-footer .modal-save').attr('lesson', lessonId);
  727. \$.ajax({
  728. type: 'GET',
  729. url: url,
  730. success: function (res) {
  731. initModal('Perkelti...', res, true);
  732. \$('#lesson_move_startTime').flatpickr({
  733. locale: \"lt\",
  734. altInput: true,
  735. enableTime: true,
  736. altFormat: \"Y-m-d H:i\",
  737. dateFormat: \"Y-m-d H:i\",
  738. minTime: \"05:00\",
  739. time_24hr: true,
  740. allowInput: true,
  741. onClose: function (change, string, event) {
  742. var duration = \$('#lesson_move_duration').val();
  743. var endTime = moment(string).add(duration, 'minutes').format('YYYY-MM-DD HH:mm')
  744. \$('#lesson_move_endTime').val(endTime);
  745. }
  746. })
  747. }
  748. })
  749. }
  750. function CountDownTimer(selector) {
  751. var timeBlock = \$(selector).find('.card-item');
  752. var startTime = new Date(timeBlock.attr('data-start').replace(/-/g, \"/\"));
  753. var endTime = new Date(timeBlock.attr('data-end').replace(/-/g, \"/\"));
  754. endTime = endTime.setMinutes(endTime.getMinutes() + 4);
  755. var _second = 1000;
  756. var _minute = _second * 60;
  757. var _hour = _minute * 60;
  758. var _day = _hour * 24;
  759. var timer;
  760. ///var now = new Date(\"";
  761. // line 432
  762. echo twig_escape_filter($this->env, twig_date_format_filter($this->env, "now", "Y-m-d H:i:s"), "html", null, true);
  763. echo "\");
  764. var server = moment('";
  765. // line 433
  766. echo twig_escape_filter($this->env, twig_date_format_filter($this->env, "now", "Y-m-d H:i:s"), "html", null, true);
  767. echo "')
  768. var user = moment()
  769. var difference = user - server;
  770. // console.log(server);
  771. function showRemaining() {
  772. var now = new Date(new Date().toLocaleString(\"en-US\", {timeZone: \"Europe/Vilnius\"})) - difference;
  773. // console.log(moment(now).format())
  774. // console.log(moment().format())
  775. var distanceUntilStart = startTime - now;
  776. var days = Math.floor(distanceUntilStart / _day);
  777. var hours = Math.floor((distanceUntilStart % _day) / _hour);
  778. var minutes = Math.floor((distanceUntilStart % _hour) / _minute);
  779. var seconds = Math.floor((distanceUntilStart % _minute) / _second);
  780. //how long lesson is already going
  781. var distanceFromStart = now - startTime;
  782. var goingHours = Math.floor((distanceFromStart % _day) / _hour);
  783. var goingMinutes = Math.floor((distanceFromStart % _hour) / _minute) + (goingHours * 60);
  784. var goingSeconds = Math.floor((distanceFromStart % _minute) / _second);
  785. //how long after the lesson end to remove the card dom object.
  786. var distanceFromEnd = endTime - now;
  787. var afterMinutes = Math.floor((distanceFromEnd % _hour) / _minute);
  788. var afterSeconds = Math.floor((distanceFromEnd % _minute) / _second);
  789. //console.log(goingMinutes + \" going\");
  790. if (distanceUntilStart > 0) {
  791. // timeText = days + 'days ';
  792. timeText = hours + 'val. ';
  793. timeText += minutes + 'min. ';
  794. timeText += seconds + 's.';
  795. // \$(selector).find('.timer').html(timeText);//bug
  796. checkminutes = 5
  797. ";
  798. // line 468
  799. if ($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_TEACHER")) {
  800. // line 469
  801. echo " checkminutes = 10
  802. ";
  803. }
  804. // line 471
  805. echo "
  806. if (days == 0 && hours == 0 && minutes < checkminutes) {
  807. // \$(selector).find('.timer').hide()
  808. \$(selector).find('.notice').html(`Iki pradžios liko: <b>\${minutes} min. \${seconds} s.</b><br>Junkitės į užsiėmimą!`)
  809. \$(selector).find('.join-lesson').removeAttr('disabled')
  810. } else {
  811. if (days > 0) {
  812. \$(selector).find('.notice').html(`Iki užsiėmimo pradžios liko: <b>\${days + \" d.\"} \${hours} val \${minutes} min.</b>`)
  813. } else {
  814. if (hours == 0) {
  815. let text = `Iki užsiėmimo pradžios: <b>\${minutes} min. \${seconds} s.</b>`
  816. ";
  817. // line 483
  818. if ($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_TEACHER")) {
  819. // line 484
  820. echo " minutes = minutes - 10
  821. ";
  822. } else {
  823. // line 486
  824. echo " minutes = minutes - 5
  825. ";
  826. }
  827. // line 488
  828. echo "
  829. text += `<br>Jungtis galėsite po: <b>\${minutes} min. \${seconds} s.</b>`;
  830. \$(selector).find('.notice').html(text)
  831. } else {
  832. let text = `Iki užsiėmimo pradžios: <b>\${hours} val \${minutes} min.</b>`
  833. ";
  834. // line 494
  835. if ($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_TEACHER")) {
  836. // line 495
  837. echo " minutes = minutes - 10
  838. ";
  839. } else {
  840. // line 497
  841. echo " minutes = minutes - 5
  842. ";
  843. }
  844. // line 499
  845. echo " if (minutes < 0) {
  846. hours = hours - 1;
  847. minutes = minutes + 60;
  848. }
  849. text += `<br>Jungtis galėsite po: <b>\${hours ? hours : \"\"} \${hours ? \"val\" : \"\"} \${minutes} min.</b>`;
  850. \$(selector).find('.notice').html(text)
  851. }
  852. }
  853. }
  854. if (days == 0 && hours == 0 && minutes < 60) {
  855. \$(selector).find('.missed-lesson').attr('disabled', false);
  856. } else {
  857. \$(selector).find('.missed-lesson').attr('disabled', true);
  858. }
  859. return;
  860. }
  861. //console.log('after', afterMinutes)
  862. // console.log(`afterminutes`,afterMinutes);
  863. // console.log(`going`,goingMinutes);
  864. if (distanceFromStart > 0) {
  865. lesson = \$(selector).find('.card-item').data('lesson-id');
  866. if (!\$(`[data-lesson-id=\${lesson}]`).find('.users').hasClass('was-joined')) {
  867. if (\$(selector).find('.teacher').find('.box').hasClass('not-joined') && \$(selector).find('.student').find('.box').hasClass('not-joined') && goingMinutes > 4) {
  868. \$(`[data-lesson-id=\${lesson}]`).parent().parent().hide();
  869. }
  870. if (\$(selector).find('.student').find('.box').hasClass('not-joined') && \$(selector).find('.teacher').find('.box').hasClass('not-joined') && goingMinutes > 14) {
  871. \$(`[data-lesson-id=\${lesson}]`).parent().parent().hide();
  872. // \$(selector).find('.btn').hide();
  873. }
  874. }
  875. // \$(selector).find('.timer').hide()
  876. \$(selector).find('.notice').html(``);
  877. \$(selector).find('.notice').html(`Jau vyksta (\${goingMinutes}min. \${goingSeconds}s.)!`);
  878. }
  879. if (afterMinutes < 0) {
  880. clearInterval(timer);
  881. \$(selector).hide();
  882. }
  883. }
  884. timer = setInterval(showRemaining, 1000);
  885. }
  886. ";
  887. // line 545
  888. $context["userType"] = twig_get_attribute($this->env, $this->source, (isset($context["lessonExtension"]) || array_key_exists("lessonExtension", $context) ? $context["lessonExtension"] : (function () { throw new RuntimeError('Variable "lessonExtension" does not exist.', 545, $this->source); })()), "learncubeUser", [], "any", false, false, false, 545);
  889. // line 546
  890. echo " ";
  891. if ($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_GUARDIAN")) {
  892. // line 547
  893. echo " ";
  894. $context["userType"] = twig_constant("App\\Service\\LearnCubeService::tag_guardian");
  895. // line 548
  896. echo " ";
  897. }
  898. // line 549
  899. echo " const eventSource = new EventSource(\"";
  900. echo twig_escape_filter($this->env, twig_escape_filter($this->env, $this->extensions['Symfony\Component\Mercure\Twig\MercureExtension']->mercure(((("lesson_status/" . (isset($context["userType"]) || array_key_exists("userType", $context) ? $context["userType"] : (function () { throw new RuntimeError('Variable "userType" does not exist.', 549, $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.', 549, $this->source); })()), "user", [], "any", false, false, false, 549), "id", [], "any", false, false, false, 549))), "js"), "html", null, true);
  901. echo "\");
  902. eventSource.onmessage = event => {
  903. event = JSON.parse(event.data);
  904. console.log(event);
  905. if (event.action == \"reload\") {
  906. window.location.reload();
  907. }
  908. if (event.id > 0) {
  909. \$(`.lesson-list .card-item[data-lesson-id=\${event.id}] .box`).removeClass('joined')
  910. \$(`.lesson-list .card-item[data-lesson-id=\${event.id}] .box`).removeClass('not-joined')
  911. \$(`.lesson-list .card-item[data-lesson-id=\${event.id}] .teacher .box`).toggleClass(parseStatus(event.teacher))
  912. \$(`.lesson-list .card-item[data-lesson-id=\${event.id}] .student .box`).toggleClass(parseStatus(event.student))
  913. }
  914. }
  915. function parseStatus(status) {
  916. if (status) {
  917. return \"joined\"
  918. } else {
  919. return `not-joined`
  920. }
  921. }
  922. </script>
  923. ";
  924. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  925. $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  926. }
  927. // line 72
  928. public function macro_counter_badge($__href__ = null, $__icon__ = null, $__count__ = null, $__title__ = null, ...$__varargs__)
  929. {
  930. $macros = $this->macros;
  931. $context = $this->env->mergeGlobals([
  932. "href" => $__href__,
  933. "icon" => $__icon__,
  934. "count" => $__count__,
  935. "title" => $__title__,
  936. "varargs" => $__varargs__,
  937. ]);
  938. $blocks = [];
  939. ob_start();
  940. try {
  941. $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  942. $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "macro", "counter_badge"));
  943. $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  944. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "macro", "counter_badge"));
  945. // line 73
  946. echo " <li class=\"admin-counter-item\">
  947. <a href=\"";
  948. // line 74
  949. echo twig_escape_filter($this->env, (isset($context["href"]) || array_key_exists("href", $context) ? $context["href"] : (function () { throw new RuntimeError('Variable "href" does not exist.', 74, $this->source); })()), "html", null, true);
  950. echo "\" title=\"";
  951. echo twig_escape_filter($this->env, (isset($context["title"]) || array_key_exists("title", $context) ? $context["title"] : (function () { throw new RuntimeError('Variable "title" does not exist.', 74, $this->source); })()), "html", null, true);
  952. echo "\">
  953. <span class=\"counter-icon-wrap\">
  954. <i class=\"fa-solid ";
  955. // line 76
  956. echo twig_escape_filter($this->env, (isset($context["icon"]) || array_key_exists("icon", $context) ? $context["icon"] : (function () { throw new RuntimeError('Variable "icon" does not exist.', 76, $this->source); })()), "html", null, true);
  957. echo "\"></i>
  958. <span class=\"badge badge-pill ";
  959. // line 77
  960. echo ((((isset($context["count"]) || array_key_exists("count", $context) ? $context["count"] : (function () { throw new RuntimeError('Variable "count" does not exist.', 77, $this->source); })()) > 0)) ? ("badge-danger") : ("badge-secondary"));
  961. echo "\">";
  962. echo twig_escape_filter($this->env, (isset($context["count"]) || array_key_exists("count", $context) ? $context["count"] : (function () { throw new RuntimeError('Variable "count" does not exist.', 77, $this->source); })()), "html", null, true);
  963. echo "</span>
  964. </span>
  965. </a>
  966. </li>
  967. ";
  968. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  969. $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  970. return ('' === $tmp = ob_get_contents()) ? '' : new Markup($tmp, $this->env->getCharset());
  971. } finally {
  972. ob_end_clean();
  973. }
  974. }
  975. public function getTemplateName()
  976. {
  977. return "menu_components/header_nav_bar/header_nav_bar_new.html.twig";
  978. }
  979. public function isTraitable()
  980. {
  981. return false;
  982. }
  983. public function getDebugInfo()
  984. {
  985. return array ( 1017 => 77, 1013 => 76, 1006 => 74, 1003 => 73, 981 => 72, 946 => 549, 943 => 548, 940 => 547, 937 => 546, 935 => 545, 887 => 499, 883 => 497, 879 => 495, 877 => 494, 869 => 488, 865 => 486, 861 => 484, 859 => 483, 845 => 471, 841 => 469, 839 => 468, 801 => 433, 797 => 432, 756 => 394, 673 => 314, 637 => 280, 627 => 278, 617 => 277, 607 => 276, 595 => 573, 592 => 278, 589 => 276, 587 => 275, 570 => 261, 562 => 256, 558 => 255, 555 => 254, 550 => 251, 544 => 248, 539 => 247, 533 => 244, 528 => 243, 526 => 242, 521 => 240, 516 => 239, 514 => 238, 511 => 237, 509 => 236, 500 => 232, 489 => 228, 483 => 224, 480 => 223, 474 => 219, 472 => 218, 464 => 217, 458 => 216, 455 => 215, 452 => 214, 449 => 213, 446 => 212, 443 => 211, 440 => 210, 437 => 209, 435 => 208, 424 => 200, 420 => 198, 416 => 196, 413 => 195, 401 => 189, 395 => 186, 389 => 183, 380 => 177, 374 => 174, 370 => 173, 367 => 172, 362 => 171, 360 => 170, 354 => 166, 349 => 163, 343 => 161, 341 => 160, 335 => 159, 332 => 158, 324 => 155, 318 => 154, 315 => 153, 313 => 152, 308 => 150, 304 => 149, 301 => 148, 293 => 143, 287 => 140, 283 => 138, 281 => 137, 279 => 136, 277 => 135, 275 => 134, 273 => 133, 271 => 132, 269 => 131, 267 => 130, 265 => 129, 263 => 128, 261 => 127, 259 => 126, 257 => 125, 255 => 124, 253 => 123, 251 => 122, 249 => 121, 247 => 120, 245 => 119, 243 => 118, 241 => 117, 239 => 116, 237 => 115, 235 => 114, 226 => 106, 223 => 105, 212 => 96, 209 => 95, 207 => 94, 193 => 83, 188 => 82, 186 => 72, 184 => 71, 178 => 67, 163 => 58, 159 => 57, 154 => 54, 152 => 53, 150 => 52, 148 => 51, 146 => 50, 144 => 49, 137 => 44, 133 => 43, 127 => 40, 118 => 35, 114 => 34, 108 => 31, 102 => 28, 97 => 26, 92 => 24, 88 => 23, 84 => 22, 79 => 19, 76 => 18, 71 => 17, 69 => 16, 60 => 10, 56 => 9, 46 => 1,);
  986. }
  987. public function getSourceContext()
  988. {
  989. return new Source("<div class=\"header navbar\">
  990. <div class=\"header-container\">
  991. <ul class=\"nav-left\">
  992. <li>
  993. <a id='sidebar-toggle' class=\"sidebar-toggle\" href=\"javascript:void(0);\">
  994. <i class=\"fa-solid fa-bars\"></i>
  995. <i class=\"fa-solid fa-xmark\"></i>
  996. </a>
  997. <a class=\"sidebar-link mobile-logo\" href=\"{{ path('dashboard') }}\">
  998. <img src=\"{{ asset('assets/images/core-logo-full.png') }}\" alt=\"logo\"/>
  999. </a>
  1000. </li>
  1001. </ul>
  1002. <ul class=\"nav-mid p-0\">
  1003. <div class=\"header-lesson-list\">
  1004. {% set lessonExtension = getNewestLessons() %}
  1005. {% for lesson in lessonExtension.lessons %}
  1006. {% set wasOnline = (lesson.attendedAtTeacher and lesson.attendedAtChild) ? true : false %}
  1007. <div class=\"card has-timer active h-100p \">
  1008. <div class=\"card-body\">
  1009. <div class=\"card-item h-100p\"
  1010. data-start=\"{{ lesson.startTime ? lesson.startTime|date('Y-m-d H:i') : '' }}\"
  1011. data-end=\"{{ lesson.endTime ? lesson.endTime|date('Y-m-d H:i') : '' }}\"
  1012. data-lesson-id=\"{{ lesson.id }}\">
  1013. <div class=\"discipline\">
  1014. <div class=\"name\">{{ lesson.discipline.displayName }}</div>
  1015. </div>
  1016. <div class=\"users {{ wasOnline ? \"was-joined\" : \"\" }}\">
  1017. <div class=\"teacher\">
  1018. <div class=\"status\">
  1019. <div class=\"box {{ lesson.statusTeacher ? \"joined\" : \"not-joined\" }}\"></div>
  1020. </div>
  1021. <div class=\"label-wrap\">
  1022. <div class=\"text\">{% trans %}Korepetitorius:{% endtrans %}</div>
  1023. <div class=\"name\">{% set name = lesson.teacher|split(' ') %}{{ name[0] }}</div>
  1024. </div>
  1025. </div>
  1026. <div class=\"student\">
  1027. <div class=\"status\">
  1028. <div class=\"box {{ lesson.statusChild ? \"joined\" : \"not-joined\" }}\"></div>
  1029. </div>
  1030. <div class=\"label-wrap\">
  1031. <div class=\"text\">{% trans %}Mokinys:{% endtrans %}</div>
  1032. <div class=\"name\">{{ lesson.child.fullname }}</div>
  1033. </div>
  1034. </div>
  1035. </div>
  1036. {# <div class=\"timer\"> #}
  1037. {# Pradžia: {{ lesson.startTime ? lesson.startTime|date('Y-m-d H:i') : '' }} #}
  1038. {# </div> #}
  1039. {# <div style=\"display: none\" class=\"img\"><img #}
  1040. {# src=\"{{ lesson.teacher.profileImagePath ? lesson.teacher.profileImagePath : asset('assets/images/default.png') }}\"> #}
  1041. {# </div> #}
  1042. <div class=\"actions\">
  1043. <div class=\"notice\"></div>
  1044. <button class='btn btn-success join-lesson'
  1045. {{ lesson.getLessonJoin() ? \"\" : \"disabled\" }}
  1046. data-href=\"{{ path('unicko_router', {'id':lesson.id}) }}\">
  1047. Jungtis
  1048. </button>
  1049. </div>
  1050. </div>
  1051. </div>
  1052. </div>
  1053. {% endfor %}
  1054. </div>
  1055. </ul>
  1056. <ul class=\"nav-right\">
  1057. {% if is_granted('ROLE_ADMIN') %}
  1058. {% macro counter_badge(href, icon, count, title) %}
  1059. <li class=\"admin-counter-item\">
  1060. <a href=\"{{ href }}\" title=\"{{ title }}\">
  1061. <span class=\"counter-icon-wrap\">
  1062. <i class=\"fa-solid {{ icon }}\"></i>
  1063. <span class=\"badge badge-pill {{ count > 0 ? 'badge-danger' : 'badge-secondary' }}\">{{ count }}</span>
  1064. </span>
  1065. </a>
  1066. </li>
  1067. {% endmacro %}
  1068. {{ _self.counter_badge('/guardian_register/registrations', 'fa-user-plus', getNewRegistrationsCount(), 'Naujos registracijos') }}
  1069. {{ _self.counter_badge('/child_preference_assigment/', 'fa-list-check', getPendingAssignmentsCount(), 'Priskyrimo laukia') }}
  1070. <li class=\"admin-counter-item dropdown bug-report\">
  1071. <a href=\"javascript:void(0);\" title=\"Klaidos\">
  1072. <span class=\"counter-icon-wrap\">
  1073. <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"22\" height=\"22\" fill=\"currentColor\" class=\"bi bi-bug\" viewBox=\"0 0 16 16\">
  1074. <path d=\"M4.355.522a.5.5 0 0 1 .623.333l.291.956A5 5 0 0 1 8 1c1.007 0 1.946.298 2.731.811l.29-.956a.5.5 0 1 1 .957.29l-.41 1.352A5 5 0 0 1 13 6h.5a.5.5 0 0 0 .5-.5V5a.5.5 0 0 1 1 0v.5A1.5 1.5 0 0 1 13.5 7H13v1h1.5a.5.5 0 0 1 0 1H13v1h.5a1.5 1.5 0 0 1 1.5 1.5v.5a.5.5 0 1 1-1 0v-.5a.5.5 0 0 0-.5-.5H13a5 5 0 0 1-10 0h-.5a.5.5 0 0 0-.5.5v.5a.5.5 0 1 1-1 0v-.5A1.5 1.5 0 0 1 2.5 10H3V9H1.5a.5.5 0 0 1 0-1H3V7h-.5A1.5 1.5 0 0 1 1 5.5V5a.5.5 0 0 1 1 0v.5a.5.5 0 0 0 .5.5H3c0-1.364.547-2.601 1.432-3.503l-.41-1.352a.5.5 0 0 1 .333-.623M4 7v4a4 4 0 0 0 3.5 3.97V7zm4.5 0v7.97A4 4 0 0 0 12 11V7zM12 6a4 4 0 0 0-1.334-2.982A3.98 3.98 0 0 0 8 2a3.98 3.98 0 0 0-2.667 1.018A4 4 0 0 0 4 6z\"/>
  1075. </svg>
  1076. </span>
  1077. </a>
  1078. </li>
  1079. {% endif %}
  1080. {# <a href=\"{{ path('app_sync_google_lessons') }}\">SYNC</a> #}
  1081. {% if is_granted('ROLE_GUARDIAN') or is_granted('ROLE_CHILD') %}
  1082. <li class=\"dropdown\">
  1083. <a href=\"https://pagalba.corepetitus.lt/hc/lt/sections/22038273075346-Klientams\"
  1084. class=\"peers fxw-nw ai-c lh-1\">
  1085. <div class=\"peer\">
  1086. <i class=\"fa-solid fa-circle-question\"></i>
  1087. </div>
  1088. </a>
  1089. </li>
  1090. {% endif %}
  1091. {% if is_granted('ROLE_TEACHER') %}
  1092. <li class=\"dropdown\">
  1093. <a href=\"https://pagalba.corepetitus.lt/hc/lt/sections/22038256444690-Korepetitoriams\"
  1094. class=\"peers fxw-nw ai-c lh-1\">
  1095. <div class=\"peer\">
  1096. <i class=\"fa-solid fa-circle-question\"></i>
  1097. </div>
  1098. </a>
  1099. {# <ul class=\"dropdown-menu \"> #}
  1100. {# <li> #}
  1101. {# <span class=\"menu-item sub-headline\">{% trans %}Pasirinkite užklausos temą{% endtrans %}</span> #}
  1102. {# </li> #}
  1103. {# <li> #}
  1104. {# <a href=\"{{ path('me_teacher_stop_lessons_landing') }}\" class=\"menu-item\"> #}
  1105. {# <span>{% trans %}Korepetitoriaus laikinas veiklos stabdymas{% endtrans %}</span> #}
  1106. {# </a> #}
  1107. {# </li> #}
  1108. {# <li> #}
  1109. {# <a href=\"{{ path('me_teacher_sick_leaves_landing') }}\" class=\"menu-item\"> #}
  1110. {# <span>{% trans %}Korepetitorius susirgo{% endtrans %}</span> #}
  1111. {# </a> #}
  1112. {# </li> #}
  1113. {# <li> #}
  1114. {# <a href=\"{{ path('me_teacher_cancel_discipline') }}\" class=\"menu-item\"> #}
  1115. {# <span>{% trans %}Nebegaliu mokyti tam tikros disciplinos{% endtrans %}</span> #}
  1116. {# </a> #}
  1117. {# </li> #}
  1118. {# <li> #}
  1119. {# <a href=\"{{ path('me_teacher_cancel_class') }}\" class=\"menu-item\"> #}
  1120. {# <span>{% trans %}Nebegaliu mokyti tam tikros klasės{% endtrans %}</span> #}
  1121. {# </a> #}
  1122. {# </li> #}
  1123. {# </ul> #}
  1124. </li>
  1125. <li class=\"nav-badge\">
  1126. <a href=\"{{ path('app_salary_vacation') }}\" class=\"peers\">
  1127. <div class=\"peer\">
  1128. <img class=\"w-3r\"
  1129. src=\"{{ asset(\"assets/images/badge_#{app.user.levelInfo.badge}.svg\") }}\" alt=\"\">
  1130. </div>
  1131. </a>
  1132. </li>
  1133. {% endif %}
  1134. <li class=\"{{ is_granted('ROLE_ADMIN') ? 'admin-counter-item ' : '' }}notifications dropdown\">
  1135. <a href=\"\" class=\"dropdown-toggle user-notifications no-after {{ is_granted('ROLE_ADMIN') ? '' : 'peers fxw-nw ai-c lh-1' }}\"
  1136. data-toggle=\"dropdown\">
  1137. {% if is_granted('ROLE_ADMIN') %}
  1138. <span class=\"counter-icon-wrap\">
  1139. <i class=\"fa fa-bell {% if getUserNotificationCount() %}ring{% endif %}\"></i>
  1140. <span class=\"badge badge-pill {{ getUserNotificationCount() > 0 ? 'badge-danger' : 'badge-secondary' }}\">{{ getUserNotificationCount() }}</span>
  1141. </span>
  1142. {% else %}
  1143. <div class=\"peer\">
  1144. <i class=\"fa fa-bell {% if getUserNotificationCount() %}ring{% endif %}\">
  1145. {% if getUserNotificationCount() %}
  1146. <span class=\"badge badge-danger badge-pill user-notification-badge\"><span class=\"number\">{{ getUserNotificationCount() }}</span></span>
  1147. {% endif %}
  1148. </i>
  1149. </div>
  1150. {% endif %}
  1151. </a>
  1152. <ul class=\"dropdown-menu\" aria-labelledby=\"dropdownMenuButton1\" data-bs-popper=\"none\">
  1153. <li class=\"notification-title\"><i class=\"fa fa-bell pR-10\"></i> <span class=\"text\">Pranešimai</span>
  1154. </li>
  1155. {% if getUserNotificationData().notifications | length > 0 %}
  1156. {% for notification in getUserNotificationData().notifications %}
  1157. <li class=\"\">
  1158. <a href=\"{{ path('app_me_notification_index_id',{id:notification.id}) }}\"
  1159. class=\"{{ notification.seen ? \"\" : \"new\" }} peers fxw-nw td-n bdB c-grey-800 cH-blue bgcH-grey-100\">
  1160. <div class=\"peer mR-10\">
  1161. <div class=\"image w-3r\"
  1162. style=\"background-image: url({{ notification.createdBy.profileImagePath }})\"></div>
  1163. </div>
  1164. <div class=\"peer peer-greed\">
  1165. <div>
  1166. <div class=\"peers jc-sb fxw-nw mB-5\">
  1167. <div class=\"peer\"><p
  1168. class=\"fw-500 mB-0\">{{ notification.topic | truncate(25, false) }}</p>
  1169. </div>
  1170. <div class=\"peer alt-text\">
  1171. <small class=\"fsz-xs\">prieš {{ notification.getAgo(app.user) }}</small>
  1172. </div>
  1173. </div>
  1174. <span class=\"sub-headline\">{{ notification.message | striptags | truncate(60, true) | split('.')|first | raw }}</span>
  1175. </div>
  1176. </div>
  1177. </a>
  1178. </li>
  1179. {% endfor %}
  1180. {% else %}
  1181. <li class=\"c-grey-600 cH-blue td-n ta-c p-10\">Pranešimų nėra</li>
  1182. {% endif %}
  1183. <li class=\"notification-title ta-c\">
  1184. <span>
  1185. <a href=\"{{ path('app_me_notification_index') }}\" class=\"td-n\">Visi pranešimai
  1186. <i class=\"ti-angle-right fsz-xs mL-10\"></i>
  1187. </a>
  1188. </span>
  1189. </li>
  1190. </ul>
  1191. </li>
  1192. {% if is_granted('ROLE_TEACHER') %}
  1193. {% set teacherPublicProfiles = app.user.teacherPublicProfiles|default([]) %}
  1194. {% set teacherEditablePublicProfiles = teacherPublicProfiles|filter(publicProfile => publicProfile.status in [constant('App\\\\Entity\\\\TeacherPublicProfile::STATUS_IN_REVIEW'), constant('App\\\\Entity\\\\TeacherPublicProfile::STATUS_REJECTED')]) %}
  1195. {% set teacherConfirmedPublicProfiles = teacherPublicProfiles|filter(publicProfile => publicProfile.status == constant('App\\\\Entity\\\\TeacherPublicProfile::STATUS_CONFIRMED')) %}
  1196. {% set teacherPublicProfile = teacherEditablePublicProfiles|length ? teacherEditablePublicProfiles|first : (teacherConfirmedPublicProfiles|length ? teacherConfirmedPublicProfiles|first : null) %}
  1197. {% set isTeacherPublicProfileCanceled = teacherPublicProfile and teacherPublicProfile.status == constant('App\\\\Entity\\\\TeacherPublicProfile::STATUS_REJECTED') %}
  1198. {% if not teacherPublicProfile or isTeacherPublicProfileCanceled %}
  1199. <li class=\"nav-fill-profile-item\">
  1200. <span class=\"nav-fill-profile-btn\"{% if isTeacherPublicProfileCanceled %} style=\"border-color:#dc3545;color:#dc3545;\"{% endif %}>
  1201. <a href=\"{{ path('me_teacher_public_profile') }}\" class=\"td-n\"{% if isTeacherPublicProfileCanceled %} style=\"color:#dc3545;\"{% endif %}>
  1202. <i class=\"fas fa-exclamation-triangle\" style=\"margin-right:6px;\"></i>{% trans %}Reikia užpildyti viešą profilį{% endtrans %}
  1203. </a>
  1204. </span>
  1205. </li>
  1206. {% endif %}
  1207. {% endif %}
  1208. <li class=\"dropdown\">
  1209. <a href=\"\" class=\"dropdown-toggle no-after peers fxw-nw ai-c lh-1\" data-toggle=\"dropdown\">
  1210. <div class=\"peer\">
  1211. <img class=\"w-2r bdrs-50p\"
  1212. src=\"{% if app.user is defined and app.user is not null and app.user.profileImagePath is not null %}{{ app.user.profileImagePath }}{% else %}{{ asset('assets/images/default.png') }}{% endif %}\"
  1213. alt=\"\">
  1214. </div>
  1215. <div class=\"peer pl-2\">
  1216. <span class=\" user-name\">{% if app.user is defined and app.user is not null and app.user.fullname is not null %}{{ app.user.fullname }}{% endif %}</span>
  1217. </div>
  1218. </a>
  1219. <ul class=\"dropdown-menu \">
  1220. {% if is_granted('ROLE_TEACHER') %}
  1221. <li>
  1222. {% if not teacherPublicProfile %}
  1223. <a href=\"{{ path('me_teacher_public_profile') }}\" class=\"menu-item fill-profile-dropdown-link\" style=\"color:#e08c00;font-weight:600;display:flex;align-items:center;\">
  1224. <i class=\"fas fa-exclamation-triangle\" style=\"padding-left:25px;margin-right:4px;flex-shrink:0;\"></i><span style=\"padding:0;margin:0;font-weight:700;\">{% trans %}Užpildyk savo viešą profilį{% endtrans %}</span>
  1225. </a>
  1226. {% elseif teacherPublicProfile.status == constant('App\\\\Entity\\\\TeacherPublicProfile::STATUS_REJECTED') %}
  1227. <a href=\"{{ path('me_teacher_public_profile') }}\" class=\"menu-item fill-profile-dropdown-link\" style=\"color:#dc3545;font-weight:600;display:flex;align-items:center;\">
  1228. <i class=\"fas fa-exclamation-triangle\" style=\"padding-left:25px;margin-right:4px;flex-shrink:0;\"></i><span style=\"padding:0;margin:0;font-weight:700;\">{% trans %}Užpildyk savo viešą profilį{% endtrans %}</span>
  1229. </a>
  1230. {% else %}
  1231. <a href=\"{{ path('me_teacher_public_profile') }}\" class=\"menu-item\">
  1232. <span>{% trans %}Public Profile{% endtrans %}</span>
  1233. </a>
  1234. {% endif %}
  1235. </li>
  1236. <li class=\"divider\"></li>
  1237. {% endif %}
  1238. <li>
  1239. <a href=\"{{ path('me_edit') }}\" class=\"menu-item\">
  1240. <span>{% trans %}Edit Profile{% endtrans %}</span>
  1241. </a>
  1242. </li>
  1243. <li>
  1244. <a href=\"/logout\" class=\"menu-item\">
  1245. <span>{% trans %}Logout{% endtrans %}</span>
  1246. </a>
  1247. </li>
  1248. </ul>
  1249. </li>
  1250. <li>
  1251. <a id=\"sidebar-toggle\" class=\"sidebar-toggle\" href=\"javascript:void(0);\">
  1252. <i class=\"fa-solid fa-bars\"></i>
  1253. <i class=\"fa-solid fa-xmark\"></i>
  1254. </a>
  1255. </li>
  1256. </ul>
  1257. </div>
  1258. </div>
  1259. {% if not is_granted('ROLE_ADMIN') %}
  1260. {% block stylesheets %}
  1261. {% endblock %}
  1262. {% block javascripts %}
  1263. {# {{ encore_entry_script_tags('app') }}#}
  1264. <script>
  1265. document.addEventListener(\"DOMContentLoaded\", function(event) {
  1266. \$('.card.has-timer').each(function (index, item) {
  1267. CountDownTimer(item);
  1268. })
  1269. \$('.move-lesson').on('click', function () {
  1270. Swal.fire({
  1271. title: \"Ar tikrai?\",
  1272. text: \"Norint perkelti užsiėmimą į naują dieną ir laiką privaloma susitarti su mokinio ar mokinio tėvais/ globėjais. Nesusitarus, perkelti draudžiama.\",
  1273. icon: \"warning\",
  1274. showCancelButton: true,
  1275. confirmButtonColor: \"#3085d6\",
  1276. cancelButtonColor: \"#d33\",
  1277. confirmButtonText: \"Tėvai/mokinys sutiko\",
  1278. cancelButtonText: \"Dar nesusitariau\",
  1279. customClass: {container: \"version_2\"},
  1280. }).then((result) => {
  1281. if (result.isConfirmed) {
  1282. initLessonMoveModal(this.getAttribute('data-lesson'))
  1283. }
  1284. })
  1285. })
  1286. \$('.missed-lesson').on('click', function () {
  1287. let modal = \$('#missedLessonModal');
  1288. modal.modal().show();
  1289. modal.attr('data-lesson', this.getAttribute('data-lesson'))
  1290. })
  1291. \$('#modal .modal-save').on('click', function (e) {
  1292. e.stopPropagation()
  1293. if (\$('.modal-body form').get(0).reportValidity()) {
  1294. if (confirm(\"Ar tikrai norite perkelti šią pamoką?\")) {
  1295. let lessonId = this.getAttribute('lesson');
  1296. let url = `{{ path('me_teacher_lesson_move', {'id': 'id'}) }}`;
  1297. url = url.replace('id', lessonId);
  1298. \$.ajax({
  1299. type: 'POST',
  1300. url: url,
  1301. data: \$('.modal-body form').serialize(),
  1302. success: function (res) {
  1303. \$('#modal').modal('hide')
  1304. \$('#modal .modal-footer .modal-save').removeAttr('lesson')
  1305. window.location.reload()
  1306. },
  1307. error: function (error) {
  1308. toastr.error(error.responseJSON.status);
  1309. }
  1310. });
  1311. }
  1312. }
  1313. })
  1314. let searchParams = new URLSearchParams(window.location.search)
  1315. if (searchParams.has('action') && searchParams.get('action') == 'missed') {// true
  1316. initModal('Informacija', `
  1317. <p>Kadangi kita pusė neinformuotai praleido užsiėmimą (neprisijungė laiku), užsiėmimas laikomas kaip kitos pusės neinformuotai praleistas.</p>
  1318. <p>Klientas už tokį korepetitoriaus praleistą užsiėmimą pinigų nemoka. Esant galimybei, korepetitorius susisieks su Jumis ir sutars naują laiką užsiėmimui atidirbti.</p>
  1319. <p>Korepetitorius už tokį mokinio praleistą užsiėmimą atlygį gauna ir klientas už mokinio neinformuotai praleistą užsiėmimą moka pilną kainą. Esant galimybei, korepetitorius susisieks su Jumis ir sutars naują laiką užsiėmimui atidirbti.</p>`);
  1320. let url = document.location.href;
  1321. window.history.pushState({}, \"\", url.split(\"?\")[0]);
  1322. }
  1323. if (searchParams.has('action') && searchParams.get('action') == 'moved') {// true
  1324. initModal('Informacija', `
  1325. <div class=\"ta-c\">
  1326. <p>Korepetitorius šį užsiėmimą ką tik perkėlė ir užsiėmimas vyks kitu laiku!</p>
  1327. <p>Pradinė užsiėmimo data ir laikas:<br>\${searchParams.get('from')}</p>
  1328. <p>Nauja užsiėmimo data ir laikas:<br>\${searchParams.get('to')}</p>
  1329. </div>`);
  1330. let url = document.location.href;
  1331. window.history.pushState({}, \"\", url.split(\"?\")[0]);
  1332. }
  1333. if (searchParams.has('action') && searchParams.get('action') == 'denied') {// true
  1334. initModal('Šiuo metu nėra galimybės prisijungti prie užsiėmimo.', `
  1335. <div class=\"ta-c\">
  1336. <p><b>Taip yra dėl vienos iš žemiau pateiktų priežasčių:</b></p>
  1337. <p>A) šiuo metu vienas vartotojas jau yra prisijungęs (mokinys arba tėvas/ globėjas);</p>
  1338. <p>B) jūs neplanuotai atsijungėte nuo užsiėmimo.</p>
  1339. <p><b>JEI NORITE PRISIJUNGTI:</b></p>
  1340. <p>A) atveju privaloma, jog vienas vartotojas atsijungtų ir tik tada galės prisijungti kitas vartotojas;</p>
  1341. <p>B) atveju vėl galėsite prisijungti 60 sekundžių eigoje nuo neplanuoto atsijungimo;</p>
  1342. </div>`);
  1343. let url = document.location.href;
  1344. // window.history.pushState({}, \"\", url.split(\"?\")[0]);
  1345. }
  1346. // create new scope
  1347. var timer;
  1348. // bind event handler
  1349. \$('.join-lesson').on('click', function () {
  1350. var buttonClicked = this;
  1351. if (timer) {
  1352. clearTimeout(timer);
  1353. }
  1354. timer = setTimeout(function () {
  1355. window.open(buttonClicked.getAttribute('data-href'), \"_blank\")
  1356. }, 700, buttonClicked);
  1357. });
  1358. })
  1359. function initModal(header, body, footerVisible = false) {
  1360. let modal = \$('#modal').modal();
  1361. modal.find('.modal-header .modal-title').html(header)
  1362. modal.find('.modal-body .content').html(body)
  1363. if (footerVisible) {
  1364. modal.find('.modal-footer').show();
  1365. } else {
  1366. modal.find('.modal-footer').hide();
  1367. }
  1368. modal.show();
  1369. }
  1370. function initLessonMoveModal(lessonId) {
  1371. let url = `{{ path('me_teacher_lesson_move', {'id': 'id'}) }}`;
  1372. url = url.replace('id', lessonId);
  1373. \$('#modal .modal-footer .modal-save').attr('lesson', lessonId);
  1374. \$.ajax({
  1375. type: 'GET',
  1376. url: url,
  1377. success: function (res) {
  1378. initModal('Perkelti...', res, true);
  1379. \$('#lesson_move_startTime').flatpickr({
  1380. locale: \"lt\",
  1381. altInput: true,
  1382. enableTime: true,
  1383. altFormat: \"Y-m-d H:i\",
  1384. dateFormat: \"Y-m-d H:i\",
  1385. minTime: \"05:00\",
  1386. time_24hr: true,
  1387. allowInput: true,
  1388. onClose: function (change, string, event) {
  1389. var duration = \$('#lesson_move_duration').val();
  1390. var endTime = moment(string).add(duration, 'minutes').format('YYYY-MM-DD HH:mm')
  1391. \$('#lesson_move_endTime').val(endTime);
  1392. }
  1393. })
  1394. }
  1395. })
  1396. }
  1397. function CountDownTimer(selector) {
  1398. var timeBlock = \$(selector).find('.card-item');
  1399. var startTime = new Date(timeBlock.attr('data-start').replace(/-/g, \"/\"));
  1400. var endTime = new Date(timeBlock.attr('data-end').replace(/-/g, \"/\"));
  1401. endTime = endTime.setMinutes(endTime.getMinutes() + 4);
  1402. var _second = 1000;
  1403. var _minute = _second * 60;
  1404. var _hour = _minute * 60;
  1405. var _day = _hour * 24;
  1406. var timer;
  1407. ///var now = new Date(\"{{ \"now\"|date('Y-m-d H:i:s') }}\");
  1408. var server = moment('{{ \"now\"|date('Y-m-d H:i:s') }}')
  1409. var user = moment()
  1410. var difference = user - server;
  1411. // console.log(server);
  1412. function showRemaining() {
  1413. var now = new Date(new Date().toLocaleString(\"en-US\", {timeZone: \"Europe/Vilnius\"})) - difference;
  1414. // console.log(moment(now).format())
  1415. // console.log(moment().format())
  1416. var distanceUntilStart = startTime - now;
  1417. var days = Math.floor(distanceUntilStart / _day);
  1418. var hours = Math.floor((distanceUntilStart % _day) / _hour);
  1419. var minutes = Math.floor((distanceUntilStart % _hour) / _minute);
  1420. var seconds = Math.floor((distanceUntilStart % _minute) / _second);
  1421. //how long lesson is already going
  1422. var distanceFromStart = now - startTime;
  1423. var goingHours = Math.floor((distanceFromStart % _day) / _hour);
  1424. var goingMinutes = Math.floor((distanceFromStart % _hour) / _minute) + (goingHours * 60);
  1425. var goingSeconds = Math.floor((distanceFromStart % _minute) / _second);
  1426. //how long after the lesson end to remove the card dom object.
  1427. var distanceFromEnd = endTime - now;
  1428. var afterMinutes = Math.floor((distanceFromEnd % _hour) / _minute);
  1429. var afterSeconds = Math.floor((distanceFromEnd % _minute) / _second);
  1430. //console.log(goingMinutes + \" going\");
  1431. if (distanceUntilStart > 0) {
  1432. // timeText = days + 'days ';
  1433. timeText = hours + 'val. ';
  1434. timeText += minutes + 'min. ';
  1435. timeText += seconds + 's.';
  1436. // \$(selector).find('.timer').html(timeText);//bug
  1437. checkminutes = 5
  1438. {% if is_granted('ROLE_TEACHER') %}
  1439. checkminutes = 10
  1440. {% endif %}
  1441. if (days == 0 && hours == 0 && minutes < checkminutes) {
  1442. // \$(selector).find('.timer').hide()
  1443. \$(selector).find('.notice').html(`Iki pradžios liko: <b>\${minutes} min. \${seconds} s.</b><br>Junkitės į užsiėmimą!`)
  1444. \$(selector).find('.join-lesson').removeAttr('disabled')
  1445. } else {
  1446. if (days > 0) {
  1447. \$(selector).find('.notice').html(`Iki užsiėmimo pradžios liko: <b>\${days + \" d.\"} \${hours} val \${minutes} min.</b>`)
  1448. } else {
  1449. if (hours == 0) {
  1450. let text = `Iki užsiėmimo pradžios: <b>\${minutes} min. \${seconds} s.</b>`
  1451. {% if is_granted('ROLE_TEACHER') %}
  1452. minutes = minutes - 10
  1453. {% else %}
  1454. minutes = minutes - 5
  1455. {% endif %}
  1456. text += `<br>Jungtis galėsite po: <b>\${minutes} min. \${seconds} s.</b>`;
  1457. \$(selector).find('.notice').html(text)
  1458. } else {
  1459. let text = `Iki užsiėmimo pradžios: <b>\${hours} val \${minutes} min.</b>`
  1460. {% if is_granted('ROLE_TEACHER') %}
  1461. minutes = minutes - 10
  1462. {% else %}
  1463. minutes = minutes - 5
  1464. {% endif %}
  1465. if (minutes < 0) {
  1466. hours = hours - 1;
  1467. minutes = minutes + 60;
  1468. }
  1469. text += `<br>Jungtis galėsite po: <b>\${hours ? hours : \"\"} \${hours ? \"val\" : \"\"} \${minutes} min.</b>`;
  1470. \$(selector).find('.notice').html(text)
  1471. }
  1472. }
  1473. }
  1474. if (days == 0 && hours == 0 && minutes < 60) {
  1475. \$(selector).find('.missed-lesson').attr('disabled', false);
  1476. } else {
  1477. \$(selector).find('.missed-lesson').attr('disabled', true);
  1478. }
  1479. return;
  1480. }
  1481. //console.log('after', afterMinutes)
  1482. // console.log(`afterminutes`,afterMinutes);
  1483. // console.log(`going`,goingMinutes);
  1484. if (distanceFromStart > 0) {
  1485. lesson = \$(selector).find('.card-item').data('lesson-id');
  1486. if (!\$(`[data-lesson-id=\${lesson}]`).find('.users').hasClass('was-joined')) {
  1487. if (\$(selector).find('.teacher').find('.box').hasClass('not-joined') && \$(selector).find('.student').find('.box').hasClass('not-joined') && goingMinutes > 4) {
  1488. \$(`[data-lesson-id=\${lesson}]`).parent().parent().hide();
  1489. }
  1490. if (\$(selector).find('.student').find('.box').hasClass('not-joined') && \$(selector).find('.teacher').find('.box').hasClass('not-joined') && goingMinutes > 14) {
  1491. \$(`[data-lesson-id=\${lesson}]`).parent().parent().hide();
  1492. // \$(selector).find('.btn').hide();
  1493. }
  1494. }
  1495. // \$(selector).find('.timer').hide()
  1496. \$(selector).find('.notice').html(``);
  1497. \$(selector).find('.notice').html(`Jau vyksta (\${goingMinutes}min. \${goingSeconds}s.)!`);
  1498. }
  1499. if (afterMinutes < 0) {
  1500. clearInterval(timer);
  1501. \$(selector).hide();
  1502. }
  1503. }
  1504. timer = setInterval(showRemaining, 1000);
  1505. }
  1506. {% set userType = lessonExtension.learncubeUser %}
  1507. {% if is_granted('ROLE_GUARDIAN') %}
  1508. {% set userType = constant('App\\\\Service\\\\LearnCubeService::tag_guardian') %}
  1509. {% endif %}
  1510. const eventSource = new EventSource(\"{{ mercure('lesson_status/' ~ userType ~ '/' ~ app.user.id )|escape('js') }}\");
  1511. eventSource.onmessage = event => {
  1512. event = JSON.parse(event.data);
  1513. console.log(event);
  1514. if (event.action == \"reload\") {
  1515. window.location.reload();
  1516. }
  1517. if (event.id > 0) {
  1518. \$(`.lesson-list .card-item[data-lesson-id=\${event.id}] .box`).removeClass('joined')
  1519. \$(`.lesson-list .card-item[data-lesson-id=\${event.id}] .box`).removeClass('not-joined')
  1520. \$(`.lesson-list .card-item[data-lesson-id=\${event.id}] .teacher .box`).toggleClass(parseStatus(event.teacher))
  1521. \$(`.lesson-list .card-item[data-lesson-id=\${event.id}] .student .box`).toggleClass(parseStatus(event.student))
  1522. }
  1523. }
  1524. function parseStatus(status) {
  1525. if (status) {
  1526. return \"joined\"
  1527. } else {
  1528. return `not-joined`
  1529. }
  1530. }
  1531. </script>
  1532. {% endblock %}
  1533. {% endif %}
  1534. ", "menu_components/header_nav_bar/header_nav_bar_new.html.twig", "/var/www/project/templates/menu_components/header_nav_bar/header_nav_bar_new.html.twig");
  1535. }
  1536. }