<?php
use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\CoreExtension;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;
use Twig\TemplateWrapper;
/* course/show.html.twig */
class __TwigTemplate_9a56a656685a6aa89b771fcfda362603 extends Template
{
private Source $source;
/**
* @var array<string, Template>
*/
private array $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->blocks = [
'title' => [$this, 'block_title'],
'content' => [$this, 'block_content'],
];
}
protected function doGetParent(array $context): bool|string|Template|TemplateWrapper
{
// line 1
return "layout/backEndLayout.html.twig";
}
protected function doDisplay(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "course/show.html.twig"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "course/show.html.twig"));
$this->parent = $this->load("layout/backEndLayout.html.twig", 1);
yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks));
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
}
// line 3
/**
* @return iterable<null|scalar|\Stringable>
*/
public function block_title(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "title"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "title"));
yield "Détail du Cours - ";
yield from $this->yieldParentBlock("title", $context, $blocks);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
yield from [];
}
// line 5
/**
* @return iterable<null|scalar|\Stringable>
*/
public function block_content(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "content"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "content"));
// line 6
yield "<div class=\"container mt-5\">
<div class=\"row mb-3\">
<div class=\"col-lg-2\">
";
// line 10
if ((($tmp = $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_ADMIN")) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
// line 11
yield " <a href=\"";
yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("admin_courses");
yield "\" class=\"btn btn-info w-100\">
<i class=\"fa fa-list\"></i> Retour à la liste
</a>
";
}
// line 15
yield " </div>
<div class=\"col-lg-10\">
<div class=\"card shadow-lg border-0 rounded-4\">
<div class=\"card-header bg-primary text-white text-center rounded-top-4\">
<h4 class=\"mb-0\">";
// line 21
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);
yield "</h4>
</div>
<div class=\"card-body p-4\">
<ul class=\"list-unstyled h5 mb-4 row\">
<li class=\"col-md-3\"><strong>Coefficient:</strong> ";
// line 27
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);
yield "</li>
<li class=\"col-md-3\"><strong>Code:</strong> ";
// line 28
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);
yield "</li>
<li class=\"col-md-3\"><strong>Module:</strong> ";
// line 29
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);
yield "</li>
<li class=\"col-md-3\"><strong>Domaine:</strong> ";
// line 30
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);
yield "</li>
</ul>
";
// line 33
if ((($tmp = $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_ADMIN")) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
// line 34
yield " <div class=\"mb-4 text-center\">
<a href=\"";
// line 35
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);
yield "\" class=\"btn btn-warning me-2\">
<i class=\"fa fa-pencil\"></i> Modifier le cours
</a>
<a href=\"#\" class=\"btn btn-danger\"
onclick=\"event.preventDefault(); if(confirm('Êtes-vous sûr de vouloir supprimer ce cours ?')) document.getElementById('delete-course-form').submit();\">
<i class=\"fa fa-trash\"></i> Supprimer le cours
</a>
<form id=\"delete-course-form\" method=\"post\" action=\"";
// line 42
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);
yield "\" style=\"display:none;\">
<input type=\"hidden\" name=\"_method\" value=\"DELETE\" />
<input type=\"hidden\" name=\"csrf_token\" value=\"";
// line 44
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);
yield "\" />
</form>
</div>
";
}
// line 48
yield "
<h5 class=\"mb-3 border-bottom pb-2\">Historique des attributions</h5>
<div class=\"table-responsive\">
<table class=\"table table-striped table-hover text-center align-middle\">
<thead class=\"table-primary\">
<tr>
<th scope=\"col\">Année scolaire</th>
<th scope=\"col\">Enseignant</th>
<th scope=\"col\">Titulaire</th>
</tr>
</thead>
<tbody>
";
// line 61
$context['_parent'] = $context;
$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)));
$context['_iterated'] = false;
foreach ($context['_seq'] as $context["_key"] => $context["attribution"]) {
// line 62
yield " <tr>
<td>";
// line 63
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);
yield "</td>
<td>";
// line 64
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);
yield "</td>
<td>";
// line 65
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);
yield "</td>
</tr>
";
$context['_iterated'] = true;
}
// line 67
if (!$context['_iterated']) {
// line 68
yield " <tr>
<td colspan=\"3\" class=\"text-center\">Aucune attribution trouvée.</td>
</tr>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_key'], $context['attribution'], $context['_parent'], $context['_iterated']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 72
yield " </tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
yield from [];
}
/**
* @codeCoverageIgnore
*/
public function getTemplateName(): string
{
return "course/show.html.twig";
}
/**
* @codeCoverageIgnore
*/
public function isTraitable(): bool
{
return false;
}
/**
* @codeCoverageIgnore
*/
public function getDebugInfo(): array
{
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,);
}
public function getSourceContext(): Source
{
return new Source("{% extends 'layout/backEndLayout.html.twig' %}
{% block title %}Détail du Cours - {{ parent() }}{% endblock %}
{% block content %}
<div class=\"container mt-5\">
<div class=\"row mb-3\">
<div class=\"col-lg-2\">
{% if is_granted('ROLE_ADMIN') %}
<a href=\"{{ path('admin_courses') }}\" class=\"btn btn-info w-100\">
<i class=\"fa fa-list\"></i> Retour à la liste
</a>
{% endif %}
</div>
<div class=\"col-lg-10\">
<div class=\"card shadow-lg border-0 rounded-4\">
<div class=\"card-header bg-primary text-white text-center rounded-top-4\">
<h4 class=\"mb-0\">{{ course.wording }}</h4>
</div>
<div class=\"card-body p-4\">
<ul class=\"list-unstyled h5 mb-4 row\">
<li class=\"col-md-3\"><strong>Coefficient:</strong> {{ course.coefficient }}</li>
<li class=\"col-md-3\"><strong>Code:</strong> {{ course.code }}</li>
<li class=\"col-md-3\"><strong>Module:</strong> {{ course.module.name }}</li>
<li class=\"col-md-3\"><strong>Domaine:</strong> {{ course.domain.name }}</li>
</ul>
{% if is_granted('ROLE_ADMIN') %}
<div class=\"mb-4 text-center\">
<a href=\"{{ path('admin_courses_edit', {id: course.id}) }}\" class=\"btn btn-warning me-2\">
<i class=\"fa fa-pencil\"></i> Modifier le cours
</a>
<a href=\"#\" class=\"btn btn-danger\"
onclick=\"event.preventDefault(); if(confirm('Êtes-vous sûr de vouloir supprimer ce cours ?')) document.getElementById('delete-course-form').submit();\">
<i class=\"fa fa-trash\"></i> Supprimer le cours
</a>
<form id=\"delete-course-form\" method=\"post\" action=\"{{ path('admin_courses_delete', {id: course.id}) }}\" style=\"display:none;\">
<input type=\"hidden\" name=\"_method\" value=\"DELETE\" />
<input type=\"hidden\" name=\"csrf_token\" value=\"{{ csrf_token('courses_deletion' ~ course.id) }}\" />
</form>
</div>
{% endif %}
<h5 class=\"mb-3 border-bottom pb-2\">Historique des attributions</h5>
<div class=\"table-responsive\">
<table class=\"table table-striped table-hover text-center align-middle\">
<thead class=\"table-primary\">
<tr>
<th scope=\"col\">Année scolaire</th>
<th scope=\"col\">Enseignant</th>
<th scope=\"col\">Titulaire</th>
</tr>
</thead>
<tbody>
{% for attribution in course.attributions|reverse %}
<tr>
<td>{{ attribution.schoolYear }}</td>
<td>{{ attribution.teacher }}</td>
<td>{{ attribution.headTeacher }}</td>
</tr>
{% else %}
<tr>
<td colspan=\"3\" class=\"text-center\">Aucune attribution trouvée.</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
{% endblock %}
", "course/show.html.twig", "/var/www/prod/liveedu/templates/course/show.html.twig");
}
}