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

/* plan/action_list.html.twig */
class __TwigTemplate_49d8902eed6649731571018f5e8ac18d 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 1
        return "@AdminLTE/layout/mesodd-layout.html.twig";
    }

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

    // line 3
    /**
     * @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("action.title", [], "messages");
        yield from [];
    }

    // line 6
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_page_content(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        // line 7
        yield "    ";
        if (($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_MANAGER") || $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_DPP"))) {
            // line 8
            yield "            <div class=\"text-right\" style=\"padding-bottom : 15px;\">
                <a href=\"";
            // line 9
            yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("app_action_new");
            yield "\" class=\"btn btn-primary text-right\">
                    <i class=\"fa fa-plus\"></i> ";
            // line 10
            yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("action.add", [], "messages");
            // line 11
            yield "                </a>
            </div>
            ";
        }
        // line 14
        if ((($tmp = $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_MANAGER")) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
            // line 15
            yield "    <div class=\"card card-default\">
        <div class=\"card-body\">
            ";
            // line 17
            yield             $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->renderBlock(($context["form"] ?? null), 'form_start');
            yield "
                <div class=\"form-group row\">
                    <div class=\"col-sm-4\">
                        <label class=\"col-form-label\">Type</label>
                        ";
            // line 21
            yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(CoreExtension::getAttribute($this->env, $this->source, ($context["form"] ?? null), "type", [], "any", false, false, false, 21), 'widget');
            yield "
                    </div>
                    <div class=\"col-sm-8\">
                        <label class=\"col-form-label\">Liste Ministères/Communes</label>
                        ";
            // line 25
            yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(CoreExtension::getAttribute($this->env, $this->source, ($context["form"] ?? null), "entite", [], "any", false, false, false, 25), 'widget');
            yield "
                    </div>
                </div>
            ";
            // line 28
            yield             $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->renderBlock(($context["form"] ?? null), 'form_end');
            yield "  
        </div>
    </div>
";
        }
        // line 32
        if ((($tmp = $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_DDD")) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
            // line 33
            yield "    <div class=\"card card-default\">
        <div class=\"card-body\">
            ";
            // line 35
            yield             $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->renderBlock(($context["form"] ?? null), 'form_start');
            yield "
                <div class=\"form-group row\">
                    <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>
                </div>
            ";
            // line 42
            yield             $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->renderBlock(($context["form"] ?? null), 'form_end');
            yield "  
        </div>
    </div>
";
        }
        // line 46
        yield "    
    ";
        // line 47
        if ((($tmp = ($context["entite"] ?? null)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
            // line 48
            yield "    ";
            yield from $this->load("plan/action_list.html.twig", 48, 704053475)->unwrap()->yield($context);
            // line 88
            yield "
    ";
        } else {
            // line 90
            yield "    <div class=\"alert alert-info\" role=\"alert\">
        ";
            // line 91
            yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Veuillez sélectionner un ministère ou une commune pour afficher ces actions", [], "messages");
            // line 92
            yield "    </div>
    ";
        }
        // line 94
        yield "
";
        yield from [];
    }

    // line 97
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_javascripts(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        // line 98
        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 121
        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 () {
            \$(\"#actionTable\").DataTable({
                \"pageLength\": 25,
                \"language\": {
                        \"url\": \"";
        // line 128
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("plugins/datatables/French.json"), "html", null, true);
        yield "\"
                    }
            });
        });
        /*\$(function () {
            //\$(\"#actionTable\").DataTable({
            //});

            // Setup - add a text input to each footer cell
            \$('#actionTable tfoot th').each( function () {
                var title = \$(this).text();
                \$(this).html( '<input type=\"text\" placeholder=\"'+title+'\" />' );
            } );

            // DataTable
            var actionTable = \$('#actionTable').DataTable();

            actionTable.pageLength = 25
        
            // Apply the search
            actionTable.columns().every( function () {
                var that = this;
        
                \$( 'input', this.footer() ).on( 'keyup change clear', function () {
                    if ( that.search() !== this.value ) {
                        that
                            .search( this.value )
                            .draw();
                    }
                } );
            } );

        });*/
    </script>

    <script src=\"";
        // line 163
        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 164
        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 167
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_stylesheets(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        // line 168
        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 "plan/action_list.html.twig";
    }

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

    /**
     * @codeCoverageIgnore
     */
    public function getDebugInfo(): array
    {
        return array (  273 => 168,  266 => 167,  259 => 164,  255 => 163,  217 => 128,  207 => 121,  182 => 98,  175 => 97,  169 => 94,  165 => 92,  163 => 91,  160 => 90,  156 => 88,  153 => 48,  151 => 47,  148 => 46,  141 => 42,  135 => 39,  128 => 35,  124 => 33,  122 => 32,  115 => 28,  109 => 25,  102 => 21,  95 => 17,  91 => 15,  89 => 14,  84 => 11,  82 => 10,  78 => 9,  75 => 8,  72 => 7,  65 => 6,  54 => 3,  43 => 1,);
    }

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


/* plan/action_list.html.twig */
class __TwigTemplate_49d8902eed6649731571018f5e8ac18d___704053475 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 48
        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", 48);
        yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks));
    }

    // line 49
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_box_body(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        // line 50
        yield "            <table id=\"actionTable\" class=\"table table-striped\">
            <thead>
                <th style=\"width: 100px\">";
        // line 52
        yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("basics.code", [], "messages");
        yield "</th>
                <th>";
        // line 53
        yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("basics.name", [], "messages");
        yield "</th>
                <th>";
        // line 54
        yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("basics.programm", [], "messages");
        yield "</th>
                ";
        // line 55
        if (($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_MANAGER") || $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_DPP"))) {
            // line 56
            yield "                <th style=\"width: 100px\"></th>
                ";
        }
        // line 58
        yield "            </thead>
            <tbody>
            ";
        // line 60
        $context['_parent'] = $context;
        $context['_seq'] = CoreExtension::ensureTraversable(($context["actions"] ?? null));
        foreach ($context['_seq'] as $context["_key"] => $context["action"]) {
            // line 61
            yield "                <tr>
                    <td>";
            // line 62
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["action"], "code", [], "any", false, false, false, 62), "html", null, true);
            yield "</td>
                    <td>";
            // line 63
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["action"], "name", [], "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, CoreExtension::getAttribute($this->env, $this->source, $context["action"], "programm", [], "any", false, false, false, 64), "name", [], "any", false, false, false, 64), "html", null, true);
            yield "</td>
                    ";
            // line 65
            if (($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_MANAGER") || $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_DPP"))) {
                // line 66
                yield "                    <td class=\"text-center\">
                        <div class=\"btn-group\">
                            <a href=\"";
                // line 68
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("app_action", ["id" => CoreExtension::getAttribute($this->env, $this->source, $context["action"], "id", [], "any", false, false, false, 68)]), "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>
                        </div>
                    </td>
                    ";
            }
            // line 72
            yield "                </tr>
            ";
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_key'], $context['action'], $context['_parent']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 74
        yield "            </tbody>
            <!--tfoot>
                <tr>
                    <th>";
        // line 77
        yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("basics.code", [], "messages");
        yield "</th>
                    <th>";
        // line 78
        yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("basics.name", [], "messages");
        yield "</th>
                    <th>";
        // line 79
        yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("basics.programm", [], "messages");
        yield "</th>
                    ";
        // line 80
        if ((($tmp = $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_MANAGER")) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
            // line 81
            yield "                        <td style=\"width: 100px\"></td>
                    ";
        }
        // line 83
        yield "                </tr>
            </tfoot-->
            </table>
        ";
        yield from [];
    }

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

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

    /**
     * @codeCoverageIgnore
     */
    public function getDebugInfo(): array
    {
        return array (  442 => 83,  438 => 81,  436 => 80,  432 => 79,  428 => 78,  424 => 77,  419 => 74,  412 => 72,  403 => 68,  399 => 66,  397 => 65,  393 => 64,  389 => 63,  385 => 62,  382 => 61,  378 => 60,  374 => 58,  370 => 56,  368 => 55,  364 => 54,  360 => 53,  356 => 52,  352 => 50,  345 => 49,  334 => 48,  273 => 168,  266 => 167,  259 => 164,  255 => 163,  217 => 128,  207 => 121,  182 => 98,  175 => 97,  169 => 94,  165 => 92,  163 => 91,  160 => 90,  156 => 88,  153 => 48,  151 => 47,  148 => 46,  141 => 42,  135 => 39,  128 => 35,  124 => 33,  122 => 32,  115 => 28,  109 => 25,  102 => 21,  95 => 17,  91 => 15,  89 => 14,  84 => 11,  82 => 10,  78 => 9,  75 => 8,  72 => 7,  65 => 6,  54 => 3,  43 => 1,);
    }

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