<?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;
/* school/roomList.html.twig */
class __TwigTemplate_726fd600224008dd4083ec5d073d3561 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 = [
'name' => [$this, 'block_name'],
'body' => [$this, 'block_body'],
];
}
protected function doGetParent(array $context): bool|string|Template|TemplateWrapper
{
// line 1
return "layout/frontEndLayout.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", "school/roomList.html.twig"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "school/roomList.html.twig"));
$this->parent = $this->loadTemplate("layout/frontEndLayout.html.twig", "school/roomList.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_name(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", "name"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "name"));
// line 4
yield " Classrooms of Bethesda
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
yield from [];
}
// line 8
/**
* @return iterable<null|scalar|\Stringable>
*/
public function block_body(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", "body"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "body"));
// line 9
yield "
<div id=\"overviews\" class=\"section wb\">
<div class=\"container\">
<div class=\"section-title row text-center\">
<div class=\"col-md-8 offset-md-2\">
<h1 class=\"card-title text-center\">
Liste des classes et resultats aux examens officiels 2022-2023
</h1>
</div>
</div>
<!-- end title -->
<hr class=\"invis\">
";
// line 22
if ((Twig\Extension\CoreExtension::length($this->env->getCharset(), (isset($context["rooms"]) || array_key_exists("rooms", $context) ? $context["rooms"] : (function () { throw new RuntimeError('Variable "rooms" does not exist.', 22, $this->source); })())) > 0)) {
// line 23
yield " <div id=\"teachers\" class=\"section wb\">
";
// line 25
$context['_parent'] = $context;
$context['_seq'] = CoreExtension::ensureTraversable(Twig\Extension\CoreExtension::batch((isset($context["rooms"]) || array_key_exists("rooms", $context) ? $context["rooms"] : (function () { throw new RuntimeError('Variable "rooms" does not exist.', 25, $this->source); })()), 4));
foreach ($context['_seq'] as $context["_key"] => $context["row"]) {
// line 26
yield " <div class=\"row\">
";
// line 27
$context['_parent'] = $context;
$context['_seq'] = CoreExtension::ensureTraversable($context["row"]);
foreach ($context['_seq'] as $context["_key"] => $context["room"]) {
// line 28
yield " <div class=\"col-lg-4 col-md-6 col-12\">
<div class=\"course-item\">
<div class=\"image-blog\">
";
// line 31
if (CoreExtension::inFilter(CoreExtension::getAttribute($this->env, $this->source, $context["room"], "id", [], "any", false, false, false, 31), Twig\Extension\CoreExtension::keys((isset($context["mainTeachersMap"]) || array_key_exists("mainTeachersMap", $context) ? $context["mainTeachersMap"] : (function () { throw new RuntimeError('Variable "mainTeachersMap" does not exist.', 31, $this->source); })())))) {
// line 32
yield " <img
src=\"";
// line 33
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["mainTeachersMap"]) || array_key_exists("mainTeachersMap", $context) ? $context["mainTeachersMap"] : (function () { throw new RuntimeError('Variable "mainTeachersMap" does not exist.', 33, $this->source); })()), CoreExtension::getAttribute($this->env, $this->source, $context["room"], "id", [], "any", false, false, false, 33), [], "array", false, false, false, 33), "avatar", [75], "method", false, false, false, 33), "html", null, true);
yield "\" alt=\"\" class=\"img-fluid\"/>
";
} else {
// line 36
yield " <img src=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/images/teacher_default.png"), "html", null, true);
yield "\" alt=\"\" class=\"img-fluid\">
";
}
// line 38
yield " </div>
<div class=\"course-br\">
<div class=\"course-title\">
<h2>
<a href=\"#\" title=\"\">
";
// line 43
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["room"], "name", [], "any", false, false, false, 43), "html", null, true);
yield "
</a>
</h2>
</div>
";
// line 48
if (CoreExtension::getAttribute($this->env, $this->source, $context["room"], "apc", [], "any", false, false, false, 48)) {
// line 49
yield " ";
$context["success"] = 0;
// line 50
yield " ";
$context["candidats"] = 0;
// line 51
yield " <ul class=\"list-group\">
";
// line 52
$context['_parent'] = $context;
$context['_seq'] = CoreExtension::ensureTraversable((isset($context["subscriptions"]) || array_key_exists("subscriptions", $context) ? $context["subscriptions"] : (function () { throw new RuntimeError('Variable "subscriptions" does not exist.', 52, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["subscription"]) {
// line 53
yield "
";
// line 54
if ((CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["subscription"], "classRoom", [], "any", false, false, false, 54), "id", [], "any", false, false, false, 54) == CoreExtension::getAttribute($this->env, $this->source, $context["room"], "id", [], "any", false, false, false, 54))) {
// line 55
yield " ";
$context["candidats"] = ((isset($context["candidats"]) || array_key_exists("candidats", $context) ? $context["candidats"] : (function () { throw new RuntimeError('Variable "candidats" does not exist.', 55, $this->source); })()) + 1);
// line 56
yield " ";
if ((CoreExtension::getAttribute($this->env, $this->source, $context["subscription"], "officialExamResult", [], "any", false, false, false, 56) != "0")) {
// line 57
yield " ";
$context["success"] = ((isset($context["success"]) || array_key_exists("success", $context) ? $context["success"] : (function () { throw new RuntimeError('Variable "success" does not exist.', 57, $this->source); })()) + 1);
// line 58
yield " ";
}
// line 59
yield " <li class=\"list-group-item d-flex justify-content-between align-items-center row m-1\">
<div class=\"col-3\">
<img src=\"";
// line 61
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(((CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["subscription"], "student", [], "any", false, false, false, 61), "imageName", [], "any", false, false, false, 61)) ? ($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl(("assets/images/student/" . CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["subscription"], "student", [], "any", false, false, false, 61), "imageName", [], "any", false, false, false, 61)))) : (((CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["subscription"], "student", [], "any", false, false, false, 61), "gender", [], "any", false, false, false, 61)) ? ($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/images/student/female-default-avatar.jpg")) : ($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/images/student/male-default-avatar.jpg"))))), "html", null, true);
yield "\" alt=\"";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["subscription"], "student", [], "any", false, false, false, 61), "lastname", [], "any", false, false, false, 61), "html", null, true);
yield "\" class=\"img-fluid rounded-start\">
</div>
<div class=\"col-3 \">
<h5> ";
// line 65
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((Twig\Extension\CoreExtension::titleCase($this->env->getCharset(), CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["subscription"], "student", [], "any", false, false, false, 65), "lastname", [], "any", false, false, false, 65)) . Twig\Extension\CoreExtension::titleCase($this->env->getCharset(), CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["subscription"], "student", [], "any", false, false, false, 65), "firstname", [], "any", false, false, false, 65))), "html", null, true);
yield " </h5>
</div>
<div class=\"col-3 \">
<h5 class=\"text-muted\"><b>";
// line 70
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(Twig\Extension\CoreExtension::lower($this->env->getCharset(), CoreExtension::getAttribute($this->env, $this->source, $context["subscription"], "verbalOfficialExamResult", [], "any", false, false, false, 70)), "html", null, true);
yield "</b></h5>
</div>
</li>
";
}
// line 75
yield " ";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_key'], $context['subscription'], $context['_parent']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 76
yield " </ul>
<div class=\"course-rating text-center\">
";
// line 79
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((Twig\Extension\CoreExtension::round(((100 * (isset($context["success"]) || array_key_exists("success", $context) ? $context["success"] : (function () { throw new RuntimeError('Variable "success" does not exist.', 79, $this->source); })())) / (isset($context["candidats"]) || array_key_exists("candidats", $context) ? $context["candidats"] : (function () { throw new RuntimeError('Variable "candidats" does not exist.', 79, $this->source); })())), 2, "floor") . "%"), "html", null, true);
yield "
";
// line 91
yield "
</div>
";
}
// line 94
yield " </div>
<div class=\"course-meta-bot\">
<ul>
<li>
<i class=\"fa fa-book\" aria-hidden=\"true\"></i>
";
// line 99
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['App\Twig\AppExtension']->pluralize(Twig\Extension\CoreExtension::length($this->env->getCharset(), CoreExtension::getAttribute($this->env, $this->source, $context["room"], "modules", [], "any", false, false, false, 99)), "Module", "Modules"), "html", null, true);
yield "
</li>
</ul>
</div>
</div>
</div>
<!-- end row -->
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_key'], $context['room'], $context['_parent']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 107
yield " </div>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_key'], $context['row'], $context['_parent']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 109
yield " <div class=\"navigation text-center h3 m-5\">
";
// line 110
yield $this->extensions['Knp\Bundle\PaginatorBundle\Twig\Extension\PaginationExtension']->render($this->env, (isset($context["rooms"]) || array_key_exists("rooms", $context) ? $context["rooms"] : (function () { throw new RuntimeError('Variable "rooms" does not exist.', 110, $this->source); })()));
yield "
</div>
<!-- end container -->
";
} else {
// line 114
yield " <p class=\"mt-5 h1 text-center\">
No classroom yet. \t
";
// line 117
if ($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("IS_AUTHENTICATED_REMEMBERED")) {
// line 118
yield " <a href=\"";
yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("admin_classrooms_new");
yield "\">
Be the first!
</a>
";
}
// line 123
yield " </p>
";
}
// line 125
yield "
</div>
</div>
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
yield from [];
}
/**
* @codeCoverageIgnore
*/
public function getTemplateName(): string
{
return "school/roomList.html.twig";
}
/**
* @codeCoverageIgnore
*/
public function isTraitable(): bool
{
return false;
}
/**
* @codeCoverageIgnore
*/
public function getDebugInfo(): array
{
return array ( 313 => 125, 309 => 123, 300 => 118, 298 => 117, 293 => 114, 286 => 110, 283 => 109, 276 => 107, 262 => 99, 255 => 94, 250 => 91, 244 => 79, 239 => 76, 233 => 75, 225 => 70, 217 => 65, 208 => 61, 204 => 59, 201 => 58, 198 => 57, 195 => 56, 192 => 55, 190 => 54, 187 => 53, 183 => 52, 180 => 51, 177 => 50, 174 => 49, 172 => 48, 164 => 43, 157 => 38, 151 => 36, 145 => 33, 142 => 32, 140 => 31, 135 => 28, 131 => 27, 128 => 26, 124 => 25, 120 => 23, 118 => 22, 103 => 9, 90 => 8, 77 => 4, 64 => 3, 41 => 1,);
}
public function getSourceContext(): Source
{
return new Source("{% extends 'layout/frontEndLayout.html.twig' %}
{% block name %}
Classrooms of Bethesda
{% endblock %}
{% block body %}
<div id=\"overviews\" class=\"section wb\">
<div class=\"container\">
<div class=\"section-title row text-center\">
<div class=\"col-md-8 offset-md-2\">
<h1 class=\"card-title text-center\">
Liste des classes et resultats aux examens officiels 2022-2023
</h1>
</div>
</div>
<!-- end title -->
<hr class=\"invis\">
{% if rooms|length > 0 %}
<div id=\"teachers\" class=\"section wb\">
{% for row in rooms|batch(4) %}
<div class=\"row\">
{% for room in row %}
<div class=\"col-lg-4 col-md-6 col-12\">
<div class=\"course-item\">
<div class=\"image-blog\">
{% if room.id in mainTeachersMap|keys %}
<img
src=\"{{ mainTeachersMap[room.id].avatar(75) }}\" alt=\"\" class=\"img-fluid\"/>
{% else %}
<img src=\"{{ asset('assets/images/teacher_default.png') }}\" alt=\"\" class=\"img-fluid\">
{% endif %}
</div>
<div class=\"course-br\">
<div class=\"course-title\">
<h2>
<a href=\"#\" title=\"\">
{{ room.name }}
</a>
</h2>
</div>
{% if room.apc %}
{% set success = 0 %}
{% set candidats = 0 %}
<ul class=\"list-group\">
{% for subscription in subscriptions %}
{% if(subscription.classRoom.id == room.id) %}
{% set candidats = candidats + 1 %}
{% if subscription.officialExamResult != \"0\" %}
{% set success = success + 1 %}
{% endif %}
<li class=\"list-group-item d-flex justify-content-between align-items-center row m-1\">
<div class=\"col-3\">
<img src=\"{{ (subscription.student.imageName ? asset('assets/images/student/'~ subscription.student.imageName ) : (subscription.student.gender ? asset('assets/images/student/female-default-avatar.jpg') : asset('assets/images/student/male-default-avatar.jpg'))) }}\" alt=\"{{ subscription.student.lastname }}\" class=\"img-fluid rounded-start\">
</div>
<div class=\"col-3 \">
<h5> {{subscription.student.lastname|title ~ subscription.student.firstname|title}} </h5>
</div>
<div class=\"col-3 \">
<h5 class=\"text-muted\"><b>{{subscription.verbalOfficialExamResult|lower}}</b></h5>
</div>
</li>
{% endif %}
{% endfor %}
</ul>
<div class=\"course-rating text-center\">
{{ (100 * success / candidats)|round(2, 'floor') ~ \"%\"}}
{#<i class=\"fa fa-star\"></i>
<i class=\"fa fa-star\"></i>
<i class=\"fa fa-star\"></i>
<i class=\"fa fa-star\"></i>
{% if success == candidats %}
<i class=\"fa fa-star\"></i>
{% else %}
<i class=\"fa fa-star-half\"></i>
{% endif %}#}
</div>
{% endif %}
</div>
<div class=\"course-meta-bot\">
<ul>
<li>
<i class=\"fa fa-book\" aria-hidden=\"true\"></i>
{{ pluralize(room.modules|length, 'Module' , 'Modules') }}
</li>
</ul>
</div>
</div>
</div>
<!-- end row -->
{% endfor %}
</div>
{% endfor %}
<div class=\"navigation text-center h3 m-5\">
{{ knp_pagination_render(rooms) }}
</div>
<!-- end container -->
{% else %}
<p class=\"mt-5 h1 text-center\">
No classroom yet. \t
{% if is_granted(\"IS_AUTHENTICATED_REMEMBERED\") %}
<a href=\"{{ path('admin_classrooms_new') }}\">
Be the first!
</a>
{% endif %}
</p>
{% endif %}
</div>
</div>
{% endblock %}
", "school/roomList.html.twig", "/var/www/prod/current/templates/school/roomList.html.twig");
}
}