var/cache/dev/twig/54/5403fafedd2c0ecfa1611fe3d90c5c02.php line 44

Open in your IDE?
  1. <?php
  2. use Twig\Environment;
  3. use Twig\Error\LoaderError;
  4. use Twig\Error\RuntimeError;
  5. use Twig\Extension\CoreExtension;
  6. use Twig\Extension\SandboxExtension;
  7. use Twig\Markup;
  8. use Twig\Sandbox\SecurityError;
  9. use Twig\Sandbox\SecurityNotAllowedTagError;
  10. use Twig\Sandbox\SecurityNotAllowedFilterError;
  11. use Twig\Sandbox\SecurityNotAllowedFunctionError;
  12. use Twig\Source;
  13. use Twig\Template;
  14. use Twig\TemplateWrapper;
  15. /* course/show.html.twig */
  16. class __TwigTemplate_9a56a656685a6aa89b771fcfda362603 extends Template
  17. {
  18. private Source $source;
  19. /**
  20. * @var array<string, Template>
  21. */
  22. private array $macros = [];
  23. public function __construct(Environment $env)
  24. {
  25. parent::__construct($env);
  26. $this->source = $this->getSourceContext();
  27. $this->blocks = [
  28. 'title' => [$this, 'block_title'],
  29. 'content' => [$this, 'block_content'],
  30. ];
  31. }
  32. protected function doGetParent(array $context): bool|string|Template|TemplateWrapper
  33. {
  34. // line 1
  35. return "layout/backEndLayout.html.twig";
  36. }
  37. protected function doDisplay(array $context, array $blocks = []): iterable
  38. {
  39. $macros = $this->macros;
  40. $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  41. $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "course/show.html.twig"));
  42. $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  43. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "course/show.html.twig"));
  44. $this->parent = $this->load("layout/backEndLayout.html.twig", 1);
  45. yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks));
  46. $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  47. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  48. }
  49. // line 3
  50. /**
  51. * @return iterable<null|scalar|\Stringable>
  52. */
  53. public function block_title(array $context, array $blocks = []): iterable
  54. {
  55. $macros = $this->macros;
  56. $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  57. $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "title"));
  58. $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  59. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "title"));
  60. yield "Détail du Cours - ";
  61. yield from $this->yieldParentBlock("title", $context, $blocks);
  62. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  63. $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  64. yield from [];
  65. }
  66. // line 5
  67. /**
  68. * @return iterable<null|scalar|\Stringable>
  69. */
  70. public function block_content(array $context, array $blocks = []): iterable
  71. {
  72. $macros = $this->macros;
  73. $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  74. $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "content"));
  75. $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  76. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "content"));
  77. // line 6
  78. yield "<div class=\"container mt-5\">
  79. <div class=\"row mb-3\">
  80. <div class=\"col-lg-2\">
  81. ";
  82. // line 10
  83. if ((($tmp = $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_ADMIN")) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
  84. // line 11
  85. yield " <a href=\"";
  86. yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("admin_courses");
  87. yield "\" class=\"btn btn-info w-100\">
  88. <i class=\"fa fa-list\"></i> Retour à la liste
  89. </a>
  90. ";
  91. }
  92. // line 15
  93. yield " </div>
  94. <div class=\"col-lg-10\">
  95. <div class=\"card shadow-lg border-0 rounded-4\">
  96. <div class=\"card-header bg-primary text-white text-center rounded-top-4\">
  97. <h4 class=\"mb-0\">";
  98. // line 21
  99. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["course"]) || array_key_exists("course", $context) ? $context["course"] : (function () { throw new RuntimeError('Variable "course" does not exist.', 21, $this->source); })()), "wording", [], "any", false, false, false, 21), "html", null, true);
  100. yield "</h4>
  101. </div>
  102. <div class=\"card-body p-4\">
  103. <ul class=\"list-unstyled h5 mb-4 row\">
  104. <li class=\"col-md-3\"><strong>Coefficient:</strong> ";
  105. // line 27
  106. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["course"]) || array_key_exists("course", $context) ? $context["course"] : (function () { throw new RuntimeError('Variable "course" does not exist.', 27, $this->source); })()), "coefficient", [], "any", false, false, false, 27), "html", null, true);
  107. yield "</li>
  108. <li class=\"col-md-3\"><strong>Code:</strong> ";
  109. // line 28
  110. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["course"]) || array_key_exists("course", $context) ? $context["course"] : (function () { throw new RuntimeError('Variable "course" does not exist.', 28, $this->source); })()), "code", [], "any", false, false, false, 28), "html", null, true);
  111. yield "</li>
  112. <li class=\"col-md-3\"><strong>Module:</strong> ";
  113. // line 29
  114. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["course"]) || array_key_exists("course", $context) ? $context["course"] : (function () { throw new RuntimeError('Variable "course" does not exist.', 29, $this->source); })()), "module", [], "any", false, false, false, 29), "name", [], "any", false, false, false, 29), "html", null, true);
  115. yield "</li>
  116. <li class=\"col-md-3\"><strong>Domaine:</strong> ";
  117. // line 30
  118. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["course"]) || array_key_exists("course", $context) ? $context["course"] : (function () { throw new RuntimeError('Variable "course" does not exist.', 30, $this->source); })()), "domain", [], "any", false, false, false, 30), "name", [], "any", false, false, false, 30), "html", null, true);
  119. yield "</li>
  120. </ul>
  121. ";
  122. // line 33
  123. if ((($tmp = $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_ADMIN")) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
  124. // line 34
  125. yield " <div class=\"mb-4 text-center\">
  126. <a href=\"";
  127. // line 35
  128. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("admin_courses_edit", ["id" => CoreExtension::getAttribute($this->env, $this->source, (isset($context["course"]) || array_key_exists("course", $context) ? $context["course"] : (function () { throw new RuntimeError('Variable "course" does not exist.', 35, $this->source); })()), "id", [], "any", false, false, false, 35)]), "html", null, true);
  129. yield "\" class=\"btn btn-warning me-2\">
  130. <i class=\"fa fa-pencil\"></i> Modifier le cours
  131. </a>
  132. <a href=\"#\" class=\"btn btn-danger\"
  133. onclick=\"event.preventDefault(); if(confirm('Êtes-vous sûr de vouloir supprimer ce cours ?')) document.getElementById('delete-course-form').submit();\">
  134. <i class=\"fa fa-trash\"></i> Supprimer le cours
  135. </a>
  136. <form id=\"delete-course-form\" method=\"post\" action=\"";
  137. // line 42
  138. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("admin_courses_delete", ["id" => CoreExtension::getAttribute($this->env, $this->source, (isset($context["course"]) || array_key_exists("course", $context) ? $context["course"] : (function () { throw new RuntimeError('Variable "course" does not exist.', 42, $this->source); })()), "id", [], "any", false, false, false, 42)]), "html", null, true);
  139. yield "\" style=\"display:none;\">
  140. <input type=\"hidden\" name=\"_method\" value=\"DELETE\" />
  141. <input type=\"hidden\" name=\"csrf_token\" value=\"";
  142. // line 44
  143. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getRuntime('Symfony\Component\Form\FormRenderer')->renderCsrfToken(("courses_deletion" . CoreExtension::getAttribute($this->env, $this->source, (isset($context["course"]) || array_key_exists("course", $context) ? $context["course"] : (function () { throw new RuntimeError('Variable "course" does not exist.', 44, $this->source); })()), "id", [], "any", false, false, false, 44))), "html", null, true);
  144. yield "\" />
  145. </form>
  146. </div>
  147. ";
  148. }
  149. // line 48
  150. yield "
  151. <h5 class=\"mb-3 border-bottom pb-2\">Historique des attributions</h5>
  152. <div class=\"table-responsive\">
  153. <table class=\"table table-striped table-hover text-center align-middle\">
  154. <thead class=\"table-primary\">
  155. <tr>
  156. <th scope=\"col\">Année scolaire</th>
  157. <th scope=\"col\">Enseignant</th>
  158. <th scope=\"col\">Titulaire</th>
  159. </tr>
  160. </thead>
  161. <tbody>
  162. ";
  163. // line 61
  164. $context['_parent'] = $context;
  165. $context['_seq'] = CoreExtension::ensureTraversable(Twig\Extension\CoreExtension::reverse($this->env->getCharset(), CoreExtension::getAttribute($this->env, $this->source, (isset($context["course"]) || array_key_exists("course", $context) ? $context["course"] : (function () { throw new RuntimeError('Variable "course" does not exist.', 61, $this->source); })()), "attributions", [], "any", false, false, false, 61)));
  166. $context['_iterated'] = false;
  167. foreach ($context['_seq'] as $context["_key"] => $context["attribution"]) {
  168. // line 62
  169. yield " <tr>
  170. <td>";
  171. // line 63
  172. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["attribution"], "schoolYear", [], "any", false, false, false, 63), "html", null, true);
  173. yield "</td>
  174. <td>";
  175. // line 64
  176. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["attribution"], "teacher", [], "any", false, false, false, 64), "html", null, true);
  177. yield "</td>
  178. <td>";
  179. // line 65
  180. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["attribution"], "headTeacher", [], "any", false, false, false, 65), "html", null, true);
  181. yield "</td>
  182. </tr>
  183. ";
  184. $context['_iterated'] = true;
  185. }
  186. // line 67
  187. if (!$context['_iterated']) {
  188. // line 68
  189. yield " <tr>
  190. <td colspan=\"3\" class=\"text-center\">Aucune attribution trouvée.</td>
  191. </tr>
  192. ";
  193. }
  194. $_parent = $context['_parent'];
  195. unset($context['_seq'], $context['_key'], $context['attribution'], $context['_parent'], $context['_iterated']);
  196. $context = array_intersect_key($context, $_parent) + $_parent;
  197. // line 72
  198. yield " </tbody>
  199. </table>
  200. </div>
  201. </div>
  202. </div>
  203. </div>
  204. </div>
  205. </div>
  206. ";
  207. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  208. $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  209. yield from [];
  210. }
  211. /**
  212. * @codeCoverageIgnore
  213. */
  214. public function getTemplateName(): string
  215. {
  216. return "course/show.html.twig";
  217. }
  218. /**
  219. * @codeCoverageIgnore
  220. */
  221. public function isTraitable(): bool
  222. {
  223. return false;
  224. }
  225. /**
  226. * @codeCoverageIgnore
  227. */
  228. public function getDebugInfo(): array
  229. {
  230. return array ( 228 => 72, 219 => 68, 217 => 67, 210 => 65, 206 => 64, 202 => 63, 199 => 62, 194 => 61, 179 => 48, 172 => 44, 167 => 42, 157 => 35, 154 => 34, 152 => 33, 146 => 30, 142 => 29, 138 => 28, 134 => 27, 125 => 21, 117 => 15, 109 => 11, 107 => 10, 101 => 6, 88 => 5, 64 => 3, 41 => 1,);
  231. }
  232. public function getSourceContext(): Source
  233. {
  234. return new Source("{% extends 'layout/backEndLayout.html.twig' %}
  235. {% block title %}Détail du Cours - {{ parent() }}{% endblock %}
  236. {% block content %}
  237. <div class=\"container mt-5\">
  238. <div class=\"row mb-3\">
  239. <div class=\"col-lg-2\">
  240. {% if is_granted('ROLE_ADMIN') %}
  241. <a href=\"{{ path('admin_courses') }}\" class=\"btn btn-info w-100\">
  242. <i class=\"fa fa-list\"></i> Retour à la liste
  243. </a>
  244. {% endif %}
  245. </div>
  246. <div class=\"col-lg-10\">
  247. <div class=\"card shadow-lg border-0 rounded-4\">
  248. <div class=\"card-header bg-primary text-white text-center rounded-top-4\">
  249. <h4 class=\"mb-0\">{{ course.wording }}</h4>
  250. </div>
  251. <div class=\"card-body p-4\">
  252. <ul class=\"list-unstyled h5 mb-4 row\">
  253. <li class=\"col-md-3\"><strong>Coefficient:</strong> {{ course.coefficient }}</li>
  254. <li class=\"col-md-3\"><strong>Code:</strong> {{ course.code }}</li>
  255. <li class=\"col-md-3\"><strong>Module:</strong> {{ course.module.name }}</li>
  256. <li class=\"col-md-3\"><strong>Domaine:</strong> {{ course.domain.name }}</li>
  257. </ul>
  258. {% if is_granted('ROLE_ADMIN') %}
  259. <div class=\"mb-4 text-center\">
  260. <a href=\"{{ path('admin_courses_edit', {id: course.id}) }}\" class=\"btn btn-warning me-2\">
  261. <i class=\"fa fa-pencil\"></i> Modifier le cours
  262. </a>
  263. <a href=\"#\" class=\"btn btn-danger\"
  264. onclick=\"event.preventDefault(); if(confirm('Êtes-vous sûr de vouloir supprimer ce cours ?')) document.getElementById('delete-course-form').submit();\">
  265. <i class=\"fa fa-trash\"></i> Supprimer le cours
  266. </a>
  267. <form id=\"delete-course-form\" method=\"post\" action=\"{{ path('admin_courses_delete', {id: course.id}) }}\" style=\"display:none;\">
  268. <input type=\"hidden\" name=\"_method\" value=\"DELETE\" />
  269. <input type=\"hidden\" name=\"csrf_token\" value=\"{{ csrf_token('courses_deletion' ~ course.id) }}\" />
  270. </form>
  271. </div>
  272. {% endif %}
  273. <h5 class=\"mb-3 border-bottom pb-2\">Historique des attributions</h5>
  274. <div class=\"table-responsive\">
  275. <table class=\"table table-striped table-hover text-center align-middle\">
  276. <thead class=\"table-primary\">
  277. <tr>
  278. <th scope=\"col\">Année scolaire</th>
  279. <th scope=\"col\">Enseignant</th>
  280. <th scope=\"col\">Titulaire</th>
  281. </tr>
  282. </thead>
  283. <tbody>
  284. {% for attribution in course.attributions|reverse %}
  285. <tr>
  286. <td>{{ attribution.schoolYear }}</td>
  287. <td>{{ attribution.teacher }}</td>
  288. <td>{{ attribution.headTeacher }}</td>
  289. </tr>
  290. {% else %}
  291. <tr>
  292. <td colspan=\"3\" class=\"text-center\">Aucune attribution trouvée.</td>
  293. </tr>
  294. {% endfor %}
  295. </tbody>
  296. </table>
  297. </div>
  298. </div>
  299. </div>
  300. </div>
  301. </div>
  302. </div>
  303. {% endblock %}
  304. ", "course/show.html.twig", "/var/www/prod/liveedu/templates/course/show.html.twig");
  305. }
  306. }