<?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/evaluation_list.html.twig */
class __TwigTemplate_7867bf1fba7e9a1facac26dfe70d7fca 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("evaluation.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 "    ";
        yield         $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->renderBlock(($context["form"] ?? null), 'form_start');
        yield "
  
        ";
        // line 9
        yield from $this->load("plan/evaluation_list.html.twig", 9, 337912964)->unwrap()->yield($context);
        // line 33
        yield "     
        ";
        // line 34
        if ((($context["actionId"] ?? null) > 0)) {
            // line 35
            yield "        ";
            yield from $this->load("plan/evaluation_list.html.twig", 35, 690914370)->unwrap()->yield($context);
            // line 103
            yield "
        ";
        } else {
            // line 105
            yield "        <div class=\"alert alert-info\" role=\"alert\">
            ";
            // line 106
            yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Veuillez sélectionner une action  pour voir ces activités", [], "messages");
            // line 107
            yield "        </div>
        ";
        }
        // line 109
        yield "              
    ";
        // line 110
        yield         $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->renderBlock(($context["form"] ?? null), 'form_end');
        yield "

";
        yield from [];
    }

    // line 114
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_javascripts(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        // line 115
        yield "    <script src=\"";
        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>
        
        \$(document).on('change', '#evaluation_type, #evaluation_entite, #evaluation_programm', function () {
            let \$type = \$('#evaluation_type')
            let \$entite = \$('#evaluation_entite')
            let \$form = \$(this).closest('form')

            let data = {}
            data[\$type.attr('name')] = \$type.val()
            data[\$entite.attr('name')] = \$entite.val()
            data[\$(this).attr('name')] = \$(this).val()
            
            let \$field = \$(this).attr('id')
            \$.ajax({
                url: \$form.attr('action'),
                type: \$form.attr('method'),
                data: data,
                success: function(html) {
                    if (\$field == 'evaluation_type') {
                        \$('#evaluation_entite').replaceWith(
                            \$(html).find('#evaluation_entite')
                        )
                        \$('#evaluation_programm').replaceWith(
                            \$(html).find('#evaluation_programm')
                        )
                        \$('#evaluation_action').replaceWith(
                            \$(html).find('#evaluation_action')
                        )
                    }
                    if (\$field == 'evaluation_entite') { 
                        \$('#evaluation_programm').replaceWith(
                            \$(html).find('#evaluation_programm')
                        )
                        \$('#evaluation_action').replaceWith(
                            \$(html).find('#evaluation_action')
                        )
                    }
                    if (\$field == 'evaluation_programm') {
                        \$('#evaluation_action').replaceWith(
                            \$(html).find('#evaluation_action')
                        )
                    }
                }
            });
        });

        \$(function () {
            \$(\"#planAppreciationTable\").DataTable({
                \"searching\": false,
                \"pageLength\": 25,
                \"language\": {
                        \"url\": \"";
        // line 167
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("plugins/datatables/French.json"), "html", null, true);
        yield "\"
                    },
                \"lengthChange\": false,
                \"columnDefs\": [
                  { \"orderable\": false, \"targets\": -1 }
                ]
            });
        });
        
        \$(document).ready(function() {
            // Setup - add a text input to each footer cell
            /*\$('#planAppreciationTable thead tr').clone(true).appendTo( '#planAppreciationTable thead' );
            \$('#planAppreciationTable thead tr:eq(1) th').each( function (i) {
                var title = \$(this).text();
                \$(this).html( '<input type=\"text\" placeholder=\"Search '+title+'\" />' );
        
                \$( 'input', this ).on( 'keyup change', function () {
                    if ( table.column(i).search() !== this.value ) {
                        table
                            .column(i)
                            .search( this.value )
                            .draw();
                    }
                } );
            } );
        
            var table = \$('#planAppreciationTable').DataTable( {
                orderCellsTop: true,
                fixedHeader: true
            } );*/

            \$('#planAppreciationTables').DataTable( {
        initComplete: function () {
            this.api().columns().every( function () {
                var column = this;
                var select = \$('<select><option value=\"\"></option></select>')
                    .appendTo( \$(column.header()).empty() )
                    .on( 'change', function () {
                        var val = \$.fn.dataTable.util.escapeRegex(
                            \$(this).val()
                        );
 
                        column
                            .search( val ? '^'+val+'\$' : '', true, false )
                            .draw();
                    } );
 
                column.data().unique().sort().each( function ( d, j ) {
                    select.append( '<option value=\"'+d+'\">'+d+'</option>' )
                } );
            } );
        }
    } );

        } );
       

    </script>
     <script>
     // ========================================
//  TEST DE CHARGEMENT DU SCRIPT
// ========================================
console.log(\"Script de suggestion IA chargé\");

// ========================================
//  FONCTION DE COLLECTE DES ACTIVITÉS DEPUIS LE TABLEAU
// ========================================
function collectActivities() {
    console.log(\"collectActivities() appelée\");
    let activities = [];

    \$(\"#planAppreciationTable tbody tr\").each(function() {
        let \$row = \$(this);

        // Colonnes principales
        let activityText = \$row.find(\"td\").eq(0).text().trim();
        let nature = \$row.find(\"td\").eq(1).text().trim();
        let cible = \$row.find(\"td\").eq(2).text().trim();
        let nbLocation = \$row.find(\"td\").eq(3).text().trim();
        let sensitivity = \$row.find(\"td\").eq(4).text().trim();
        let appreciation = \$row.find(\"td\").eq(5).text().trim();

        // Lien de modification → mise à jour du sélecteur
        let editLink = \$row.find(\"a[href*='/app/notation/edit/']\").attr(\"href\");
        let notationId = null;

        if (editLink) {
            let matches = editLink.match(/\\/(\\d+)\$/);
            if (matches) {
                notationId = parseInt(matches[1]);
            }
        }

        // Nettoyage sensibilité (%)
        sensitivity = sensitivity.replace('%', '').trim();

        console.log(\"Ligne trouvée:\", {
            activityText,
            nature,
            cible,
            notationId,
            sensitivity
        });

        // Ajouter l’activité seulement si un ID est trouvé
        if (activityText && notationId) {
            activities.push({
                notation_id: notationId,
                activity_name: activityText,
                nature: nature,
                cible: cible,
                nb_location: nbLocation,
                sensitivity: parseFloat(sensitivity) || 0,
                appreciation: appreciation
            });
        }
    });

    console.log(\"Total activités collectées:\", activities.length);
    return activities;
}

// ========================================
//  FONCTION DE CRÉATION DE LA BARRE DE PROGRESSION
// ========================================
function createProgressBar() {
    console.log(\"createProgressBar() appelée\");
    // Supprimer une éventuelle barre de progression existante
    \$(\"#suggestion-ia-progress-container\").remove();
    
    let progressHtml = `
        <div id=\"suggestion-ia-progress-container\" class=\"mt-3\" style=\"display: none;\">
            <div class=\"progress\">
                <div id=\"suggestion-ia-progress-bar\" class=\"progress-bar progress-bar-striped progress-bar-animated\" 
                     role=\"progressbar\" style=\"width: 0%\"></div>
            </div>
            <div id=\"suggestion-ia-progress-text\" class=\"text-center mt-2\">
                <small>Génération des suggestions en cours...</small>
            </div>
        </div>
    `;
    
    \$(\"#amelioration-ia-btn\").after(progressHtml);
    return \$(\"#suggestion-ia-progress-container\");
}

// ========================================
//  FONCTION DE MISE À JOUR DE LA BARRE DE PROGRESSION
// ========================================
function updateProgressBar(percent) {
    \$(\"#suggestion-ia-progress-bar\").css(\"width\", percent + \"%\");
    \$(\"#suggestion-ia-progress-bar\").attr(\"aria-valuenow\", percent);
}

// ========================================
//  FONCTION DE SIMULATION DE PROGRESSION
// ========================================
function simulateProgress(duration) {
    console.log(\"simulateProgress() appelée\");
    return new Promise((resolve) => {
        let progress = 0;
        let interval = setInterval(() => {
            progress += 5;
            if (progress >= 90) {
                clearInterval(interval);
            }
            updateProgressBar(progress);
        }, duration / 18);
        
        setTimeout(() => {
            clearInterval(interval);
            resolve();
        }, duration);
    });
}


// ========================================
// 🔹 GESTION DU CLIC SUR LE BOUTON \"SUGGESTION IA\" (avec debug + délais prolongés)
// ========================================
\$(document).ready(function() {
    console.log(\"✅ Document ready - Initialisation du bouton suggestion IA\");

    \$(\"#amelioration-ia-btn\").on(\"click\", async function() {
        console.log(\" CLIC détecté sur le bouton 'SUGGESTION IA'\");

        const button = \$(this);
        const originalHtml = button.html();
        button.prop(\"disabled\", true).html('<i class=\"fas fa-spinner fa-spin\"></i> Génération en cours...');

        try {
            // Étape 1 : Collecte des activités
            console.log(\" Début de la collecte des activités...\");
            let activities = collectActivities();
            console.log(\"✅ Activités collectées :\", activities);

            if (activities.length === 0) {
                alert(\"Aucune activité trouvée pour générer des suggestions.\");
                button.prop(\"disabled\", false).html(originalHtml);
                return;
            }

            // Étape 2 : Barre de progression
            const progressContainer = createProgressBar();
            progressContainer.show();

            // Étape 3 : URLs
            const apiUrl = \"";
        // line 374
        yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("generate_activity_suggestions");
        yield "\";
            const redirectUrl = \"";
        // line 375
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("app_recommandation", ["id" => ($context["actionId"] ?? null)]), "html", null, true);
        yield "\";
            console.log(\" API URL :\", apiUrl);
            console.log(\" Redirect URL :\", redirectUrl);

            // Étape 4 : Simulation + Appel AJAX
            const progressPromise = simulateProgress(30000); //  10 secondes

            const apiPromise = \$.ajax({
                url: apiUrl,
                type: \"POST\",
                contentType: \"application/json\",
                data: JSON.stringify({ activities: activities }),
                timeout: 18000000, //  3 minutes
                beforeSend: function() {
                    console.log(\" Envoi de la requête AJAX vers :\", apiUrl);
                }
            })
            .done(function(response) {
                console.log(\"✅ [SUCCESS] Réponse AJAX complète :\", response);
            })
            .fail(function(xhr, status, error) {
                console.error(\"❌ [FAIL] Erreur AJAX détectée :\", { status, error });
                console.log(\"🧾 Réponse brute du serveur :\", xhr.responseText);

                // Si c’est une erreur HTML de Symfony
                if (xhr.responseText && xhr.responseText.includes(\"<html\")) {
                    console.warn(\"⚠️ Le serveur a retourné une page HTML (erreur Symfony probable)\");
                }

                throw new Error(\"Erreur AJAX : \" + status + \" - \" + error);
            })
            .always(function() {
                console.log(\"🧩 [COMPLETE] Fin de la requête AJAX\");
            });

            // Étape 5 : Attente
            const [_, response] = await Promise.all([progressPromise, apiPromise]);
            console.log(\"✅ Promesses terminées avec succès. Réponse finale :\", response);

            updateProgressBar(100);
            \$(\"#suggestion-ia-progress-text small\").text(\"Suggestions générées avec succès !\");
            
            // Étape 6 : Redirection (attente prolongée)
            console.log(\"🟢 Redirection prévue dans 5 secondes vers :\", redirectUrl);
            setTimeout(() => {
                window.location.href = redirectUrl;
            }, 5000);

        } catch (error) {
            console.group(\"❌ GESTION D'ERREUR GLOBALE\");
            console.error(\"Erreur attrapée :\", error);
            if (error.stack) console.error(\"Stack :\", error.stack);
            console.groupEnd();

            updateProgressBar(100);
            \$(\"#suggestion-ia-progress-bar\")
                .removeClass(\"progress-bar-animated\")
                .addClass(\"bg-danger\");
            \$(\"#suggestion-ia-progress-text small\")
                .text(\"Erreur lors de la génération des suggestions\");

            alert(\"⚠️ Une erreur est survenue : \" + error.message);
        } finally {
            button.prop(\"disabled\", false).html(originalHtml);
            console.log(\"🔁 Réinitialisation du bouton terminée.\");
        }
    });
});


      </script>

    <script src=\"";
        // line 447
        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 448
        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 451
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_stylesheets(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        // line 452
        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/evaluation_list.html.twig";
    }

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

    /**
     * @codeCoverageIgnore
     */
    public function getDebugInfo(): array
    {
        return array (  482 => 452,  475 => 451,  468 => 448,  464 => 447,  389 => 375,  385 => 374,  175 => 167,  119 => 115,  112 => 114,  104 => 110,  101 => 109,  97 => 107,  95 => 106,  92 => 105,  88 => 103,  85 => 35,  83 => 34,  80 => 33,  78 => 9,  72 => 7,  65 => 6,  54 => 3,  43 => 1,);
    }

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


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

    // line 10
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_box_body(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        // line 11
        yield "                <div class=\"text-right\">
                    <a href=\"";
        // line 12
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("app_notations", ["id" => ($context["actionId"] ?? null)]), "html", null, true);
        yield "\" class=\"btn btn-primary\">
                        <i class=\"fas fa-angle-double-left\"></i> ";
        // line 13
        yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("basics.processus", [], "messages");
        // line 14
        yield "                    </a>
                     <button id=\"amelioration-ia-btn\" type=\"button\" class=\"btn btn-primary\">
                            ";
        // line 16
        yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("basics.suggestionia", [], "messages");
        yield " <i class=\"fas fa-angle-double-right\"></i>
                        </button>
                        <a href=\"";
        // line 18
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("app_recommandation", ["id" => ($context["actionId"] ?? null)]), "html", null, true);
        yield "\" class=\"btn btn-primary\">
                    ";
        // line 19
        yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("basics.voirsuggestionia", [], "messages");
        yield "  <i class=\"fas fa-angle-double-right\"></i>
                </a>
                </div><br>
                ";
        // line 22
        if ((($tmp = $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_MANAGER")) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
            // line 23
            yield "                    ";
            yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(CoreExtension::getAttribute($this->env, $this->source, ($context["form"] ?? null), "type", [], "any", false, false, false, 23), 'row');
            yield "
                    ";
            // line 24
            yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(CoreExtension::getAttribute($this->env, $this->source, ($context["form"] ?? null), "entite", [], "any", false, false, false, 24), 'row');
            yield "
                ";
        }
        // line 26
        yield "                ";
        if ((($tmp = $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_DDD")) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
            // line 27
            yield "                    ";
            yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(CoreExtension::getAttribute($this->env, $this->source, ($context["form"] ?? null), "entite", [], "any", false, false, false, 27), 'row');
            yield "
                ";
        }
        // line 29
        yield "                ";
        yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(CoreExtension::getAttribute($this->env, $this->source, ($context["form"] ?? null), "programm", [], "any", false, false, false, 29), 'row');
        yield "
                ";
        // line 30
        yield $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(CoreExtension::getAttribute($this->env, $this->source, ($context["form"] ?? null), "action", [], "any", false, false, false, 30), 'row');
        yield "
            ";
        yield from [];
    }

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

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

    /**
     * @codeCoverageIgnore
     */
    public function getDebugInfo(): array
    {
        return array (  615 => 30,  610 => 29,  604 => 27,  601 => 26,  596 => 24,  591 => 23,  589 => 22,  583 => 19,  579 => 18,  574 => 16,  570 => 14,  568 => 13,  564 => 12,  561 => 11,  554 => 10,  543 => 9,  482 => 452,  475 => 451,  468 => 448,  464 => 447,  389 => 375,  385 => 374,  175 => 167,  119 => 115,  112 => 114,  104 => 110,  101 => 109,  97 => 107,  95 => 106,  92 => 105,  88 => 103,  85 => 35,  83 => 34,  80 => 33,  78 => 9,  72 => 7,  65 => 6,  54 => 3,  43 => 1,);
    }

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


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

    // line 36
    /**
     * @return iterable<null|scalar|\Stringable>
     */
    public function block_box_body(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        // line 37
        yield "           
                <table id=\"planAppreciationTable\" class=\"table table-striped\">
                    
                <thead>
                    <th>Activité</th>
                    <th>Nature</th>
                    <th>Cible</th>
                    <th style=\"width: 50px\">";
        // line 44
        yield (((CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, ($context["app"] ?? null), "session", [], "any", false, false, false, 44), "get", ["_commune"], "method", false, false, false, 44) || CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, ($context["app"] ?? null), "session", [], "any", false, false, false, 44), "get", ["_departement"], "method", false, false, false, 44))) ? ("# Arr.") : ("# Com."));
        yield "</th>
                    <th style=\"width: 75px\">Sensibilité</th>
                    <th style=\"width: 75px\">Appréciation</th>
                    ";
        // line 47
        if ((($tmp = $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_MANAGER")) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
            // line 48
            yield "                    <th style=\"width:100px\"></th>
                    ";
        }
        // line 50
        yield "                </thead>
                ";
        // line 51
        $context['_parent'] = $context;
        $context['_seq'] = CoreExtension::ensureTraversable(($context["notations"] ?? null));
        foreach ($context['_seq'] as $context["_key"] => $context["notation"]) {
            // line 52
            yield "                <tr>
                    <td>";
            // line 53
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["notation"], "activity", [], "any", false, false, false, 53), "code", [], "any", false, false, false, 53), "html", null, true);
            yield " - ";
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["notation"], "activity", [], "any", false, false, false, 53), "name", [], "any", false, false, false, 53), "html", null, true);
            yield "</td>
                    <td>";
            // line 54
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["notation"], "nature", [], "any", false, false, false, 54), "name", [], "any", false, false, false, 54), "html", null, true);
            yield "</td>
                    <td>
                        ";
            // line 56
            if ((($tmp = CoreExtension::getAttribute($this->env, $this->source, $context["notation"], "target", [], "any", false, false, false, 56)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
                // line 57
                yield "                            ";
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["notation"], "target", [], "any", false, false, false, 57), "name", [], "any", false, false, false, 57), "html", null, true);
                yield "
                        ";
            }
            // line 59
            yield "                    </td>
                    <td class=\"text-center\">";
            // line 60
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["notation"], "nbOfLocation", [], "any", false, false, false, 60), "html", null, true);
            yield "</td>
                    <td class=\"text-right\">";
            // line 61
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extension\CoreExtension']->formatNumber(CoreExtension::getAttribute($this->env, $this->source, $context["notation"], "sensitivity", [], "any", false, false, false, 61), 2), "html", null, true);
            yield " %</td>
                    <td class=\"text-left\"><span class=\"badge bg-";
            // line 62
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["notation"], "appreciation", [], "any", false, false, false, 62), "flag", [], "any", false, false, false, 62), "html", null, true);
            yield "\">";
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["notation"], "appreciation", [], "any", false, false, false, 62), "name", [], "any", false, false, false, 62), "html", null, true);
            yield "</span></td>
                    ";
            // line 63
            if (($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_MANAGER") || $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_FOCAL"))) {
                // line 64
                yield "                    <td class=\"text-center mb-2\">
                        <a href=\"";
                // line 65
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("app_notation_edit", ["id" => CoreExtension::getAttribute($this->env, $this->source, $context["notation"], "id", [], "any", false, false, false, 65)]), "html", null, true);
                yield "\" class=\"btn btn-sm btn-secondary\">";
                yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("basics.update", [], "messages");
                yield "</a>
                        <br><br>
                        ";
                // line 67
                if ((($tmp = CoreExtension::getAttribute($this->env, $this->source, $context["notation"], "duplicated", [], "any", false, false, false, 67)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
                    // line 68
                    yield "                            <a href=\"#\" data-toggle=\"modal\" data-target=\"#modal-delete-";
                    yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["notation"], "id", [], "any", false, false, false, 68), "html", null, true);
                    yield "\" class=\"btn btn-sm btn-default\">";
                    yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("basics.delete", [], "messages");
                    yield "</a>
                            
                            <div class=\"modal fade\" id=\"modal-delete-";
                    // line 70
                    yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["notation"], "id", [], "any", false, false, false, 70), "html", null, true);
                    yield "\">
                                <div class=\"modal-dialog\">
                                    <div class=\"modal-content\">
                                        <div class=\"modal-header\">
                                            <h5 class=\"modal-title\">";
                    // line 74
                    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 80
                    yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("evaluation.delete.message", [], "messages");
                    yield "</p>
                                            <b>";
                    // line 81
                    yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("basics.activity", [], "messages");
                    yield ":</b> ";
                    yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["notation"], "activity", [], "any", false, false, false, 81), "name", [], "any", false, false, false, 81), "html", null, true);
                    yield "</br>
                                            <b>";
                    // line 82
                    yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("basics.nature", [], "messages");
                    yield ":</b> ";
                    yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["notation"], "nature", [], "any", false, false, false, 82), "name", [], "any", false, false, false, 82), "html", null, true);
                    yield "</br>
                                            ";
                    // line 83
                    if ((($tmp = CoreExtension::getAttribute($this->env, $this->source, $context["notation"], "target", [], "any", false, false, false, 83)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
                        yield "<b>";
                        yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("basics.target", [], "messages");
                        yield ":</b> ";
                        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["notation"], "target", [], "any", false, false, false, 83), "name", [], "any", false, false, false, 83), "html", null, true);
                        yield "</br>";
                    }
                    // line 84
                    yield "                                            <b>";
                    yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("basics.sensitivity", [], "messages");
                    yield ":</b> ";
                    yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["notation"], "sensitivity", [], "any", false, false, false, 84), "html", null, true);
                    yield "%</br>
                                        </div>
                                        <div class=\"modal-footer justify-content-between\">
                                            <button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">";
                    // line 87
                    yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("basics.no", [], "messages");
                    yield "</button>
                                            <a href=\"";
                    // line 88
                    yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("app_notation_delete", ["id" => CoreExtension::getAttribute($this->env, $this->source, $context["notation"], "id", [], "any", false, false, false, 88)]), "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>
                        ";
                } else {
                    // line 94
                    yield "                            <a href=\"";
                    yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("app_notation_duplicate", ["id" => CoreExtension::getAttribute($this->env, $this->source, $context["notation"], "id", [], "any", false, false, false, 94)]), "html", null, true);
                    yield "\" class=\"btn btn-sm btn-default\">";
                    yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("basics.duplicate", [], "messages");
                    yield "</a>
                        ";
                }
                // line 96
                yield "                    </td>
                    ";
            }
            // line 98
            yield "                </tr>
                ";
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_key'], $context['notation'], $context['_parent']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 100
        yield "                </table>
            ";
        yield from [];
    }

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

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

    /**
     * @codeCoverageIgnore
     */
    public function getDebugInfo(): array
    {
        return array (  865 => 100,  858 => 98,  854 => 96,  846 => 94,  835 => 88,  831 => 87,  822 => 84,  814 => 83,  808 => 82,  802 => 81,  798 => 80,  789 => 74,  782 => 70,  774 => 68,  772 => 67,  765 => 65,  762 => 64,  760 => 63,  754 => 62,  750 => 61,  746 => 60,  743 => 59,  737 => 57,  735 => 56,  730 => 54,  724 => 53,  721 => 52,  717 => 51,  714 => 50,  710 => 48,  708 => 47,  702 => 44,  693 => 37,  686 => 36,  675 => 35,  615 => 30,  610 => 29,  604 => 27,  601 => 26,  596 => 24,  591 => 23,  589 => 22,  583 => 19,  579 => 18,  574 => 16,  570 => 14,  568 => 13,  564 => 12,  561 => 11,  554 => 10,  543 => 9,  482 => 452,  475 => 451,  468 => 448,  464 => 447,  389 => 375,  385 => 374,  175 => 167,  119 => 115,  112 => 114,  104 => 110,  101 => 109,  97 => 107,  95 => 106,  92 => 105,  88 => 103,  85 => 35,  83 => 34,  80 => 33,  78 => 9,  72 => 7,  65 => 6,  54 => 3,  43 => 1,);
    }

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