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

/* frontend/sensibilite.html.twig */
class __TwigTemplate_93752a05b6acf07b738f72ab4285486c 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 = [
            'content' => [$this, 'block_content'],
            'js' => [$this, 'block_js'],
        ];
    }

    protected function doGetParent(array $context): bool|string|Template|TemplateWrapper
    {
        // line 1
        return "frontend/layout.html.twig";
    }

    protected function doDisplay(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        $this->parent = $this->load("frontend/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_content(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        // line 4
        yield "<div class=\"container single-template\">
    <div class=\"page-header\">
\t\t<h1 class=\"page-title\">
\t\t\tSensibilité des PTA aux ODD en ";
        // line 7
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["year"] ?? null), "html", null, true);
        yield "
\t\t</h1>
\t</div>

    <div class=\"container row\" style=\"margin-top: 20px;\">
\t\t<p>
\t\t\tLa Mesure Sensibilité ODD est une tâche de la DGCS-ODD pour évaluer, de manière proactive, la conformité des Plans de Travail Annuel (PTA) des ministères et des communes avec les Objectifs de Développement Durable (ODD). Elle permet une analyse ex ante, c'est-à-dire en amont de la mise en œuvre, afin d'identifier dans quelle mesure les actions planifiées contribuent aux différentes cibles des ODD. En fournissant des indicateurs clairs et des outils d'évaluation pertinents, cette application aide les ministères à aligner leurs stratégies et leurs priorités avec l'Agenda 2030 pour un développement durable, tout en renforçant la cohérence des politiques publiques.
\t\t</p>

\t\t";
        // line 16
        yield         $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->renderBlock(($context["form"] ?? null), 'form_start');
        yield "
\t\t\t\t\t<div class=\"form-group row\">
\t\t\t\t\t\t<div class=\"col-sm-4\">
                            ";
        // line 19
        yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(CoreExtension::getAttribute($this->env, $this->source, ($context["form"] ?? null), "year", [], "any", false, false, false, 19), 'label', ["label_attr" => ["class" => "col-sm-12"]]);
        yield "
                            ";
        // line 20
        yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(CoreExtension::getAttribute($this->env, $this->source, ($context["form"] ?? null), "year", [], "any", false, false, false, 20), 'widget');
        yield "
                        </div>
\t\t\t\t\t\t<div class=\"col-sm-4\">
                            ";
        // line 23
        yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(CoreExtension::getAttribute($this->env, $this->source, ($context["form"] ?? null), "type", [], "any", false, false, false, 23), 'label', ["label_attr" => ["class" => "col-sm-12"]]);
        yield "
                            ";
        // line 24
        yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(CoreExtension::getAttribute($this->env, $this->source, ($context["form"] ?? null), "type", [], "any", false, false, false, 24), 'widget');
        yield "
                        </div>
\t\t\t\t\t\t<div class=\"col-sm-4\">
                            ";
        // line 27
        yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(CoreExtension::getAttribute($this->env, $this->source, ($context["form"] ?? null), "entite", [], "any", false, false, false, 27), 'label', ["label_attr" => ["class" => "col-sm-12"]]);
        yield "
                            ";
        // line 28
        yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(CoreExtension::getAttribute($this->env, $this->source, ($context["form"] ?? null), "entite", [], "any", false, false, false, 28), 'widget');
        yield "
                        </div>
\t\t\t\t\t</div>
\t\t\t\t";
        // line 31
        yield         $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->renderBlock(($context["form"] ?? null), 'form_end');
        yield "  

\t\t\t\t<div class=\"row\" style=\"margin-top: 50px;\">
                <div class=\"col-md-12\">
                    <div class=\"chart\" style=\"position: relative; height:80vh; width:100%\">
                        <canvas id=\"barChart\"></canvas>
                        <div id=\"bar-chart\" style=\"height: 500px;\"></div>
                    </div>
                </div>
            </div>

\t</div>

</div>
";
        yield from [];
    }

    // line 47
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_js(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        // line 48
        yield "<script src=\"";
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("plugins/jquery/jquery.min.js"), "html", null, true);
        yield "\"></script>
<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>

\t<script>
        \$(function () {
            var barChartData = {
                labels  : ";
        // line 74
        if ((($tmp = ($context["barChart"] ?? null)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
            yield json_encode((($_v0 = ($context["barChart"] ?? null)) && is_array($_v0) || $_v0 instanceof ArrayAccess ? ($_v0["labels"] ?? null) : null));
        } else {
            yield " [] ";
        }
        yield ",
                datasets: [
                    {
                        backgroundColor     : ";
        // line 77
        if ((($tmp = ($context["barChart"] ?? null)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
            yield json_encode((($_v1 = ($context["barChart"] ?? null)) && is_array($_v1) || $_v1 instanceof ArrayAccess ? ($_v1["bgColor"] ?? null) : null));
        } else {
            yield " [] ";
        }
        yield ",
                        borderColor         : ";
        // line 78
        if ((($tmp = ($context["barChart"] ?? null)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
            yield json_encode((($_v2 = ($context["barChart"] ?? null)) && is_array($_v2) || $_v2 instanceof ArrayAccess ? ($_v2["bgColor"] ?? null) : null));
        } else {
            yield " [] ";
        }
        yield ",
                        borderWidth         : 1,
                        pointRadius         : false,
                        pointColor          : '#3b8bba',
                        pointStrokeColor    : 'rgba(60,141,188,1)',
                        pointHighlightFill  : '#fff',
                        pointHighlightStroke: 'rgba(60,141,188,1)',
                        data                : ";
        // line 85
        if ((($tmp = ($context["barChart"] ?? null)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
            yield json_encode((($_v3 = ($context["barChart"] ?? null)) && is_array($_v3) || $_v3 instanceof ArrayAccess ? ($_v3["values"] ?? null) : null));
        } else {
            yield " [] ";
        }
        // line 86
        yield "                    },
                ]
            }

            var barChartCanvas = document.getElementById('barChart').getContext('2d');
      
            var barChartOptions = {
                responsive              : true,
                maintainAspectRatio     : false,
                datasetFill             : false,
                legend: {
                        display: false
                    },
                scales: {
                    yAxes: [{
                        ticks: {
                            beginAtZero: true
                        }
                    }]
                },
                plugins: {
                    // Change options for ALL labels of THIS CHART
                    datalabels: {
                        backgroundColor: ";
        // line 109
        if ((($tmp = ($context["barChart"] ?? null)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
            yield json_encode((($_v4 = ($context["barChart"] ?? null)) && is_array($_v4) || $_v4 instanceof ArrayAccess ? ($_v4["bgColor"] ?? null) : null));
        } else {
            yield " [] ";
        }
        yield ",
\t\t\t\t\t\tborderColor: 'white',
\t\t\t\t\t\tborderRadius: 25,
\t\t\t\t\t\tborderWidth: 2,
                        color: 'white',
                        font: {
                            weight: 'bold',
                            size: 12,
                        },
                        align: 'start',
\t\t\t\t\t\tanchor: 'end'
                    }
                }
            }
        
            var barChart = new Chart(barChartCanvas, {
                type: 'bar', 
                data: barChartData,
                options: barChartOptions
            })
      
        })
    </script>

    <script src=\"";
        // line 133
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("plugins/chart.js/Chart.min.js"), "html", null, true);
        yield "\"></script>
    <script src=\"";
        // line 134
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("plugins/chartjs-plugin-datalabels/chartjs-plugin-datalabels.min.js"), "html", null, true);
        yield "\"></script>

";
        yield from [];
    }

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

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

    /**
     * @codeCoverageIgnore
     */
    public function getDebugInfo(): array
    {
        return array (  267 => 134,  263 => 133,  232 => 109,  207 => 86,  201 => 85,  187 => 78,  179 => 77,  169 => 74,  139 => 48,  132 => 47,  112 => 31,  106 => 28,  102 => 27,  96 => 24,  92 => 23,  86 => 20,  82 => 19,  76 => 16,  64 => 7,  59 => 4,  52 => 3,  41 => 1,);
    }

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