<?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;

/* setting/direction_list.html.twig */
class __TwigTemplate_35cb551f128923f5af5cebfb173cbfeb 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 = [
            'page_title' => [$this, 'block_page_title'],
            'page_content' => [$this, 'block_page_content'],
            'javascripts' => [$this, 'block_javascripts'],
            'stylesheets' => [$this, 'block_stylesheets'],
        ];
    }

    protected function doGetParent(array $context): bool|string|Template|TemplateWrapper
    {
        // line 11
        return $this->load(($context["extendedTemplate"] ?? null), 11);
    }

    protected function doDisplay(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        // line 1
        if ((CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, ($context["app"] ?? null), "session", [], "any", false, false, false, 1), "get", ["_application"], "method", false, false, false, 1) == 0)) {
            // line 2
            $context["extendedTemplate"] = "@AdminLTE/layout/mesodd-layout.html.twig";
        }
        // line 4
        if ((CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, ($context["app"] ?? null), "session", [], "any", false, false, false, 4), "get", ["_application"], "method", false, false, false, 4) == 1)) {
            // line 5
            $context["extendedTemplate"] = "@AdminLTE/layout/suiodd-layout.html.twig";
        }
        // line 7
        if ((CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, ($context["app"] ?? null), "session", [], "any", false, false, false, 7), "get", ["_application"], "method", false, false, false, 7) == 2)) {
            // line 8
            $context["extendedTemplate"] = "@AdminLTE/layout/cfgodd-layout.html.twig";
        }
        // line 11
        yield from $this->getParent($context)->unwrap()->yield($context, array_merge($this->blocks, $blocks));
    }

    // line 13
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_page_title(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("direction.title", [], "messages");
        yield from [];
    }

    // line 15
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_page_content(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        // line 16
        yield "    ";
        if (($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_MANAGER") || $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_DDD"))) {
            // line 17
            yield "        <session class=\"content\"/>
            <div class=\"container-fluid card card-default\">
                <div class=\"card-body\">
                        <div class=\"text-right mb-3\">
                            <a href=\"";
            // line 21
            yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("app_direction_new");
            yield "\" class=\"btn btn-primary text-right\">
                                <i class=\"fa fa-plus\"></i> ";
            // line 22
            yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("direction.add", [], "messages");
            // line 23
            yield "                            </a>
                        </div>
                    ";
            // line 25
            yield             $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->renderBlock(($context["form"] ?? null), 'form_start');
            yield "
                        <div class=\"form-group row\">
                            ";
            // line 27
            if ((($tmp = $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_MANAGER")) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
                // line 28
                yield "                                <div class=\"col-sm-4\">
                                    <label class=\"col-form-label\">Type</label>
                                    ";
                // line 30
                yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(CoreExtension::getAttribute($this->env, $this->source, ($context["form"] ?? null), "type", [], "any", false, false, false, 30), 'widget');
                yield "
                                </div>
                                <div class=\"col-sm-8\"> 
                                    <label class=\"col-form-label\">Liste Ministères/Communes</label>
                                    ";
                // line 34
                yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(CoreExtension::getAttribute($this->env, $this->source, ($context["form"] ?? null), "entite", [], "any", false, false, false, 34), 'widget');
                yield "
                                </div>
                            ";
            } else {
                // line 37
                yield "                                <div class=\"col-sm-12\"> 
                                    <label class=\"col-form-label\">Communes</label>
                                    ";
                // line 39
                yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(CoreExtension::getAttribute($this->env, $this->source, ($context["form"] ?? null), "entite", [], "any", false, false, false, 39), 'widget');
                yield "
                                </div>
                            ";
            }
            // line 42
            yield "                        </div>
                    ";
            // line 43
            yield             $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->renderBlock(($context["form"] ?? null), 'form_end');
            yield "  
                    
                
                </div>
            </div>
        </session>
    ";
        } else {
            // line 50
            yield "                        <div class=\"text-right mb-3\">
                            <a href=\"";
            // line 51
            yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("app_direction_new");
            yield "\" class=\"btn btn-primary text-right\">
                                <i class=\"fa fa-plus\"></i> ";
            // line 52
            yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("direction.add", [], "messages");
            // line 53
            yield "                            </a>
                        </div>
    ";
        }
        // line 56
        if ((($tmp = ($context["entite"] ?? null)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
            // line 57
            yield "    ";
            yield from $this->load("setting/direction_list.html.twig", 57, 1765069247)->unwrap()->yield($context);
        } else {
            // line 119
            yield "    <div class=\"alert alert-info\" role=\"alert\">
        Veuillez sélectionner ";
            // line 120
            if ((($tmp = $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_MANAGER")) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
                yield " un ministère ou ";
            }
            yield " une commune pour afficher ces directions
    </div>
";
        }
        yield from [];
    }

    // line 125
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_javascripts(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        // line 126
        yield "     <script>
        let \$type = \$('#ministry_commune_sel_type');

        \$type.change(function() {
            let \$form = \$type.closest('form');

            let data = {};
            data[\$type.attr('name')] = \$type.val();

            \$.ajax({
                url: \$form.attr('action'),
                type: \$form.attr('method'),
                data: data,
                success: function(html) {
                    \$('#ministry_commune_sel_entite').replaceWith(
                        \$(html).find('#ministry_commune_sel_entite')
                    );
                }
            });
        });
    </script>
    <script src=\"";
        // line 147
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("plugins/datatables/French.json"), "html", null, true);
        yield "\"></script>
    <script>
        \$(function () {
            \$(\"#directionTable\").DataTable({
                \"pageLength\": 25,
                \"language\": {
                    \"url\": \"";
        // line 153
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("plugins/datatables/French.json"), "html", null, true);
        yield "\"
                }
            });
        });
    </script>

    <script src=\"";
        // line 159
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("plugins/datatables/jquery.dataTables.js"), "html", null, true);
        yield "\"></script>
    <script src=\"";
        // line 160
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("plugins/datatables-bs4/js/dataTables.bootstrap4.js"), "html", null, true);
        yield "\"></script>
";
        yield from [];
    }

    // line 163
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_stylesheets(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        // line 164
        yield "    <link rel=\"stylesheet\" href=\"";
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("plugins/datatables-bs4/css/dataTables.bootstrap4.css"), "html", null, true);
        yield "\">
";
        yield from [];
    }

    /**
     * @codeCoverageIgnore
     */
    public function getTemplateName(): string
    {
        return "setting/direction_list.html.twig";
    }

    /**
     * @codeCoverageIgnore
     */
    public function isTraitable(): bool
    {
        return false;
    }

    /**
     * @codeCoverageIgnore
     */
    public function getDebugInfo(): array
    {
        return array (  253 => 164,  246 => 163,  239 => 160,  235 => 159,  226 => 153,  217 => 147,  194 => 126,  187 => 125,  176 => 120,  173 => 119,  169 => 57,  167 => 56,  162 => 53,  160 => 52,  156 => 51,  153 => 50,  143 => 43,  140 => 42,  134 => 39,  130 => 37,  124 => 34,  117 => 30,  113 => 28,  111 => 27,  106 => 25,  102 => 23,  100 => 22,  96 => 21,  90 => 17,  87 => 16,  80 => 15,  69 => 13,  65 => 11,  62 => 8,  60 => 7,  57 => 5,  55 => 4,  52 => 2,  50 => 1,  43 => 11,);
    }

    public function getSourceContext(): Source
    {
        return new Source("", "setting/direction_list.html.twig", "/var/www/html/templates/setting/direction_list.html.twig");
    }
}


/* setting/direction_list.html.twig */
class __TwigTemplate_35cb551f128923f5af5cebfb173cbfeb___1765069247 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 = [
            'box_body' => [$this, 'block_box_body'],
        ];
    }

    protected function doGetParent(array $context): bool|string|Template|TemplateWrapper
    {
        // line 57
        return "@AdminLTE/Widgets/box-widget.html.twig";
    }

    protected function doDisplay(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        $this->parent = $this->load("@AdminLTE/Widgets/box-widget.html.twig", 57);
        yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks));
    }

    // line 58
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_box_body(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        // line 59
        yield "            <table id=\"directionTable\" class=\"table table-striped\">
            <thead>
                <th>";
        // line 61
        yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("basics.code", [], "messages");
        yield "</th>
                <th>";
        // line 62
        yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("basics.name", [], "messages");
        yield "</th>
                <th>";
        // line 63
        yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("basics.year", [], "messages");
        yield "</th>
                <th style=\"width: 80px\">";
        // line 64
        yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("basics.uploadkey", [], "messages");
        yield "</th>
                <th style=\"width: 100px\"></th>
            </thead>
            <tbody>
            ";
        // line 68
        $context['_parent'] = $context;
        $context['_seq'] = CoreExtension::ensureTraversable(($context["directions"] ?? null));
        foreach ($context['_seq'] as $context["_key"] => $context["direction"]) {
            // line 69
            yield "                <tr>
                    <td>";
            // line 70
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["direction"], "code", [], "any", false, false, false, 70), "html", null, true);
            yield "</td>
                    <td>";
            // line 71
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["direction"], "name", [], "any", false, false, false, 71), "html", null, true);
            yield "</td>
                    <td>";
            // line 72
            yield (((($tmp = CoreExtension::getAttribute($this->env, $this->source, $context["direction"], "years", [], "any", false, false, false, 72)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) ? ($this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(max(CoreExtension::getAttribute($this->env, $this->source, $context["direction"], "years", [], "any", false, false, false, 72)), "html", null, true)) : (null));
            yield "</td>
                    ";
            // line 73
            if ((($tmp = CoreExtension::getAttribute($this->env, $this->source, $context["direction"], "ministry", [], "any", false, false, false, 73)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
                // line 74
                yield "                        <td>M";
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(Twig\Extension\CoreExtension::sprintf("%02d", CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["direction"], "ministry", [], "any", false, false, false, 74), "id", [], "any", false, false, false, 74)), "html", null, true);
                yield "-D";
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(Twig\Extension\CoreExtension::sprintf("%05d", CoreExtension::getAttribute($this->env, $this->source, $context["direction"], "id", [], "any", false, false, false, 74)), "html", null, true);
                yield "</td>
                    ";
            } else {
                // line 76
                yield "                        <td>C";
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(Twig\Extension\CoreExtension::sprintf("%02d", CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["direction"], "commune", [], "any", false, false, false, 76), "id", [], "any", false, false, false, 76)), "html", null, true);
                yield "-D";
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(Twig\Extension\CoreExtension::sprintf("%05d", CoreExtension::getAttribute($this->env, $this->source, $context["direction"], "id", [], "any", false, false, false, 76)), "html", null, true);
                yield "</td>
                    ";
            }
            // line 78
            yield "                    <td class=\"text-center\">
                        <div class=\"btn-group\">
                            <a href=\"";
            // line 80
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("app_direction", ["id" => CoreExtension::getAttribute($this->env, $this->source, $context["direction"], "id", [], "any", false, false, false, 80)]), "html", null, true);
            yield "\" class=\"btn btn-sm btn-default\" role=\"button\" aria-pressed=\"true\">";
            yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("basics.update", [], "messages");
            yield "</a>
                            <button type=\"button\" class=\"btn btn-sm btn-default dropdown-toggle\" data-toggle=\"dropdown\">
                                <span class=\"caret\"></span>
                                <span class=\"sr-only\">Toggle Dropdown</span>
                            </button>
                            <div class=\"dropdown-menu\" role=\"menu\">
                                <a class=\"dropdown-item\" href=\"#\" data-toggle=\"modal\" data-target=\"#modal-delete-";
            // line 86
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["direction"], "id", [], "any", false, false, false, 86), "html", null, true);
            yield "\">";
            yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("basics.delete", [], "messages");
            yield "</a>
                            </div>

                            <div class=\"modal fade\" id=\"modal-delete-";
            // line 89
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["direction"], "id", [], "any", false, false, false, 89), "html", null, true);
            yield "\">
                                <div class=\"modal-dialog\">
                                    <div class=\"modal-content\">
                                        <div class=\"modal-header\">
                                            <h5 class=\"modal-title\">";
            // line 93
            yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("basics.delete.title", [], "messages");
            yield "</h5>
                                            <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\">
                                                <span aria-hidden=\"true\">&times;</span>
                                            </button>
                                        </div>
                                        <div class=\"modal-body\">
                                            <p>";
            // line 99
            yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("direction.delete.message", [], "messages");
            yield "</p>
                                            <b>";
            // line 100
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["direction"], "code", [], "any", false, false, false, 100), "html", null, true);
            yield "<br>";
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["direction"], "name", [], "any", false, false, false, 100), "html", null, true);
            yield "</b>
                                        </div>
                                        <div class=\"modal-footer justify-content-between\">
                                            <button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">";
            // line 103
            yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("basics.no", [], "messages");
            yield "</button>
                                            <a href=\"";
            // line 104
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("app_direction_delete", ["id" => CoreExtension::getAttribute($this->env, $this->source, $context["direction"], "id", [], "any", false, false, false, 104)]), "html", null, true);
            yield "\" class=\"btn btn-danger\">";
            yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("basics.yes", [], "messages");
            yield "</a>
                                        </div>
                                    </div>
                                </div>
                            </div>

                        </div>
                    </td>
                </tr>
            ";
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_key'], $context['direction'], $context['_parent']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 114
        yield "            </tbody>
            </table>
        ";
        yield from [];
    }

    /**
     * @codeCoverageIgnore
     */
    public function getTemplateName(): string
    {
        return "setting/direction_list.html.twig";
    }

    /**
     * @codeCoverageIgnore
     */
    public function isTraitable(): bool
    {
        return false;
    }

    /**
     * @codeCoverageIgnore
     */
    public function getDebugInfo(): array
    {
        return array (  465 => 114,  447 => 104,  443 => 103,  435 => 100,  431 => 99,  422 => 93,  415 => 89,  407 => 86,  396 => 80,  392 => 78,  384 => 76,  376 => 74,  374 => 73,  370 => 72,  366 => 71,  362 => 70,  359 => 69,  355 => 68,  348 => 64,  344 => 63,  340 => 62,  336 => 61,  332 => 59,  325 => 58,  314 => 57,  253 => 164,  246 => 163,  239 => 160,  235 => 159,  226 => 153,  217 => 147,  194 => 126,  187 => 125,  176 => 120,  173 => 119,  169 => 57,  167 => 56,  162 => 53,  160 => 52,  156 => 51,  153 => 50,  143 => 43,  140 => 42,  134 => 39,  130 => 37,  124 => 34,  117 => 30,  113 => 28,  111 => 27,  106 => 25,  102 => 23,  100 => 22,  96 => 21,  90 => 17,  87 => 16,  80 => 15,  69 => 13,  65 => 11,  62 => 8,  60 => 7,  57 => 5,  55 => 4,  52 => 2,  50 => 1,  43 => 11,);
    }

    public function getSourceContext(): Source
    {
        return new Source("", "setting/direction_list.html.twig", "/var/www/html/templates/setting/direction_list.html.twig");
    }
}
