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

/* communes/normes_actions_form.html.twig */
class __TwigTemplate_26f7abedfbadca218632929270413b4a 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'],
        ];
    }

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

    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) == 2)) {
            // line 2
            $context["extendedTemplate"] = "@AdminLTE/layout/cfgodd-layout.html.twig";
        } else {
            // line 4
            $context["extendedTemplate"] = "@AdminLTE/layout/communeodd-layout.html.twig";
        }
        // line 7
        yield from $this->getParent($context)->unwrap()->yield($context, array_merge($this->blocks, $blocks));
    }

    // line 9
    /**
     * @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("norme.title", [], "messages");
        yield " - ";
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, ($context["commune"] ?? null), "name", [], "any", false, false, false, 9), "html", null, true);
        yield from [];
    }

    // line 12
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_page_content(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        // line 13
        yield "
    ";
        // line 14
        yield from $this->load("communes/normes_actions_form.html.twig", 14, 2116677132)->unwrap()->yield($context);
        // line 71
        yield "
";
        yield from [];
    }

    // line 74
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_javascripts(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        // line 75
        yield " <script src=\"";
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/js/select2.min.js"), "html", null, true);
        yield "\"></script>
<script>
\$(document).ready(function() {
    \$('.select2').select2();
});
</script>
\t<script type=\"text/javascript\" src=\"";
        // line 81
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/js/jquery.repeater/jquery.repeater.min.js"), "html", null, true);
        yield "\"></script>
\t<script type=\"text/javascript\" src=\"";
        // line 82
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/js/jquery.repeater/repeater-init.js"), "html", null, true);
        yield "\"></script>
";
        yield from [];
    }

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

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

    /**
     * @codeCoverageIgnore
     */
    public function getDebugInfo(): array
    {
        return array (  113 => 82,  109 => 81,  99 => 75,  92 => 74,  86 => 71,  84 => 14,  81 => 13,  74 => 12,  61 => 9,  57 => 7,  54 => 4,  51 => 2,  49 => 1,  42 => 7,);
    }

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


/* communes/normes_actions_form.html.twig */
class __TwigTemplate_26f7abedfbadca218632929270413b4a___2116677132 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 14
        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", 14);
        yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks));
    }

    // line 15
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_box_body(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        // line 16
        yield "            ";
        yield         $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->renderBlock(($context["form"] ?? null), 'form_start');
        yield "
                <div class=\"form-group row\">
                    <label class=\"col-form-label col-sm-2\">Cible</label>
                    <div class=\"col-sm-10\">
                        ";
        // line 20
        yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(CoreExtension::getAttribute($this->env, $this->source, ($context["form"] ?? null), "target", [], "any", false, false, false, 20), 'widget');
        yield "
                    </div>
                </div>
                <div class=\"form-group row\">
                    <div class=\"col-sm-2\">
                        <label class=\"col-form-label\">Normes d'action</label>
                    </div>
                    <div class=\"col-sm-10\">
                        <div class=\"norme-repeater form-group\">
                            <div data-repeater-list=\"normes\">
                                ";
        // line 30
        if ((Twig\Extension\CoreExtension::length($this->env->getCharset(), ($context["actions"] ?? null)) > 0)) {
            // line 31
            yield "                                    ";
            $context['_parent'] = $context;
            $context['_seq'] = CoreExtension::ensureTraversable(($context["actions"] ?? null));
            foreach ($context['_seq'] as $context["_key"] => $context["action"]) {
                // line 32
                yield "                                        <div data-repeater-item=\"\" class=\"row mb-3\">
                                            <div class=\"col-md-12\">
                                                        <label>Désignation</label>
                                                        <textarea name=\"name\" required=\"required\" class=\"form-control\" style=\"margin-bottom: 10px;\">";
                // line 35
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["action"], "name", [], "any", false, false, false, 35), "html", null, true);
                yield " </textarea>
                                                    <button data-repeater-delete=\"\" class=\"btn btn-danger waves-effect waves-light\" type=\"button\">
                                                        <i class=\"ti-close\">Supprimer cette norme d'action</i>
                                                    </button>
                                                <hr>
                                            </div>
                                        </div>
                                    ";
            }
            $_parent = $context['_parent'];
            unset($context['_seq'], $context['_key'], $context['action'], $context['_parent']);
            $context = array_intersect_key($context, $_parent) + $_parent;
            // line 43
            yield "                                ";
        } else {
            // line 44
            yield "                                    <div data-repeater-item=\"\" class=\"row mb-3\">
                                        <div class=\"col-md-12\">
                                                <label>Désignation</label>
                                                <textarea name=\"name\" required=\"required\" class=\"form-control\" style=\"margin-bottom: 10px;\"> </textarea>
                                            <button data-repeater-delete=\"\" class=\"btn btn-danger waves-effect waves-light\" type=\"button\">
                                                <i class=\"ti-close\">Supprimer cette norme d'action</i>
                                            </button>
                                            <hr>
                                        </div>
                                    </div>
                                ";
        }
        // line 55
        yield "                            </div>
                            <button type=\"button\" data-repeater-create=\"\" class=\"btn btn-info waves-effect waves-light\">Ajouter une norme d'action
                            </button>
                        </div>
                    </div>
                </div>
                
                <div class=\"form-group row\">
                    <div class=\"col-sm-2\"><a href=\"";
        // line 63
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("app_normes_actions", ["id" => CoreExtension::getAttribute($this->env, $this->source, ($context["commune"] ?? null), "id", [], "any", false, false, false, 63)]), "html", null, true);
        yield "\" class=\"btn btn-block btn-default\">";
        yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("basics.cancel", [], "messages");
        yield "</a></div>
                    <div class=\"col-sm-offset-2 col-sm-10\">
                        <button type=\"submit\" name='save' value=\"save\" class=\"btn btn-block btn-primary\">";
        // line 65
        yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("basics.save", [], "messages");
        yield "</button>
                    </div>
                </div>
            ";
        // line 68
        yield         $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->renderBlock(($context["form"] ?? null), 'form_end');
        yield "
        ";
        yield from [];
    }

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

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

    /**
     * @codeCoverageIgnore
     */
    public function getDebugInfo(): array
    {
        return array (  277 => 68,  271 => 65,  264 => 63,  254 => 55,  241 => 44,  238 => 43,  224 => 35,  219 => 32,  214 => 31,  212 => 30,  199 => 20,  191 => 16,  184 => 15,  173 => 14,  113 => 82,  109 => 81,  99 => 75,  92 => 74,  86 => 71,  84 => 14,  81 => 13,  74 => 12,  61 => 9,  57 => 7,  54 => 4,  51 => 2,  49 => 1,  42 => 7,);
    }

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