<?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\Sandbox\SecurityNotAllowedTestError;
use Twig\Source;
use Twig\Template;
use Twig\TemplateWrapper;
/* department/index.html.twig */
class __TwigTemplate_d95c00a4c718c0121ba070b3c1103793 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'],
'body' => [$this, 'block_body'],
];
}
protected function doGetParent(array $context): bool|string|Template|TemplateWrapper
{
// line 1
return "base.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", "department/index.html.twig"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "department/index.html.twig"));
$this->parent = $this->load("base.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 "Department index";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
yield from [];
}
// line 5
/**
* @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 6
yield " <h1>Department index</h1>
<table class=\"table\">
<thead>
<tr>
<th>Id</th>
<th>Name</th>
<th>Description</th>
<th>UpdateAt</th>
<th>actions</th>
</tr>
</thead>
<tbody>
";
// line 19
$context['_parent'] = $context;
$context['_seq'] = CoreExtension::ensureTraversable((isset($context["departments"]) || array_key_exists("departments", $context) ? $context["departments"] : (function () { throw new RuntimeError('Variable "departments" does not exist.', 19, $this->source); })()));
$context['_iterated'] = false;
foreach ($context['_seq'] as $context["_key"] => $context["department"]) {
// line 20
yield " <tr>
<td>";
// line 21
yield (string) $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["department"], "id", [], "any", false, false, false, 21), "html", null, true);
yield "</td>
<td>";
// line 22
yield (string) $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["department"], "name", [], "any", false, false, false, 22), "html", null, true);
yield "</td>
<td>";
// line 23
yield (string) $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["department"], "description", [], "any", false, false, false, 23), "html", null, true);
yield "</td>
<td>";
// line 24
yield (string) (((($tmp = CoreExtension::getAttribute($this->env, $this->source, $context["department"], "updateAt", [], "any", false, false, false, 24)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) ? ($this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extension\CoreExtension']->formatDate(CoreExtension::getAttribute($this->env, $this->source, $context["department"], "updateAt", [], "any", false, false, false, 24), "Y-m-d H:i:s"), "html", null, true)) : (""));
yield "</td>
<td>
<a href=\"";
// line 26
yield (string) $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("department_show", ["id" => CoreExtension::getAttribute($this->env, $this->source, $context["department"], "id", [], "any", false, false, false, 26)]), "html", null, true);
yield "\">";
yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("show", [], "messages");
yield "</a>
";
// line 27
if ((($tmp = $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_HABITECH")) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
// line 28
yield "
<a href=\"";
// line 29
yield (string) $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("department_edit", ["id" => CoreExtension::getAttribute($this->env, $this->source, $context["department"], "id", [], "any", false, false, false, 29)]), "html", null, true);
yield "\">";
yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("edit", [], "messages");
yield "</a>
";
}
// line 31
yield " </td>
</tr>
";
$context['_iterated'] = true;
}
// line 33
if (!$context['_iterated']) {
// line 34
yield " <tr>
<td colspan=\"5\">no records found</td>
</tr>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_key'], $context['department'], $context['_parent'], $context['_iterated']);
$context = array_intersect_key($context, $_parent);
$context += $_parent;
// line 37
yield "
</tbody>
</table>
";
// line 40
if ((($tmp = $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_HABITECH")) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
// line 41
yield "
<a href=\"";
// line 42
yield (string) $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("department_new");
yield "\">";
yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Create new", [], "messages");
yield "</a>
";
}
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
yield from [];
}
/**
* @codeCoverageIgnore
*/
public function getTemplateName(): string
{
return "department/index.html.twig";
}
/**
* @codeCoverageIgnore
*/
public function isTraitable(): bool
{
return false;
}
/**
* @codeCoverageIgnore
*/
public function getDebugInfo(): array
{
return array ( 187 => 42, 184 => 41, 182 => 40, 177 => 37, 167 => 34, 165 => 33, 159 => 31, 152 => 29, 149 => 28, 147 => 27, 141 => 26, 136 => 24, 132 => 23, 128 => 22, 124 => 21, 121 => 20, 116 => 19, 101 => 6, 88 => 5, 65 => 3, 42 => 1,);
}
public function getSourceContext(): Source
{
return new Source("{% extends \x27base.html.twig\x27 %}
{% block title %}Department index{% endblock %}
{% block body %}
<h1>Department index</h1>
<table class=\"table\">
<thead>
<tr>
<th>Id</th>
<th>Name</th>
<th>Description</th>
<th>UpdateAt</th>
<th>actions</th>
</tr>
</thead>
<tbody>
{% for department in departments %}
<tr>
<td>{{ department.id }}</td>
<td>{{ department.name }}</td>
<td>{{ department.description }}</td>
<td>{{ department.updateAt ? department.updateAt|date(\x27Y-m-d H:i:s\x27) : \x27\x27 }}</td>
<td>
<a href=\"{{ path(\x27department_show\x27, {\x27id\x27: department.id}) }}\">{% trans %}show{% endtrans %}</a>
{% if is_granted(\x27ROLE_HABITECH\x27) %}
<a href=\"{{ path(\x27department_edit\x27, {\x27id\x27: department.id}) }}\">{% trans %}edit{% endtrans %}</a>
{% endif %}
</td>
</tr>
{% else %}
<tr>
<td colspan=\"5\">no records found</td>
</tr>
{% endfor %}
</tbody>
</table>
{% if is_granted(\x27ROLE_HABITECH\x27) %}
<a href=\"{{ path(\x27department_new\x27) }}\">{% trans %}Create new{% endtrans %}</a>
{% endif %}
{% endblock %}
", "department/index.html.twig", "/var/www/vhosts/habitechsolutions.cm/birth.habitechsolutions.cm/templates/department/index.html.twig");
}
}