var/cache/dev/twig/6d/6d6462151658c60356e0264d4883b514.php line 55

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\Sandbox\SecurityNotAllowedTestError;
  13. use Twig\Source;
  14. use Twig\Template;
  15. use Twig\TemplateWrapper;
  16. /* department/index.html.twig */
  17. class __TwigTemplate_d95c00a4c718c0121ba070b3c1103793 extends Template
  18. {
  19. private Source $source;
  20. /**
  21. * @var array<string, Template>
  22. */
  23. private array $macros = [];
  24. public function __construct(Environment $env)
  25. {
  26. parent::__construct($env);
  27. $this->source = $this->getSourceContext();
  28. $this->blocks = [
  29. 'title' => [$this, 'block_title'],
  30. 'body' => [$this, 'block_body'],
  31. ];
  32. }
  33. protected function doGetParent(array $context): bool|string|Template|TemplateWrapper
  34. {
  35. // line 1
  36. return "base.html.twig";
  37. }
  38. protected function doDisplay(array $context, array $blocks = []): iterable
  39. {
  40. $macros = $this->macros;
  41. $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  42. $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "department/index.html.twig"));
  43. $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  44. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "department/index.html.twig"));
  45. $this->parent = $this->load("base.html.twig", 1);
  46. yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks));
  47. $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  48. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  49. }
  50. // line 3
  51. /**
  52. * @return iterable<null|scalar|\Stringable>
  53. */
  54. public function block_title(array $context, array $blocks = []): iterable
  55. {
  56. $macros = $this->macros;
  57. $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  58. $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "title"));
  59. $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  60. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "title"));
  61. yield "Department index";
  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_body(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", "body"));
  75. $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  76. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "body"));
  77. // line 6
  78. yield " <h1>Department index</h1>
  79. <table class=\"table\">
  80. <thead>
  81. <tr>
  82. <th>Id</th>
  83. <th>Name</th>
  84. <th>Description</th>
  85. <th>UpdateAt</th>
  86. <th>actions</th>
  87. </tr>
  88. </thead>
  89. <tbody>
  90. ";
  91. // line 19
  92. $context['_parent'] = $context;
  93. $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); })()));
  94. $context['_iterated'] = false;
  95. foreach ($context['_seq'] as $context["_key"] => $context["department"]) {
  96. // line 20
  97. yield " <tr>
  98. <td>";
  99. // line 21
  100. 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);
  101. yield "</td>
  102. <td>";
  103. // line 22
  104. 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);
  105. yield "</td>
  106. <td>";
  107. // line 23
  108. 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);
  109. yield "</td>
  110. <td>";
  111. // line 24
  112. 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)) : (""));
  113. yield "</td>
  114. <td>
  115. <a href=\"";
  116. // line 26
  117. 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);
  118. yield "\">";
  119. yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("show", [], "messages");
  120. yield "</a>
  121. ";
  122. // line 27
  123. if ((($tmp = $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_HABITECH")) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
  124. // line 28
  125. yield "
  126. <a href=\"";
  127. // line 29
  128. 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);
  129. yield "\">";
  130. yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("edit", [], "messages");
  131. yield "</a>
  132. ";
  133. }
  134. // line 31
  135. yield " </td>
  136. </tr>
  137. ";
  138. $context['_iterated'] = true;
  139. }
  140. // line 33
  141. if (!$context['_iterated']) {
  142. // line 34
  143. yield " <tr>
  144. <td colspan=\"5\">no records found</td>
  145. </tr>
  146. ";
  147. }
  148. $_parent = $context['_parent'];
  149. unset($context['_seq'], $context['_key'], $context['department'], $context['_parent'], $context['_iterated']);
  150. $context = array_intersect_key($context, $_parent);
  151. $context += $_parent;
  152. // line 37
  153. yield "
  154. </tbody>
  155. </table>
  156. ";
  157. // line 40
  158. if ((($tmp = $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_HABITECH")) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
  159. // line 41
  160. yield "
  161. <a href=\"";
  162. // line 42
  163. yield (string) $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("department_new");
  164. yield "\">";
  165. yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Create new", [], "messages");
  166. yield "</a>
  167. ";
  168. }
  169. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  170. $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  171. yield from [];
  172. }
  173. /**
  174. * @codeCoverageIgnore
  175. */
  176. public function getTemplateName(): string
  177. {
  178. return "department/index.html.twig";
  179. }
  180. /**
  181. * @codeCoverageIgnore
  182. */
  183. public function isTraitable(): bool
  184. {
  185. return false;
  186. }
  187. /**
  188. * @codeCoverageIgnore
  189. */
  190. public function getDebugInfo(): array
  191. {
  192. 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,);
  193. }
  194. public function getSourceContext(): Source
  195. {
  196. return new Source("{% extends \x27base.html.twig\x27 %}
  197. {% block title %}Department index{% endblock %}
  198. {% block body %}
  199. <h1>Department index</h1>
  200. <table class=\"table\">
  201. <thead>
  202. <tr>
  203. <th>Id</th>
  204. <th>Name</th>
  205. <th>Description</th>
  206. <th>UpdateAt</th>
  207. <th>actions</th>
  208. </tr>
  209. </thead>
  210. <tbody>
  211. {% for department in departments %}
  212. <tr>
  213. <td>{{ department.id }}</td>
  214. <td>{{ department.name }}</td>
  215. <td>{{ department.description }}</td>
  216. <td>{{ department.updateAt ? department.updateAt|date(\x27Y-m-d H:i:s\x27) : \x27\x27 }}</td>
  217. <td>
  218. <a href=\"{{ path(\x27department_show\x27, {\x27id\x27: department.id}) }}\">{% trans %}show{% endtrans %}</a>
  219. {% if is_granted(\x27ROLE_HABITECH\x27) %}
  220. <a href=\"{{ path(\x27department_edit\x27, {\x27id\x27: department.id}) }}\">{% trans %}edit{% endtrans %}</a>
  221. {% endif %}
  222. </td>
  223. </tr>
  224. {% else %}
  225. <tr>
  226. <td colspan=\"5\">no records found</td>
  227. </tr>
  228. {% endfor %}
  229. </tbody>
  230. </table>
  231. {% if is_granted(\x27ROLE_HABITECH\x27) %}
  232. <a href=\"{{ path(\x27department_new\x27) }}\">{% trans %}Create new{% endtrans %}</a>
  233. {% endif %}
  234. {% endblock %}
  235. ", "department/index.html.twig", "/var/www/vhosts/habitechsolutions.cm/birth.habitechsolutions.cm/templates/department/index.html.twig");
  236. }
  237. }