<?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_form.html.twig */
class __TwigTemplate_9407c96f82ba0798d76dc942398ea005 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 11
        return $this->load((isset($context["extendedTemplate"]) || array_key_exists("extendedTemplate", $context) ? $context["extendedTemplate"] : (function () { throw new RuntimeError('Variable "extendedTemplate" does not exist.', 11, $this->source); })()), 11);
    }

    protected function doDisplay(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "setting/direction_form.html.twig"));

        // line 1
        if ((CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 1, $this->source); })()), "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, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 4, $this->source); })()), "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, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 7, $this->source); })()), "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));
        
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);

    }

    // line 13
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_page_title(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "page_title"));

        yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("direction.title", [], "messages");
        
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);

        yield from [];
    }

    // line 16
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_page_content(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "page_content"));

        // line 17
        yield "    ";
        yield from $this->load("setting/direction_form.html.twig", 17, "847726983")->unwrap()->yield($context);
        
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);

        yield from [];
    }

    // line 54
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_javascripts(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "javascripts"));

        // line 55
        yield "
    <script>
        let \$type = \$('#direction_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) {
                    \$('#direction_entite').replaceWith(
                        \$(html).find('#direction_entite')
                    );
                }
            });
        });
    </script>
";
        
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);

        yield from [];
    }

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

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

    /**
     * @codeCoverageIgnore
     */
    public function getDebugInfo(): array
    {
        return array (  120 => 55,  110 => 54,  101 => 17,  91 => 16,  74 => 13,  67 => 11,  64 => 8,  62 => 7,  59 => 5,  57 => 4,  54 => 2,  52 => 1,  42 => 11,);
    }

    public function getSourceContext(): Source
    {
        return new Source("{% if app.session.get('_application') == 0 %}
    {% set extendedTemplate = '@AdminLTE/layout/mesodd-layout.html.twig' %}
{% endif %}
{% if app.session.get('_application') == 1 %}
    {% set extendedTemplate = '@AdminLTE/layout/suiodd-layout.html.twig' %}
{% endif %}
{% if app.session.get('_application') == 2 %}
    {% set extendedTemplate = '@AdminLTE/layout/cfgodd-layout.html.twig' %}
{% endif %}

{% extends extendedTemplate %}

{% block page_title %}{% trans %}direction.title{% endtrans %}{% endblock %}


{% block page_content %}
    {% embed '@AdminLTE/Widgets/box-widget.html.twig' %}
        {% block box_body %}
            {{ form_start(form) }}
            {% if(is_granted('ROLE_MANAGER')) %}
                {{ form_row(form.type) }}
            {% endif %}
            {% if(is_granted('ROLE_MANAGER') or is_granted('ROLE_DDD')) %}
                {{ form_row(form.entite) }}
            {% endif %}
            {{ form_row(form.code) }}
            {{ form_row(form.name) }}
            <hr>
            {{ form_row(form.uploadkey) }}

            {% if form.years is defined %}
            <div class=\"form-group row\">
                <label class=\"col-form-label col-sm-2 required\" for=\"ministry_years\">{% trans %}basics.years{% endtrans %}</label>
                <div class=\"col-sm-10\">
                    {% for year in form.years %}
                    <div class=\"col-1 mb-2 mr-2 float-left input-group-text\">
                        {{ form_widget(year) }}
                    </div>
                    {% endfor %}
                </div> 
            </div>
            {% endif %}
            <div class=\"form-group row\">
                <div class=\"col-sm-2\"><a href=\"{{ path('app_directions') }}\" class=\"btn btn-block btn-default\">{% trans %}basics.cancel{% endtrans %}</a></div>
                    <div class=\"col-sm-offset-2 col-sm-10\">
                        <button type=\"submit\" class=\"btn btn-block btn-primary\">{% trans %}basics.save{% endtrans %}</button>
                    </div>
                </div>
            {{ form_end(form) }}
        {% endblock %}
    {% endembed %}
{% endblock %}

{% block javascripts %}

    <script>
        let \$type = \$('#direction_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) {
                    \$('#direction_entite').replaceWith(
                        \$(html).find('#direction_entite')
                    );
                }
            });
        });
    </script>
{% endblock %}", "setting/direction_form.html.twig", "/var/www/vhosts/sigodd.gouv.bj/httpdocs/templates/setting/direction_form.html.twig");
    }
}


/* setting/direction_form.html.twig */
class __TwigTemplate_9407c96f82ba0798d76dc942398ea005___847726983 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 17
        return "@AdminLTE/Widgets/box-widget.html.twig";
    }

    protected function doDisplay(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "setting/direction_form.html.twig"));

        $this->parent = $this->load("@AdminLTE/Widgets/box-widget.html.twig", 17);
        yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks));
        
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);

    }

    // line 18
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_box_body(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "box_body"));

        // line 19
        yield "            ";
        yield         $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->renderBlock((isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 19, $this->source); })()), 'form_start');
        yield "
            ";
        // line 20
        if ((($tmp = $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_MANAGER")) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
            // line 21
            yield "                ";
            yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(CoreExtension::getAttribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 21, $this->source); })()), "type", [], "any", false, false, false, 21), 'row');
            yield "
            ";
        }
        // line 23
        yield "            ";
        if (($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_MANAGER") || $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_DDD"))) {
            // line 24
            yield "                ";
            yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(CoreExtension::getAttribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 24, $this->source); })()), "entite", [], "any", false, false, false, 24), 'row');
            yield "
            ";
        }
        // line 26
        yield "            ";
        yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(CoreExtension::getAttribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 26, $this->source); })()), "code", [], "any", false, false, false, 26), 'row');
        yield "
            ";
        // line 27
        yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(CoreExtension::getAttribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 27, $this->source); })()), "name", [], "any", false, false, false, 27), 'row');
        yield "
            <hr>
            ";
        // line 29
        yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(CoreExtension::getAttribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 29, $this->source); })()), "uploadkey", [], "any", false, false, false, 29), 'row');
        yield "

            ";
        // line 31
        if (CoreExtension::getAttribute($this->env, $this->source, ($context["form"] ?? null), "years", [], "any", true, true, false, 31)) {
            // line 32
            yield "            <div class=\"form-group row\">
                <label class=\"col-form-label col-sm-2 required\" for=\"ministry_years\">";
            // line 33
            yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("basics.years", [], "messages");
            yield "</label>
                <div class=\"col-sm-10\">
                    ";
            // line 35
            $context['_parent'] = $context;
            $context['_seq'] = CoreExtension::ensureTraversable(CoreExtension::getAttribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 35, $this->source); })()), "years", [], "any", false, false, false, 35));
            foreach ($context['_seq'] as $context["_key"] => $context["year"]) {
                // line 36
                yield "                    <div class=\"col-1 mb-2 mr-2 float-left input-group-text\">
                        ";
                // line 37
                yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock($context["year"], 'widget');
                yield "
                    </div>
                    ";
            }
            $_parent = $context['_parent'];
            unset($context['_seq'], $context['_key'], $context['year'], $context['_parent']);
            $context = array_intersect_key($context, $_parent) + $_parent;
            // line 40
            yield "                </div> 
            </div>
            ";
        }
        // line 43
        yield "            <div class=\"form-group row\">
                <div class=\"col-sm-2\"><a href=\"";
        // line 44
        yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("app_directions");
        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\" class=\"btn btn-block btn-primary\">";
        // line 46
        yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("basics.save", [], "messages");
        yield "</button>
                    </div>
                </div>
            ";
        // line 49
        yield         $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->renderBlock((isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 49, $this->source); })()), 'form_end');
        yield "
        ";
        
        $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);

        yield from [];
    }

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

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

    /**
     * @codeCoverageIgnore
     */
    public function getDebugInfo(): array
    {
        return array (  390 => 49,  384 => 46,  377 => 44,  374 => 43,  369 => 40,  360 => 37,  357 => 36,  353 => 35,  348 => 33,  345 => 32,  343 => 31,  338 => 29,  333 => 27,  328 => 26,  322 => 24,  319 => 23,  313 => 21,  311 => 20,  306 => 19,  296 => 18,  279 => 17,  120 => 55,  110 => 54,  101 => 17,  91 => 16,  74 => 13,  67 => 11,  64 => 8,  62 => 7,  59 => 5,  57 => 4,  54 => 2,  52 => 1,  42 => 11,);
    }

    public function getSourceContext(): Source
    {
        return new Source("{% if app.session.get('_application') == 0 %}
    {% set extendedTemplate = '@AdminLTE/layout/mesodd-layout.html.twig' %}
{% endif %}
{% if app.session.get('_application') == 1 %}
    {% set extendedTemplate = '@AdminLTE/layout/suiodd-layout.html.twig' %}
{% endif %}
{% if app.session.get('_application') == 2 %}
    {% set extendedTemplate = '@AdminLTE/layout/cfgodd-layout.html.twig' %}
{% endif %}

{% extends extendedTemplate %}

{% block page_title %}{% trans %}direction.title{% endtrans %}{% endblock %}


{% block page_content %}
    {% embed '@AdminLTE/Widgets/box-widget.html.twig' %}
        {% block box_body %}
            {{ form_start(form) }}
            {% if(is_granted('ROLE_MANAGER')) %}
                {{ form_row(form.type) }}
            {% endif %}
            {% if(is_granted('ROLE_MANAGER') or is_granted('ROLE_DDD')) %}
                {{ form_row(form.entite) }}
            {% endif %}
            {{ form_row(form.code) }}
            {{ form_row(form.name) }}
            <hr>
            {{ form_row(form.uploadkey) }}

            {% if form.years is defined %}
            <div class=\"form-group row\">
                <label class=\"col-form-label col-sm-2 required\" for=\"ministry_years\">{% trans %}basics.years{% endtrans %}</label>
                <div class=\"col-sm-10\">
                    {% for year in form.years %}
                    <div class=\"col-1 mb-2 mr-2 float-left input-group-text\">
                        {{ form_widget(year) }}
                    </div>
                    {% endfor %}
                </div> 
            </div>
            {% endif %}
            <div class=\"form-group row\">
                <div class=\"col-sm-2\"><a href=\"{{ path('app_directions') }}\" class=\"btn btn-block btn-default\">{% trans %}basics.cancel{% endtrans %}</a></div>
                    <div class=\"col-sm-offset-2 col-sm-10\">
                        <button type=\"submit\" class=\"btn btn-block btn-primary\">{% trans %}basics.save{% endtrans %}</button>
                    </div>
                </div>
            {{ form_end(form) }}
        {% endblock %}
    {% endembed %}
{% endblock %}

{% block javascripts %}

    <script>
        let \$type = \$('#direction_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) {
                    \$('#direction_entite').replaceWith(
                        \$(html).find('#direction_entite')
                    );
                }
            });
        });
    </script>
{% endblock %}", "setting/direction_form.html.twig", "/var/www/vhosts/sigodd.gouv.bj/httpdocs/templates/setting/direction_form.html.twig");
    }
}
