var/cache/dev/twig/0b/0b6a5b8b5ad19e9bbb1bce8a62e371c8.php line 83

  1. <?php
  2. use Twig\Environment;
  3. use Twig\Error\LoaderError;
  4. use Twig\Error\RuntimeError;
  5. use Twig\Extension\SandboxExtension;
  6. use Twig\Markup;
  7. use Twig\Sandbox\SecurityError;
  8. use Twig\Sandbox\SecurityNotAllowedTagError;
  9. use Twig\Sandbox\SecurityNotAllowedFilterError;
  10. use Twig\Sandbox\SecurityNotAllowedFunctionError;
  11. use Twig\Source;
  12. use Twig\Template;
  13. /* candidature/form.html.twig */
  14. class __TwigTemplate_f7b42b4d030bca35650cd2579f3f26e8 extends \Twig\Template
  15. {
  16.     private $source;
  17.     private $macros = [];
  18.     public function __construct(Environment $env)
  19.     {
  20.         parent::__construct($env);
  21.         $this->source $this->getSourceContext();
  22.         $this->blocks = [
  23.             'title' => [$this'block_title'],
  24.             'body' => [$this'block_body'],
  25.         ];
  26.     }
  27.     protected function doGetParent(array $context)
  28.     {
  29.         // line 1
  30.         return "base.html.twig";
  31.     }
  32.     protected function doDisplay(array $context, array $blocks = [])
  33.     {
  34.         $macros $this->macros;
  35.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  36.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""candidature/form.html.twig"));
  37.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  38.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""candidature/form.html.twig"));
  39.         // line 6
  40.         $context["input_class"] = "w-full px-4 py-2 rounded-lg border border-slate-200 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-transparent transition";
  41.         // line 7
  42.         $context["is_edit_page"] = (twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->sourcetwig_get_attribute($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); })()), "request", [], "any"falsefalsefalse7), "attributes", [], "any"falsefalsefalse7), "get", [=> "_route"], "method"falsefalsefalse7) == "app_candidature_edit");
  43.         // line 1
  44.         $this->parent $this->loadTemplate("base.html.twig""candidature/form.html.twig"1);
  45.         $this->parent->display($contextarray_merge($this->blocks$blocks));
  46.         
  47.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  48.         
  49.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  50.     }
  51.     // line 3
  52.     public function block_title($context, array $blocks = [])
  53.     {
  54.         $macros $this->macros;
  55.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  56.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""title"));
  57.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  58.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""title"));
  59.         echo "Nouvelle candidature | DAIP";
  60.         
  61.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  62.         
  63.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  64.     }
  65.     // line 9
  66.     public function block_body($context, array $blocks = [])
  67.     {
  68.         $macros $this->macros;
  69.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  70.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""body"));
  71.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  72.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""body"));
  73.         // line 10
  74.         echo "
  75. ";
  76.         // line 12
  77.         $context['_parent'] = $context;
  78.         $context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'12$this->source); })()), "flashes", [], "any"falsefalsefalse12));
  79.         foreach ($context['_seq'] as $context["label"] => $context["messages"]) {
  80.             // line 13
  81.             echo "
  82.     ";
  83.             // line 14
  84.             $context['_parent'] = $context;
  85.             $context['_seq'] = twig_ensure_traversable($context["messages"]);
  86.             foreach ($context['_seq'] as $context["_key"] => $context["message"]) {
  87.                 // line 15
  88.                 echo "        <div class=\"mb-4 p-4 rounded-lg border
  89.             ";
  90.                 // line 16
  91.                 if (($context["label"] == "error")) {
  92.                     // line 17
  93.                     echo "                bg-red-50 border-red-200 text-red-800
  94.             ";
  95.                 } elseif ((                // line 18
  96. $context["label"] == "success")) {
  97.                     // line 19
  98.                     echo "                bg-green-50 border-green-200 text-green-800
  99.             ";
  100.                 } else {
  101.                     // line 21
  102.                     echo "                bg-blue-50 border-blue-200 text-blue-800
  103.             ";
  104.                 }
  105.                 // line 23
  106.                 echo "        \">
  107.             ";
  108.                 // line 24
  109.                 echo $context["message"];
  110.                 echo "
  111.         </div>
  112.     ";
  113.             }
  114.             $_parent $context['_parent'];
  115.             unset($context['_seq'], $context['_iterated'], $context['_key'], $context['message'], $context['_parent'], $context['loop']);
  116.             $context array_intersect_key($context$_parent) + $_parent;
  117.         }
  118.         $_parent $context['_parent'];
  119.         unset($context['_seq'], $context['_iterated'], $context['label'], $context['messages'], $context['_parent'], $context['loop']);
  120.         $context array_intersect_key($context$_parent) + $_parent;
  121.         // line 28
  122.         echo "
  123. <div class=\"bg-gradient-to-r from-indigo-600 to-purple-600 p-8 mb-8 text-white\">
  124.     <div class=\"flex items-center gap-4 mb-4\">
  125.         <div class=\"w-16 h-16 bg-white/20 rounded-full flex items-center justify-center\">
  126.             <i class=\"fas fa-file-alt text-3xl\"></i>
  127.         </div>
  128.         <div>
  129.             <h1 class=\"text-2xl font-bold\">
  130.                 ";
  131.         // line 37
  132.         if ((isset($context["is_edit_page"]) || array_key_exists("is_edit_page"$context) ? $context["is_edit_page"] : (function () { throw new RuntimeError('Variable "is_edit_page" does not exist.'37$this->source); })())) {
  133.             echo "Modification de candidature";
  134.         } else {
  135.             echo "Nouvelle candidature";
  136.         }
  137.         // line 38
  138.         echo "            </h1>
  139.             <p class=\"text-white/80\">
  140.                 ";
  141.         // line 40
  142.         if ((isset($context["is_edit_page"]) || array_key_exists("is_edit_page"$context) ? $context["is_edit_page"] : (function () { throw new RuntimeError('Variable "is_edit_page" does not exist.'40$this->source); })())) {
  143.             echo "Mettez a jour les informations de la candidature de facon claire et complete.";
  144.         } else {
  145.             echo "Vous etes sur le point de postuler a une formation";
  146.         }
  147.         // line 41
  148.         echo "            </p>
  149.         </div>
  150.     </div>
  151.     
  152.     <!-- Informations du candidat -->
  153.     ";
  154.         // line 46
  155.         if (twig_get_attribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'46$this->source); })()), "user", [], "any"falsefalsefalse46)) {
  156.             // line 47
  157.             echo "        ";
  158.             if ((($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_ENT") && (isset($context["is_edit_page"]) || array_key_exists("is_edit_page"$context) ? $context["is_edit_page"] : (function () { throw new RuntimeError('Variable "is_edit_page" does not exist.'47$this->source); })())) && array_key_exists("candidature"$context))) {
  159.                 // line 48
  160.                 echo "            <div class=\"mt-4 grid grid-cols-1 lg:grid-cols-2 gap-4\">
  161.                 <div class=\"bg-white/10 backdrop-blur-sm rounded-xl p-4 border border-white/20\">
  162.                     <p class=\"text-sm font-semibold text-white/80 mb-3 flex items-center\">
  163.                         <i class=\"fas fa-user-graduate mr-2\"></i>
  164.                         Informations du candidat
  165.                     </p>
  166.                     <div class=\"space-y-3\">
  167.                         <div class=\"bg-white/10 rounded-lg px-3 py-2\">
  168.                             <p class=\"text-xs uppercase tracking-wide text-white/70\">Nom du candidat</p>
  169.                             <p class=\"text-sm font-semibold text-white mt-1\">";
  170.                 // line 57
  171.                 ((twig_get_attribute($this->env$this->source, (isset($context["candidature"]) || array_key_exists("candidature"$context) ? $context["candidature"] : (function () { throw new RuntimeError('Variable "candidature" does not exist.'57$this->source); })()), "user", [], "any"falsefalsefalse57)) ? (print (twig_escape_filter($this->envtwig_trim_filter(((twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["candidature"]) || array_key_exists("candidature"$context) ? $context["candidature"] : (function () { throw new RuntimeError('Variable "candidature" does not exist.'57$this->source); })()), "user", [], "any"falsefalsefalse57), "nom", [], "any"falsefalsefalse57) . " ") . twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["candidature"]) || array_key_exists("candidature"$context) ? $context["candidature"] : (function () { throw new RuntimeError('Variable "candidature" does not exist.'57$this->source); })()), "user", [], "any"falsefalsefalse57), "prenoms", [], "any"falsefalsefalse57))), "html"nulltrue))) : (print ("Non renseigne")));
  172.                 echo "</p>
  173.                         </div>
  174.                         <div class=\"bg-white/10 rounded-lg px-3 py-2\">
  175.                             <p class=\"text-xs uppercase tracking-wide text-white/70\">Numero de candidature</p>
  176.                             <p class=\"text-sm font-semibold text-white mt-1\">";
  177.                 // line 61
  178.                 echo twig_escape_filter($this->env, ((twig_get_attribute($this->env$this->source, ($context["candidature"] ?? null), "numero", [], "any"truetruefalse61)) ? (_twig_default_filter(twig_get_attribute($this->env$this->source, ($context["candidature"] ?? null), "numero", [], "any"falsefalsefalse61), "Non attribue")) : ("Non attribue")), "html"nulltrue);
  179.                 echo "</p>
  180.                         </div>
  181.                     </div>
  182.                 </div>
  183.                 <div class=\"bg-white/10 backdrop-blur-sm rounded-xl p-4 border border-white/20\">
  184.                     <p class=\"text-sm font-semibold text-white/80 mb-3 flex items-center\">
  185.                         <i class=\"fas fa-file-signature mr-2\"></i>
  186.                         Informations de la candidature
  187.                     </p>
  188.                     <div class=\"space-y-3\">
  189.                         <div class=\"bg-white/10 rounded-lg px-3 py-2\">
  190.                             <p class=\"text-xs uppercase tracking-wide text-white/70\">Etablissement choisi</p>
  191.                             <p class=\"text-sm font-semibold text-white mt-1\">";
  192.                 // line 74
  193.                 ((twig_get_attribute($this->env$this->source, (isset($context["candidature"]) || array_key_exists("candidature"$context) ? $context["candidature"] : (function () { throw new RuntimeError('Variable "candidature" does not exist.'74$this->source); })()), "etablissement", [], "any"falsefalsefalse74)) ? (print (twig_escape_filter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["candidature"]) || array_key_exists("candidature"$context) ? $context["candidature"] : (function () { throw new RuntimeError('Variable "candidature" does not exist.'74$this->source); })()), "etablissement", [], "any"falsefalsefalse74), "nom", [], "any"falsefalsefalse74), "html"nulltrue))) : (print ("Non renseigne")));
  194.                 echo "</p>
  195.                         </div>
  196.                         <div class=\"bg-white/10 rounded-lg px-3 py-2\">
  197.                             <p class=\"text-xs uppercase tracking-wide text-white/70\">Metier choisi</p>
  198.                             <p class=\"text-sm font-semibold text-white mt-1\">";
  199.                 // line 78
  200.                 ((twig_get_attribute($this->env$this->source, (isset($context["candidature"]) || array_key_exists("candidature"$context) ? $context["candidature"] : (function () { throw new RuntimeError('Variable "candidature" does not exist.'78$this->source); })()), "metier", [], "any"falsefalsefalse78)) ? (print (twig_escape_filter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["candidature"]) || array_key_exists("candidature"$context) ? $context["candidature"] : (function () { throw new RuntimeError('Variable "candidature" does not exist.'78$this->source); })()), "metier", [], "any"falsefalsefalse78), "nom", [], "any"falsefalsefalse78), "html"nulltrue))) : (print ("Non renseigne")));
  201.                 echo "</p>
  202.                         </div>
  203.                     </div>
  204.                 </div>
  205.             </div>
  206.         ";
  207.             } else {
  208.                 // line 84
  209.                 echo "            <div class=\"bg-white/10 backdrop-blur-sm rounded-xl p-4 mt-4\">
  210.                 <div class=\"flex items-center gap-3\">
  211.                     <div class=\"w-10 h-10 bg-white/20 rounded-full flex items-center justify-center\">
  212.                         <i class=\"fas fa-user\"></i>
  213.                     </div>
  214.                     <div>
  215.                         <p class=\"text-sm text-white/80\">Candidat</p>
  216.                         <p class=\"font-semibold\">";
  217.                 // line 91
  218.                 echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'91$this->source); })()), "user", [], "any"falsefalsefalse91), "nom", [], "any"falsefalsefalse91), "html"nulltrue);
  219.                 echo " ";
  220.                 echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'91$this->source); })()), "user", [], "any"falsefalsefalse91), "prenoms", [], "any"falsefalsefalse91), "html"nulltrue);
  221.                 echo "</p>
  222.                     </div>
  223.                     ";
  224.                 // line 95
  225.                 echo "                    ";
  226.                 if (twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'95$this->source); })()), "user", [], "any"falsefalsefalse95), "datenaissance", [], "any"falsefalsefalse95)) {
  227.                     // line 96
  228.                     echo "                        ";
  229.                     $context["age"] = twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->sourcetwig_date_converter($this->env), "diff", [=> twig_date_converter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'96$this->source); })()), "user", [], "any"falsefalsefalse96), "datenaissance", [], "any"falsefalsefalse96))], "method"falsefalsefalse96), "y", [], "any"falsefalsefalse96);
  230.                     // line 97
  231.                     echo "                        <div class=\"ml-4 px-3 py-1 bg-white/20 rounded-full\">
  232.                             <span class=\"text-sm\">
  233.                                 <i class=\"fas fa-birthday-cake mr-1\"></i>
  234.                                 ";
  235.                     // line 100
  236.                     echo twig_escape_filter($this->env, (isset($context["age"]) || array_key_exists("age"$context) ? $context["age"] : (function () { throw new RuntimeError('Variable "age" does not exist.'100$this->source); })()), "html"nulltrue);
  237.                     echo " ans
  238.                             </span>
  239.                         </div>
  240.                     ";
  241.                 }
  242.                 // line 104
  243.                 echo "
  244.                     <div class=\"ml-auto\">
  245.                         <span class=\"px-3 py-1 bg-white/20 rounded-full text-sm\">";
  246.                 // line 106
  247.                 echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'106$this->source); })()), "user", [], "any"falsefalsefalse106), "email", [], "any"falsefalsefalse106), "html"nulltrue);
  248.                 echo "</span>
  249.                         <span class=\"ml-2 px-3 py-1 bg-indigo-500 rounded-full text-xs\">
  250.                             ";
  251.                 // line 108
  252.                 if ($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_ADMIN")) {
  253.                     echo "ADMIN
  254.                             ";
  255.                 } elseif ($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_ENT")) {
  256.                     // line 109
  257.                     echo "ENT
  258.                             ";
  259.                 } elseif ($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_JURY")) {
  260.                     // line 110
  261.                     echo "JURY
  262.                             ";
  263.                 } elseif ($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_CANDIDAT")) {
  264.                     // line 111
  265.                     echo "CANDIDAT
  266.                             ";
  267.                 }
  268.                 // line 113
  269.                 echo "                        </span>
  270.                     </div>
  271.                 </div>
  272.             </div>
  273.         ";
  274.             }
  275.             // line 118
  276.             echo "    ";
  277.         }
  278.         // line 119
  279.         echo "    
  280.     ";
  281.         // line 121
  282.         echo "    ";
  283.         if ((twig_get_attribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'121$this->source); })()), "user", [], "any"falsefalsefalse121) && twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'121$this->source); })()), "user", [], "any"falsefalsefalse121), "datenaissance", [], "any"falsefalsefalse121))) {
  284.             // line 122
  285.             echo "        ";
  286.             $context["age"] = twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->sourcetwig_date_converter($this->env), "diff", [=> twig_date_converter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'122$this->source); })()), "user", [], "any"falsefalsefalse122), "datenaissance", [], "any"falsefalsefalse122))], "method"falsefalsefalse122), "y", [], "any"falsefalsefalse122);
  287.             // line 123
  288.             echo "        ";
  289.             if ((((isset($context["age"]) || array_key_exists("age"$context) ? $context["age"] : (function () { throw new RuntimeError('Variable "age" does not exist.'123$this->source); })()) < 16) || ((isset($context["age"]) || array_key_exists("age"$context) ? $context["age"] : (function () { throw new RuntimeError('Variable "age" does not exist.'123$this->source); })()) > 40))) {
  290.                 // line 124
  291.                 echo "            <div class=\"mt-4 bg-red-500/20 backdrop-blur-sm border border-red-500/30 rounded-xl p-4\">
  292.                 <div class=\"flex items-center gap-3\">
  293.                     <div class=\"w-10 h-10 bg-red-500/30 rounded-full flex items-center justify-center\">
  294.                         <i class=\"fas fa-exclamation-triangle text-red-300\"></i>
  295.                     </div>
  296.                     <div>
  297.                         <p class=\"font-semibold text-white\">Âge non conforme</p>
  298.                         <p class=\"text-sm text-white/80\">
  299.                             ";
  300.                 // line 132
  301.                 if (((isset($context["age"]) || array_key_exists("age"$context) ? $context["age"] : (function () { throw new RuntimeError('Variable "age" does not exist.'132$this->source); })()) < 16)) {
  302.                     // line 133
  303.                     echo "                                Vous avez ";
  304.                     echo twig_escape_filter($this->env, (isset($context["age"]) || array_key_exists("age"$context) ? $context["age"] : (function () { throw new RuntimeError('Variable "age" does not exist.'133$this->source); })()), "html"nulltrue);
  305.                     echo " ans. L'âge minimum requis pour candidater est de 16 ans.
  306.                             ";
  307.                 } elseif ((                // line 134
  308. (isset($context["age"]) || array_key_exists("age"$context) ? $context["age"] : (function () { throw new RuntimeError('Variable "age" does not exist.'134$this->source); })()) > 40)) {
  309.                     // line 135
  310.                     echo "                                Vous avez ";
  311.                     echo twig_escape_filter($this->env, (isset($context["age"]) || array_key_exists("age"$context) ? $context["age"] : (function () { throw new RuntimeError('Variable "age" does not exist.'135$this->source); })()), "html"nulltrue);
  312.                     echo " ans. L'âge maximum autorisé pour candidater est de 40 ans.
  313.                             ";
  314.                 }
  315.                 // line 137
  316.                 echo "                        </p>
  317.                     </div>
  318.                 </div>
  319.             </div>
  320.         ";
  321.             }
  322.             // line 142
  323.             echo "    ";
  324.         }
  325.         // line 143
  326.         echo "</div>
  327. <div class=\"max-w-7xl mx-auto px-4 pb-16 ";
  328.         // line 145
  329.         echo (((isset($context["is_edit_page"]) || array_key_exists("is_edit_page"$context) ? $context["is_edit_page"] : (function () { throw new RuntimeError('Variable "is_edit_page" does not exist.'145$this->source); })())) ? ("pt-2") : (""));
  330.         echo "\">
  331.     ";
  332.         // line 146
  333.         $this->loadTemplate("partials/_flash_messages.html.twig""candidature/form.html.twig"146)->display($context);
  334.         // line 147
  335.         echo "
  336.     ";
  337.         // line 148
  338.         if ((((isset($context["is_edit_page"]) || array_key_exists("is_edit_page"$context) ? $context["is_edit_page"] : (function () { throw new RuntimeError('Variable "is_edit_page" does not exist.'148$this->source); })()) && array_key_exists("candidature"$context)) && twig_get_attribute($this->env$this->source, (isset($context["candidature"]) || array_key_exists("candidature"$context) ? $context["candidature"] : (function () { throw new RuntimeError('Variable "candidature" does not exist.'148$this->source); })()), "id", [], "any"falsefalsefalse148))) {
  339.             // line 149
  340.             echo "
  341.         ";
  342.             // line 151
  343.             echo "        <div class=\"bg-white rounded-2xl shadow-xl border border-slate-200 overflow-hidden mb-8\">
  344.             <div class=\"p-6 md:p-8\">
  345.                 <div class=\"rounded-xl border border-indigo-200 bg-indigo-50 p-4 md:p-5 mb-8\">
  346.                     <div class=\"flex flex-col md:flex-row md:items-center md:justify-between gap-2\">
  347.                         <div>
  348.                             <p class=\"text-sm font-semibold text-indigo-800 flex items-center\">
  349.                                 <i class=\"fas fa-edit mr-2\"></i> Partie 1 — Mise à jour des informations
  350.                             </p>
  351.                             <p class=\"text-sm text-indigo-700 mt-1\">Modifiez les informations du candidat, le métier et les documents.</p>
  352.                         </div>
  353.                         <span class=\"inline-flex items-center px-3 py-1 rounded-full bg-white text-indigo-700 text-sm font-semibold border border-indigo-200\">
  354.                             N° ";
  355.             // line 162
  356.             echo twig_escape_filter($this->env, ((twig_get_attribute($this->env$this->source, ($context["candidature"] ?? null), "numero", [], "any"truetruefalse162)) ? (_twig_default_filter(twig_get_attribute($this->env$this->source, ($context["candidature"] ?? null), "numero", [], "any"falsefalsefalse162), "Non attribué")) : ("Non attribué")), "html"nulltrue);
  357.             echo "
  358.                         </span>
  359.                     </div>
  360.                 </div>
  361.                 <form id=\"form-update-info\" action=\"";
  362.             // line 167
  363.             echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("app_candidature_update_info", ["id" => twig_get_attribute($this->env$this->source, (isset($context["candidature"]) || array_key_exists("candidature"$context) ? $context["candidature"] : (function () { throw new RuntimeError('Variable "candidature" does not exist.'167$this->source); })()), "id", [], "any"falsefalsefalse167)]), "html"nulltrue);
  364.             echo "\" method=\"POST\" enctype=\"multipart/form-data\" class=\"space-y-10\">
  365.                     <input type=\"hidden\" name=\"_token\" value=\"";
  366.             // line 168
  367.             echo twig_escape_filter($this->env$this->env->getRuntime('Symfony\Component\Form\FormRenderer')->renderCsrfToken(("candidature_update_info_" twig_get_attribute($this->env$this->source, (isset($context["candidature"]) || array_key_exists("candidature"$context) ? $context["candidature"] : (function () { throw new RuntimeError('Variable "candidature" does not exist.'168$this->source); })()), "id", [], "any"falsefalsefalse168))), "html"nulltrue);
  368.             echo "\">
  369.                     ";
  370.             // line 171
  371.             echo "                    ";
  372.             if (($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_ENT") || $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_ADMIN"))) {
  373.                 // line 172
  374.                 echo "                        <div class=\"rounded-xl border border-orange-200 bg-orange-50 p-5\">
  375.                             <h3 class=\"text-base font-semibold text-orange-800 mb-4 flex items-center\">
  376.                                 <div class=\"w-7 h-7 bg-orange-200 rounded-lg flex items-center justify-center mr-2\">
  377.                                     <i class=\"fas fa-user-edit text-orange-700 text-sm\"></i>
  378.                                 </div>
  379.                                 Identité du candidat
  380.                             </h3>
  381.                             <div class=\"grid grid-cols-1 md:grid-cols-2 gap-4\">
  382.                                 <div>
  383.                                     <label class=\"block text-sm font-medium text-slate-700 mb-1\">Nom <span class=\"text-red-500\">*</span></label>
  384.                                     <input type=\"text\" name=\"nom\" value=\"";
  385.                 // line 182
  386.                 ((twig_get_attribute($this->env$this->source, (isset($context["candidature"]) || array_key_exists("candidature"$context) ? $context["candidature"] : (function () { throw new RuntimeError('Variable "candidature" does not exist.'182$this->source); })()), "user", [], "any"falsefalsefalse182)) ? (print (twig_escape_filter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["candidature"]) || array_key_exists("candidature"$context) ? $context["candidature"] : (function () { throw new RuntimeError('Variable "candidature" does not exist.'182$this->source); })()), "user", [], "any"falsefalsefalse182), "nom", [], "any"falsefalsefalse182), "html"nulltrue))) : (print ("")));
  387.                 echo "\" class=\"";
  388.                 echo twig_escape_filter($this->env, (isset($context["input_class"]) || array_key_exists("input_class"$context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.'182$this->source); })()), "html"nulltrue);
  389.                 echo "\" placeholder=\"Nom de famille\">
  390.                                 </div>
  391.                                 <div>
  392.                                     <label class=\"block text-sm font-medium text-slate-700 mb-1\">Prénom(s) <span class=\"text-red-500\">*</span></label>
  393.                                     <input type=\"text\" name=\"prenoms\" value=\"";
  394.                 // line 186
  395.                 ((twig_get_attribute($this->env$this->source, (isset($context["candidature"]) || array_key_exists("candidature"$context) ? $context["candidature"] : (function () { throw new RuntimeError('Variable "candidature" does not exist.'186$this->source); })()), "user", [], "any"falsefalsefalse186)) ? (print (twig_escape_filter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["candidature"]) || array_key_exists("candidature"$context) ? $context["candidature"] : (function () { throw new RuntimeError('Variable "candidature" does not exist.'186$this->source); })()), "user", [], "any"falsefalsefalse186), "prenoms", [], "any"falsefalsefalse186), "html"nulltrue))) : (print ("")));
  396.                 echo "\" class=\"";
  397.                 echo twig_escape_filter($this->env, (isset($context["input_class"]) || array_key_exists("input_class"$context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.'186$this->source); })()), "html"nulltrue);
  398.                 echo "\" placeholder=\"Prénom(s)\">
  399.                                 </div>
  400.                                 <div class=\"md:col-span-2\">
  401.                                     <label class=\"block text-sm font-medium text-slate-700 mb-1\">Contact (téléphone)</label>
  402.                                     <input type=\"text\" name=\"contact\" value=\"";
  403.                 // line 190
  404.                 ((twig_get_attribute($this->env$this->source, (isset($context["candidature"]) || array_key_exists("candidature"$context) ? $context["candidature"] : (function () { throw new RuntimeError('Variable "candidature" does not exist.'190$this->source); })()), "user", [], "any"falsefalsefalse190)) ? (print (twig_escape_filter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["candidature"]) || array_key_exists("candidature"$context) ? $context["candidature"] : (function () { throw new RuntimeError('Variable "candidature" does not exist.'190$this->source); })()), "user", [], "any"falsefalsefalse190), "contact", [], "any"falsefalsefalse190), "html"nulltrue))) : (print ("")));
  405.                 echo "\" class=\"";
  406.                 echo twig_escape_filter($this->env, (isset($context["input_class"]) || array_key_exists("input_class"$context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.'190$this->source); })()), "html"nulltrue);
  407.                 echo "\" placeholder=\"Ex: 0102030405\">
  408.                                 </div>
  409.                             </div>
  410.                         </div>
  411.                     ";
  412.             }
  413.             // line 195
  414.             echo "
  415.                     ";
  416.             // line 197
  417.             echo "                    <h3 class=\"text-lg font-semibold text-indigo-800 flex items-center border-b pb-3 mb-5\">
  418.                         <div class=\"w-8 h-8 bg-indigo-200 rounded-lg flex items-center justify-center mr-3\">
  419.                             <i class=\"fas fa-graduation-cap text-indigo-700\"></i>
  420.                         </div>
  421.                         Formation souhaitée
  422.                     </h3>
  423.                     <div class=\"grid grid-cols-1 md:grid-cols-2 gap-6\">
  424.                         <div>
  425.                             <label class=\"block text-sm font-medium text-slate-700 mb-1\">Établissement <span class=\"text-red-500\">*</span></label>
  426.                             <div class=\"";
  427.             // line 207
  428.             echo twig_escape_filter($this->env, (isset($context["input_class"]) || array_key_exists("input_class"$context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.'207$this->source); })()), "html"nulltrue);
  429.             echo " bg-slate-100 text-slate-600 cursor-default flex items-center gap-2\">
  430.                                 <i class=\"fas fa-lock text-slate-400 text-xs\"></i>
  431.                                 ";
  432.             // line 209
  433.             ((twig_get_attribute($this->env$this->source, (isset($context["candidature"]) || array_key_exists("candidature"$context) ? $context["candidature"] : (function () { throw new RuntimeError('Variable "candidature" does not exist.'209$this->source); })()), "etablissement", [], "any"falsefalsefalse209)) ? (print (twig_escape_filter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["candidature"]) || array_key_exists("candidature"$context) ? $context["candidature"] : (function () { throw new RuntimeError('Variable "candidature" does not exist.'209$this->source); })()), "etablissement", [], "any"falsefalsefalse209), "nom", [], "any"falsefalsefalse209), "html"nulltrue))) : (print ("Non renseigné")));
  434.             echo "
  435.                             </div>
  436.                             <input type=\"hidden\" id=\"candidature_etablissement\" value=\"";
  437.             // line 211
  438.             ((twig_get_attribute($this->env$this->source, (isset($context["candidature"]) || array_key_exists("candidature"$context) ? $context["candidature"] : (function () { throw new RuntimeError('Variable "candidature" does not exist.'211$this->source); })()), "etablissement", [], "any"falsefalsefalse211)) ? (print (twig_escape_filter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["candidature"]) || array_key_exists("candidature"$context) ? $context["candidature"] : (function () { throw new RuntimeError('Variable "candidature" does not exist.'211$this->source); })()), "etablissement", [], "any"falsefalsefalse211), "id", [], "any"falsefalsefalse211), "html"nulltrue))) : (print ("")));
  439.             echo "\">
  440.                         </div>
  441.                         <div>
  442.                             <label class=\"block text-sm font-medium text-slate-700 mb-1\">Métier <span class=\"text-red-500\">*</span></label>
  443.                             <select name=\"metier_id\" id=\"candidature_metier\" required class=\"";
  444.             // line 215
  445.             echo twig_escape_filter($this->env, (isset($context["input_class"]) || array_key_exists("input_class"$context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.'215$this->source); })()), "html"nulltrue);
  446.             echo "\">
  447.                                 ";
  448.             // line 216
  449.             if (twig_get_attribute($this->env$this->source, (isset($context["candidature"]) || array_key_exists("candidature"$context) ? $context["candidature"] : (function () { throw new RuntimeError('Variable "candidature" does not exist.'216$this->source); })()), "metier", [], "any"falsefalsefalse216)) {
  450.                 // line 217
  451.                 echo "                                    <option value=\"";
  452.                 echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["candidature"]) || array_key_exists("candidature"$context) ? $context["candidature"] : (function () { throw new RuntimeError('Variable "candidature" does not exist.'217$this->source); })()), "metier", [], "any"falsefalsefalse217), "id", [], "any"falsefalsefalse217), "html"nulltrue);
  453.                 echo "\" selected>";
  454.                 echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["candidature"]) || array_key_exists("candidature"$context) ? $context["candidature"] : (function () { throw new RuntimeError('Variable "candidature" does not exist.'217$this->source); })()), "metier", [], "any"falsefalsefalse217), "nom", [], "any"falsefalsefalse217), "html"nulltrue);
  455.                 echo "</option>
  456.                                 ";
  457.             } else {
  458.                 // line 219
  459.                 echo "                                    <option value=\"\">-- Sélectionnez un métier --</option>
  460.                                 ";
  461.             }
  462.             // line 221
  463.             echo "                            </select>
  464.                             <div id=\"metier-loading\" class=\"hidden text-sm text-indigo-600 mt-1\">
  465.                                 <i class=\"fas fa-spinner fa-spin mr-1\"></i> Chargement...
  466.                             </div>
  467.                         </div>
  468.                     </div>
  469.                     ";
  470.             // line 229
  471.             echo "                    <div id=\"metier-info\" class=\"hidden mt-6\">
  472.                         <div class=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-3\">
  473.                             <div class=\"flex items-center gap-3 p-2 bg-indigo-100 rounded-lg\">
  474.                                 <i class=\"fas fa-building text-indigo-600\"></i>
  475.                                 <div>
  476.                                     <p class=\"text-xs text-indigo-600\">Secteur</p>
  477.                                     <p id=\"metier-secteur\" class=\"text-sm font-medium\">-</p>
  478.                                 </div>
  479.                             </div>
  480.                             <div class=\"flex items-center gap-3 p-2 bg-purple-100 rounded-lg\">
  481.                                 <i class=\"fas fa-users text-purple-600\"></i>
  482.                                 <div>
  483.                                     <p class=\"text-xs text-purple-600\">Places</p>
  484.                                     <p id=\"metier-nbrplace\" class=\"text-sm font-medium\">-</p>
  485.                                 </div>
  486.                             </div>
  487.                             <div class=\"flex items-center gap-3 p-2 bg-green-100 rounded-lg\">
  488.                                 <i class=\"fas fa-graduation-cap text-green-600\"></i>
  489.                                 <div>
  490.                                     <p class=\"text-xs text-green-600\">Niveau</p>
  491.                                     <p id=\"metier-niveau\" class=\"text-sm font-medium\">-</p>
  492.                                 </div>
  493.                             </div>
  494.                             <div class=\"flex items-center gap-3 p-2 bg-amber-100 rounded-lg\">
  495.                                 <i class=\"fas fa-clock text-amber-600\"></i>
  496.                                 <div>
  497.                                     <p class=\"text-xs text-amber-600\">Durée</p>
  498.                                     <p id=\"metier-duree\" class=\"text-sm font-medium\">-</p>
  499.                                 </div>
  500.                             </div>
  501.                         </div>
  502.                     </div>
  503.                     ";
  504.             // line 263
  505.             echo "                    <h3 class=\"text-lg font-semibold text-purple-800 mb-5 flex items-center border-b pb-3\">
  506.                         <div class=\"w-8 h-8 bg-purple-200 rounded-lg flex items-center justify-center mr-3\">
  507.                             <i class=\"fas fa-cloud-upload-alt text-purple-700\"></i>
  508.                         </div>
  509.                         Documents à télécharger <span class=\"text-red-500\"> *</span>
  510.                     </h3>
  511.                     ";
  512.             // line 270
  513.             $this->loadTemplate("partials/_document_upload_plain.html.twig""candidature/form.html.twig"270)->display(twig_array_merge($context, ["candidature" =>             // line 271
  514. (isset($context["candidature"]) || array_key_exists("candidature"$context) ? $context["candidature"] : (function () { throw new RuntimeError('Variable "candidature" does not exist.'271$this->source); })()), "document_labels" =>             // line 272
  515. (isset($context["document_labels"]) || array_key_exists("document_labels"$context) ? $context["document_labels"] : (function () { throw new RuntimeError('Variable "document_labels" does not exist.'272$this->source); })()), "input_class" =>             // line 273
  516. (isset($context["input_class"]) || array_key_exists("input_class"$context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.'273$this->source); })())]));
  517.             // line 275
  518.             echo "
  519.                     ";
  520.             // line 277
  521.             echo "                    <div class=\"flex flex-col md:flex-row justify-between items-center gap-4 pt-6 border-t border-slate-200\">
  522.                         <div class=\"text-sm text-slate-500\">
  523.                             <i class=\"fas fa-info-circle mr-1\"></i>
  524.                             Les champs marqués d'une <span class=\"text-red-500\">*</span> sont obligatoires
  525.                         </div>
  526.                         <button type=\"submit\" class=\"px-8 py-2 bg-gradient-to-r from-indigo-600 to-purple-600 text-white font-semibold rounded-lg hover:from-indigo-700 hover:to-purple-700 transition transform hover:scale-105 shadow-lg flex items-center\">
  527.                             <i class=\"fas fa-save mr-2\"></i>
  528.                             Mise à jour
  529.                         </button>
  530.                     </div>
  531.                 </form>
  532.             </div>
  533.         </div>
  534.         ";
  535.             // line 292
  536.             echo "        <div class=\"bg-white rounded-2xl shadow-xl border border-slate-200 overflow-hidden\">
  537.             <div class=\"p-6 md:p-8\">
  538.                 ";
  539.             // line 294
  540.             echo             $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.'294$this->source); })()), 'form_start', ["attr" => ["class" => "space-y-10""id" => "candidature-form"]]);
  541.             echo "
  542.                     <div class=\"rounded-xl border border-amber-200 bg-amber-50 p-4 md:p-5 mb-4\">
  543.                         <p class=\"text-sm font-semibold text-amber-800 flex items-center\">
  544.                             <i class=\"fas fa-clipboard-list mr-2\"></i>
  545.                             Partie 2 — Analyse du dossier
  546.                         </p>
  547.                         <p class=\"text-sm text-amber-700 mt-1\">Étudiez le dossier, évaluez le candidat et enregistrez le résultat.</p>
  548.                     </div>
  549.                     ";
  550.             // line 304
  551.             $this->loadTemplate("partials/_candidature_evaluation_sections.html.twig""candidature/form.html.twig"304)->display($context);
  552.             // line 305
  553.             echo "
  554.                     <div class=\"flex flex-col md:flex-row justify-between items-center gap-4 pt-6 border-t border-slate-200\">
  555.                         <div class=\"text-sm text-slate-500\">
  556.                             <i class=\"fas fa-info-circle mr-1\"></i>
  557.                             Les champs marqués d'une <span class=\"text-red-500\">*</span> sont obligatoires
  558.                         </div>
  559.                         <button type=\"submit\" class=\"px-8 py-2 bg-gradient-to-r from-indigo-600 to-purple-600 text-white font-semibold rounded-lg hover:from-indigo-700 hover:to-purple-700 transition transform hover:scale-105 shadow-lg flex items-center\">
  560.                             <i class=\"fas fa-paper-plane mr-2\"></i>
  561.                             Enregistrer l'évaluation
  562.                         </button>
  563.                     </div>
  564.                 ";
  565.             // line 317
  566.             echo             $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.'317$this->source); })()), 'form_end');
  567.             echo "
  568.             </div>
  569.         </div>
  570.     ";
  571.         } else {
  572.             // line 322
  573.             echo "
  574.     <div class=\"bg-white rounded-2xl shadow-xl border border-slate-200 overflow-hidden\">
  575.         <div class=\"p-6 md:p-8\">
  576.             ";
  577.             // line 325
  578.             echo             $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.'325$this->source); })()), 'form_start', ["attr" => ["class" => "space-y-10""enctype" => "multipart/form-data""id" => "candidature-form"]]);
  579.             echo "
  580.             ";
  581.             // line 327
  582.             if (((isset($context["is_edit_page"]) || array_key_exists("is_edit_page"$context) ? $context["is_edit_page"] : (function () { throw new RuntimeError('Variable "is_edit_page" does not exist.'327$this->source); })()) && array_key_exists("candidature"$context))) {
  583.                 // line 328
  584.                 echo "                <div class=\"rounded-xl border border-indigo-200 bg-indigo-50 p-4 md:p-5\">
  585.                     <div class=\"flex flex-col md:flex-row md:items-center md:justify-between gap-2\">
  586.                         <div>
  587.                             <p class=\"text-sm font-semibold text-indigo-800\">Edition de candidature</p>
  588.                             <p class=\"text-sm text-indigo-700 mt-1\">Verifiez les informations puis mettez a jour les documents si necessaire.</p>
  589.                         </div>
  590.                         <span class=\"inline-flex items-center px-3 py-1 rounded-full bg-white text-indigo-700 text-sm font-semibold border border-indigo-200\">
  591.                             N° ";
  592.                 // line 335
  593.                 echo twig_escape_filter($this->env, ((twig_get_attribute($this->env$this->source, ($context["candidature"] ?? null), "numero", [], "any"truetruefalse335)) ? (_twig_default_filter(twig_get_attribute($this->env$this->source, ($context["candidature"] ?? null), "numero", [], "any"falsefalsefalse335), "Non attribue")) : ("Non attribue")), "html"nulltrue);
  594.                 echo "
  595.                         </span>
  596.                     </div>
  597.                 </div>
  598.             ";
  599.             }
  600.             // line 340
  601.             echo "
  602.             ";
  603.             // line 342
  604.             echo "            ";
  605.             if ((((isset($context["is_edit_page"]) || array_key_exists("is_edit_page"$context) ? $context["is_edit_page"] : (function () { throw new RuntimeError('Variable "is_edit_page" does not exist.'342$this->source); })()) && ($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_ENT") || $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_ADMIN"))) && twig_get_attribute($this->env$this->source, ($context["form"] ?? null), "nom", [], "any"truetruefalse342))) {
  606.                 // line 343
  607.                 echo "                <div class=\"rounded-xl border border-orange-200 bg-orange-50 p-5\">
  608.                     <h3 class=\"text-base font-semibold text-orange-800 mb-4 flex items-center\">
  609.                         <div class=\"w-7 h-7 bg-orange-200 rounded-lg flex items-center justify-center mr-2\">
  610.                             <i class=\"fas fa-user-edit text-orange-700 text-sm\"></i>
  611.                         </div>
  612.                         Identité du candidat
  613.                     </h3>
  614.                     <div class=\"grid grid-cols-1 md:grid-cols-2 gap-4\">
  615.                         <div>
  616.                             <label class=\"block text-sm font-medium text-slate-700 mb-1\">
  617.                                 Nom <span class=\"text-red-500\">*</span>
  618.                             </label>
  619.                             ";
  620.                 // line 355
  621.                 echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env$this->source, (isset($context["form"]) || array_key_exists("form"$context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.'355$this->source); })()), "nom", [], "any"falsefalsefalse355), 'widget', ["attr" => ["class" => (isset($context["input_class"]) || array_key_exists("input_class"$context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.'355$this->source); })()), "placeholder" => "Nom de famille"]]);
  622.                 echo "
  623.                         </div>
  624.                         <div>
  625.                             <label class=\"block text-sm font-medium text-slate-700 mb-1\">
  626.                                 Prénom(s) <span class=\"text-red-500\">*</span>
  627.                             </label>
  628.                             ";
  629.                 // line 361
  630.                 echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env$this->source, (isset($context["form"]) || array_key_exists("form"$context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.'361$this->source); })()), "prenoms", [], "any"falsefalsefalse361), 'widget', ["attr" => ["class" => (isset($context["input_class"]) || array_key_exists("input_class"$context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.'361$this->source); })()), "placeholder" => "Prénom(s)"]]);
  631.                 echo "
  632.                         </div>
  633.                     </div>
  634.                 </div>
  635.             ";
  636.             }
  637.             // line 366
  638.             echo "
  639.             <!-- SECTION 1: TOUS LES UTILISATEURS - Formation souhaitée -->
  640.             <h3 class=\"text-lg font-semibold text-indigo-800 flex items-center border-b pb-3 mb-5\">
  641.                 <div class=\"w-8 h-8 bg-indigo-200 rounded-lg flex items-center justify-center mr-3\">
  642.                     <i class=\"fas fa-graduation-cap text-indigo-700\"></i>
  643.                 </div>
  644.                 Formation souhaitée
  645.             </h3>
  646.             
  647.             <div class=\"grid grid-cols-1 md:grid-cols-2 gap-6\">
  648.                 <div>
  649.                     <label class=\"block text-sm font-medium text-slate-700 mb-1\">
  650.                         Établissement <span class=\"text-red-500\">*</span>
  651.                     </label>
  652.                     ";
  653.             // line 380
  654.             if ((((isset($context["is_edit_page"]) || array_key_exists("is_edit_page"$context) ? $context["is_edit_page"] : (function () { throw new RuntimeError('Variable "is_edit_page" does not exist.'380$this->source); })()) && array_key_exists("candidature"$context)) && twig_get_attribute($this->env$this->source, (isset($context["candidature"]) || array_key_exists("candidature"$context) ? $context["candidature"] : (function () { throw new RuntimeError('Variable "candidature" does not exist.'380$this->source); })()), "etablissement", [], "any"falsefalsefalse380))) {
  655.                 // line 381
  656.                 echo "                        ";
  657.                 // line 382
  658.                 echo "                        <div class=\"";
  659.                 echo twig_escape_filter($this->env, (isset($context["input_class"]) || array_key_exists("input_class"$context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.'382$this->source); })()), "html"nulltrue);
  660.                 echo " bg-slate-100 text-slate-600 cursor-default flex items-center gap-2\">
  661.                             <i class=\"fas fa-lock text-slate-400 text-xs\"></i>
  662.                             ";
  663.                 // line 384
  664.                 echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["candidature"]) || array_key_exists("candidature"$context) ? $context["candidature"] : (function () { throw new RuntimeError('Variable "candidature" does not exist.'384$this->source); })()), "etablissement", [], "any"falsefalsefalse384), "nom", [], "any"falsefalsefalse384), "html"nulltrue);
  665.                 echo "
  666.                         </div>
  667.                         ";
  668.                 // line 387
  669.                 echo "                        ";
  670.                 echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env$this->source, (isset($context["form"]) || array_key_exists("form"$context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.'387$this->source); })()), "etablissement", [], "any"falsefalsefalse387), 'widget', ["attr" => ["class" => "hidden""id" => "candidature_etablissement"]]);
  671.                 echo "
  672.                     ";
  673.             } else {
  674.                 // line 389
  675.                 echo "                        ";
  676.                 echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env$this->source, (isset($context["form"]) || array_key_exists("form"$context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.'389$this->source); })()), "etablissement", [], "any"falsefalsefalse389), 'widget', ["attr" => ["class" => (isset($context["input_class"]) || array_key_exists("input_class"$context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.'389$this->source); })()), "id" => "candidature_etablissement"]]);
  677.                 echo "
  678.                     ";
  679.             }
  680.             // line 391
  681.             echo "                    <div id=\"etablissement-loading\" class=\"hidden text-sm text-indigo-600 mt-1\">
  682.                         <i class=\"fas fa-spinner fa-spin mr-1\"></i> Chargement...
  683.                     </div>
  684.                 </div>
  685.                 
  686.                 <div>
  687.                     <label class=\"block text-sm font-medium text-slate-700 mb-1\">
  688.                         Métier <span class=\"text-red-500\">*</span>
  689.                     </label>
  690.                     ";
  691.             // line 400
  692.             echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env$this->source, (isset($context["form"]) || array_key_exists("form"$context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.'400$this->source); })()), "metier", [], "any"falsefalsefalse400), 'widget', ["attr" => ["class" => (isset($context["input_class"]) || array_key_exists("input_class"$context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.'400$this->source); })()), "id" => "candidature_metier"]]);
  693.             echo "
  694.                     <div id=\"metier-loading\" class=\"hidden text-sm text-indigo-600 mt-1\">
  695.                         <i class=\"fas fa-spinner fa-spin mr-1\"></i> Chargement...
  696.                     </div>
  697.                 </div>
  698.             </div>
  699.             <!-- Informations détaillées du métier -->
  700.             <div id=\"metier-info\" class=\"hidden mt-6\">
  701.                 <div class=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-3\">
  702.                     <div class=\"flex items-center gap-3 p-2 bg-indigo-100 rounded-lg\">
  703.                         <i class=\"fas fa-building text-indigo-600\"></i>
  704.                         <div>
  705.                             <p class=\"text-xs text-indigo-600\">Secteur</p>
  706.                             <p id=\"metier-secteur\" class=\"text-sm font-medium\">-</p>
  707.                         </div>
  708.                     </div>
  709.                     <div class=\"flex items-center gap-3 p-2 bg-purple-100 rounded-lg\">
  710.                         <i class=\"fas fa-users text-purple-600\"></i>
  711.                         <div>
  712.                             <p class=\"text-xs text-purple-600\">Places</p>
  713.                             <p id=\"metier-nbrplace\" class=\"text-sm font-medium\">-</p>
  714.                         </div>
  715.                     </div>
  716.                     <div class=\"flex items-center gap-3 p-2 bg-green-100 rounded-lg\">
  717.                         <i class=\"fas fa-graduation-cap text-green-600\"></i>
  718.                         <div>
  719.                             <p class=\"text-xs text-green-600\">Niveau</p>
  720.                             <p id=\"metier-niveau\" class=\"text-sm font-medium\">-</p>
  721.                         </div>
  722.                     </div>
  723.                     <div class=\"flex items-center gap-3 p-2 bg-amber-100 rounded-lg\">
  724.                         <i class=\"fas fa-clock text-amber-600\"></i>
  725.                         <div>
  726.                             <p class=\"text-xs text-amber-600\">Durée</p>
  727.                             <p id=\"metier-duree\" class=\"text-sm font-medium\">-</p>
  728.                         </div>
  729.                     </div>
  730.                 </div>
  731.             </div>
  732.             <!-- SECTION 2: DOCUMENTS -->
  733.             <h3 class=\"text-lg font-semibold text-purple-800 mb-5 flex items-center border-b pb-3\">
  734.                 <div class=\"w-8 h-8 bg-purple-200 rounded-lg flex items-center justify-center mr-3\">
  735.                     <i class=\"fas fa-cloud-upload-alt text-purple-700\"></i>
  736.                 </div>
  737.                 Documents à télécharger <span class=\"text-red-500\"> *</span>
  738.             </h3>
  739.             
  740.             ";
  741.             // line 449
  742.             $this->loadTemplate("partials/_document_upload.html.twig""candidature/form.html.twig"449)->display(twig_array_merge($context, ["form" =>             // line 450
  743. (isset($context["form"]) || array_key_exists("form"$context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.'450$this->source); })()), "document_labels" =>             // line 451
  744. (isset($context["document_labels"]) || array_key_exists("document_labels"$context) ? $context["document_labels"] : (function () { throw new RuntimeError('Variable "document_labels" does not exist.'451$this->source); })()), "input_class" =>             // line 452
  745. (isset($context["input_class"]) || array_key_exists("input_class"$context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.'452$this->source); })())]));
  746.             // line 454
  747.             echo "
  748.             <!-- SECTION 3: POUR ENT ET ADMIN - Étude de dossier -->
  749.             ";
  750.             // line 456
  751.             if (($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_ENT") || $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_ADMIN"))) {
  752.                 // line 457
  753.                 echo "                <h3 class=\"text-lg font-semibold text-amber-800 mb-5 flex items-center border-b pb-3\">
  754.                     <div class=\"w-8 h-8 bg-amber-200 rounded-lg flex items-center justify-center mr-3\">
  755.                         <i class=\"fas fa-clipboard-check text-amber-700\"></i>
  756.                     </div>
  757.                     Étude de dossier (ENT)
  758.                 </h3>
  759.                 
  760.                 <div class=\"grid grid-cols-1 md:grid-cols-2 gap-4\">
  761.                     <div>
  762.                         <label class=\"block text-sm font-medium text-slate-700 mb-1\">Statut dossier</label>
  763.                         ";
  764.                 // line 467
  765.                 echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env$this->source, (isset($context["form"]) || array_key_exists("form"$context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.'467$this->source); })()), "etustatut", [], "any"falsefalsefalse467), 'widget', ["attr" => ["class" => (isset($context["input_class"]) || array_key_exists("input_class"$context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.'467$this->source); })())]]);
  766.                 echo "
  767.                     </div>
  768.                     <div>
  769.                         <label class=\"block text-sm font-medium text-slate-700 mb-1\">Commentaire</label>
  770.                         ";
  771.                 // line 471
  772.                 echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env$this->source, (isset($context["form"]) || array_key_exists("form"$context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.'471$this->source); })()), "etucom", [], "any"falsefalsefalse471), 'widget', ["attr" => ["class" => (isset($context["input_class"]) || array_key_exists("input_class"$context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.'471$this->source); })()), "placeholder" => "Commentaire sur le dossier..."]]);
  773.                 echo "
  774.                     </div>
  775.                 </div>
  776.             ";
  777.             }
  778.             // line 475
  779.             echo "
  780.             <!-- SECTION 4: POUR JURY ET ADMIN - Évaluation entretien -->
  781.             ";
  782.             // line 477
  783.             if (($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_JURY") || $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_ADMIN"))) {
  784.                 // line 478
  785.                 echo "                <h3 class=\"text-lg font-semibold text-blue-800 mb-5 flex items-center border-b pb-3\">
  786.                     <div class=\"w-8 h-8 bg-blue-200 rounded-lg flex items-center justify-center mr-3\">
  787.                         <i class=\"fas fa-microphone-alt text-blue-700\"></i>
  788.                     </div>
  789.                     Évaluation entretien (Jury)
  790.                 </h3>
  791.                 
  792.                 <div class=\"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4\">
  793.                     <div>
  794.                         <label class=\"block text-sm font-medium text-slate-700 mb-1\">Date entretien</label>
  795.                         ";
  796.                 // line 488
  797.                 echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env$this->source, (isset($context["form"]) || array_key_exists("form"$context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.'488$this->source); })()), "entdate", [], "any"falsefalsefalse488), 'widget', ["attr" => ["class" => (isset($context["input_class"]) || array_key_exists("input_class"$context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.'488$this->source); })())]]);
  798.                 echo "
  799.                     </div>
  800.                     <div>
  801.                         <label class=\"block text-sm font-medium text-slate-700 mb-1\">Lieu entretien</label>
  802.                         ";
  803.                 // line 492
  804.                 echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env$this->source, (isset($context["form"]) || array_key_exists("form"$context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.'492$this->source); })()), "entlieu", [], "any"falsefalsefalse492), 'widget', ["attr" => ["class" => (isset($context["input_class"]) || array_key_exists("input_class"$context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.'492$this->source); })()), "placeholder" => "Ex: Salle 101"]]);
  805.                 echo "
  806.                     </div>
  807.                 </div>
  808.                 <div class=\"grid grid-cols-1 md:grid-cols-3 gap-4 mb-4\">
  809.                     <div>
  810.                         <label class=\"block text-sm font-medium text-slate-700 mb-1\">Jury n°</label>
  811.                         ";
  812.                 // line 499
  813.                 echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env$this->source, (isset($context["form"]) || array_key_exists("form"$context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.'499$this->source); })()), "jury", [], "any"falsefalsefalse499), 'widget', ["attr" => ["class" => (isset($context["input_class"]) || array_key_exists("input_class"$context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.'499$this->source); })()), "min" => 1"max" => 20]]);
  814.                 echo "
  815.                     </div>
  816.                     <div>
  817.                         <label class=\"block text-sm font-medium text-slate-700 mb-1\">Vague</label>
  818.                         ";
  819.                 // line 503
  820.                 echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env$this->source, (isset($context["form"]) || array_key_exists("form"$context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.'503$this->source); })()), "vague", [], "any"falsefalsefalse503), 'widget', ["attr" => ["class" => (isset($context["input_class"]) || array_key_exists("input_class"$context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.'503$this->source); })()), "min" => 1]]);
  821.                 echo "
  822.                     </div>
  823.                     <div>
  824.                         <label class=\"block text-sm font-medium text-slate-700 mb-1\">Décision jury</label>
  825.                         ";
  826.                 // line 507
  827.                 echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env$this->source, (isset($context["form"]) || array_key_exists("form"$context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.'507$this->source); })()), "entstatut", [], "any"falsefalsefalse507), 'widget', ["attr" => ["class" => (isset($context["input_class"]) || array_key_exists("input_class"$context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.'507$this->source); })())]]);
  828.                 echo "
  829.                     </div>
  830.                 </div>
  831.                 <div class=\"mt-4\">
  832.                     <label class=\"block text-sm font-medium text-slate-700 mb-1\">Commentaire entretien</label>
  833.                     ";
  834.                 // line 513
  835.                 echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env$this->source, (isset($context["form"]) || array_key_exists("form"$context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.'513$this->source); })()), "entcom", [], "any"falsefalsefalse513), 'widget', ["attr" => ["class" => (isset($context["input_class"]) || array_key_exists("input_class"$context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.'513$this->source); })()), "rows" => 3"placeholder" => "Observations sur l'entretien..."]]);
  836.                 echo "
  837.                 </div>
  838.             ";
  839.             }
  840.             // line 516
  841.             echo "
  842.             <!-- SECTION 4bis: GRILLE D'ÉVALUATION DYNAMIQUE -->
  843.             ";
  844.             // line 518
  845.             if ((((($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_ENT") || $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_ADMIN")) || $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_JURY")) && array_key_exists("candidature"$context)) && twig_get_attribute($this->env$this->source, (isset($context["candidature"]) || array_key_exists("candidature"$context) ? $context["candidature"] : (function () { throw new RuntimeError('Variable "candidature" does not exist.'518$this->source); })()), "id", [], "any"falsefalsefalse518))) {
  846.                 // line 519
  847.                 echo "                <div id=\"evaluation-section\">
  848.                     <h3 class=\"text-lg font-semibold text-indigo-800 mb-5 flex items-center border-b pb-3\">
  849.                         <div class=\"w-8 h-8 bg-indigo-200 rounded-lg flex items-center justify-center mr-3\">
  850.                             <i class=\"fas fa-clipboard-check text-indigo-700\"></i>
  851.                         </div>
  852.                         Évaluation de l'entretien
  853.                     </h3>
  854.                     ";
  855.                 // line 527
  856.                 if ($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_ENT")) {
  857.                     // line 528
  858.                     echo "                        <div class=\"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4\">
  859.                             <div>
  860.                                 <label class=\"block text-sm font-medium text-slate-700 mb-1\">Date entretien</label>
  861.                                 ";
  862.                     // line 531
  863.                     echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env$this->source, (isset($context["form"]) || array_key_exists("form"$context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.'531$this->source); })()), "entdate", [], "any"falsefalsefalse531), 'widget', ["attr" => ["class" => (isset($context["input_class"]) || array_key_exists("input_class"$context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.'531$this->source); })())]]);
  864.                     echo "
  865.                             </div>
  866.                             <div>
  867.                                 <label class=\"block text-sm font-medium text-slate-700 mb-1\">Lieu entretien</label>
  868.                                 ";
  869.                     // line 535
  870.                     echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env$this->source, (isset($context["form"]) || array_key_exists("form"$context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.'535$this->source); })()), "entlieu", [], "any"falsefalsefalse535), 'widget', ["attr" => ["class" => (isset($context["input_class"]) || array_key_exists("input_class"$context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.'535$this->source); })()), "placeholder" => "Ex: Salle 101"]]);
  871.                     echo "
  872.                             </div>
  873.                         </div>
  874.                         <div class=\"grid grid-cols-1 md:grid-cols-3 gap-4 mb-4\">
  875.                             <div>
  876.                                 <label class=\"block text-sm font-medium text-slate-700 mb-1\">Numéro du jury</label>
  877.                                 ";
  878.                     // line 542
  879.                     echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env$this->source, (isset($context["form"]) || array_key_exists("form"$context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.'542$this->source); })()), "jury", [], "any"falsefalsefalse542), 'widget', ["attr" => ["class" => (isset($context["input_class"]) || array_key_exists("input_class"$context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.'542$this->source); })()), "min" => 1"max" => 20]]);
  880.                     echo "
  881.                             </div>
  882.                             <div>
  883.                                 <label class=\"block text-sm font-medium text-slate-700 mb-1\">Vague</label>
  884.                                 ";
  885.                     // line 546
  886.                     echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env$this->source, (isset($context["form"]) || array_key_exists("form"$context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.'546$this->source); })()), "vague", [], "any"falsefalsefalse546), 'widget', ["attr" => ["class" => (isset($context["input_class"]) || array_key_exists("input_class"$context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.'546$this->source); })()), "min" => 1]]);
  887.                     echo "
  888.                             </div>
  889.                             <div>
  890.                                 <label class=\"block text-sm font-medium text-slate-700 mb-1\">Décision du jury</label>
  891.                                 ";
  892.                     // line 550
  893.                     echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env$this->source, (isset($context["form"]) || array_key_exists("form"$context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.'550$this->source); })()), "entstatut", [], "any"falsefalsefalse550), 'widget', ["attr" => ["class" => (isset($context["input_class"]) || array_key_exists("input_class"$context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.'550$this->source); })())]]);
  894.                     echo "
  895.                             </div>
  896.                         </div>
  897.                         <div class=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 mb-4\">
  898.                             <div>
  899.                                 <label class=\"block text-sm font-medium text-slate-700 mb-1\">Note 1</label>
  900.                                 ";
  901.                     // line 557
  902.                     echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env$this->source, (isset($context["form"]) || array_key_exists("form"$context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.'557$this->source); })()), "note1", [], "any"falsefalsefalse557), 'widget', ["attr" => ["class" => (isset($context["input_class"]) || array_key_exists("input_class"$context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.'557$this->source); })()), "min" => 0"max" => 20"step" => 0.5]]);
  903.                     echo "
  904.                             </div>
  905.                             <div>
  906.                                 <label class=\"block text-sm font-medium text-slate-700 mb-1\">Note 2</label>
  907.                                 ";
  908.                     // line 561
  909.                     echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env$this->source, (isset($context["form"]) || array_key_exists("form"$context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.'561$this->source); })()), "note2", [], "any"falsefalsefalse561), 'widget', ["attr" => ["class" => (isset($context["input_class"]) || array_key_exists("input_class"$context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.'561$this->source); })()), "min" => 0"max" => 20"step" => 0.5]]);
  910.                     echo "
  911.                             </div>
  912.                             <div>
  913.                                 <label class=\"block text-sm font-medium text-slate-700 mb-1\">Note 3</label>
  914.                                 ";
  915.                     // line 565
  916.                     echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env$this->source, (isset($context["form"]) || array_key_exists("form"$context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.'565$this->source); })()), "note3", [], "any"falsefalsefalse565), 'widget', ["attr" => ["class" => (isset($context["input_class"]) || array_key_exists("input_class"$context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.'565$this->source); })()), "min" => 0"max" => 20"step" => 0.5]]);
  917.                     echo "
  918.                             </div>
  919.                             <div>
  920.                                 <label class=\"block text-sm font-medium text-slate-700 mb-1\">Note 4</label>
  921.                                 ";
  922.                     // line 569
  923.                     echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env$this->source, (isset($context["form"]) || array_key_exists("form"$context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.'569$this->source); })()), "note4", [], "any"falsefalsefalse569), 'widget', ["attr" => ["class" => (isset($context["input_class"]) || array_key_exists("input_class"$context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.'569$this->source); })()), "min" => 0"max" => 20"step" => 0.5]]);
  924.                     echo "
  925.                             </div>
  926.                             <div>
  927.                                 <label class=\"block text-sm font-medium text-slate-700 mb-1\">Note 5</label>
  928.                                 ";
  929.                     // line 573
  930.                     echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env$this->source, (isset($context["form"]) || array_key_exists("form"$context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.'573$this->source); })()), "note5", [], "any"falsefalsefalse573), 'widget', ["attr" => ["class" => (isset($context["input_class"]) || array_key_exists("input_class"$context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.'573$this->source); })()), "min" => 0"max" => 20"step" => 0.5]]);
  931.                     echo "
  932.                             </div>
  933.                             <div>
  934.                                 <label class=\"block text-sm font-medium text-slate-700 mb-1\">Note 6</label>
  935.                                 ";
  936.                     // line 577
  937.                     echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env$this->source, (isset($context["form"]) || array_key_exists("form"$context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.'577$this->source); })()), "note6", [], "any"falsefalsefalse577), 'widget', ["attr" => ["class" => (isset($context["input_class"]) || array_key_exists("input_class"$context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.'577$this->source); })()), "min" => 0"max" => 20"step" => 0.5]]);
  938.                     echo "
  939.                             </div>
  940.                             <div>
  941.                                 <label class=\"block text-sm font-medium text-slate-700 mb-1\">Note 7</label>
  942.                                 ";
  943.                     // line 581
  944.                     echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env$this->source, (isset($context["form"]) || array_key_exists("form"$context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.'581$this->source); })()), "note7", [], "any"falsefalsefalse581), 'widget', ["attr" => ["class" => (isset($context["input_class"]) || array_key_exists("input_class"$context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.'581$this->source); })()), "min" => 0"max" => 20"step" => 0.5]]);
  945.                     echo "
  946.                             </div>
  947.                             <div>
  948.                                 <label class=\"block text-sm font-medium text-slate-700 mb-1\">Note 8</label>
  949.                                 ";
  950.                     // line 585
  951.                     echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env$this->source, (isset($context["form"]) || array_key_exists("form"$context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.'585$this->source); })()), "note8", [], "any"falsefalsefalse585), 'widget', ["attr" => ["class" => (isset($context["input_class"]) || array_key_exists("input_class"$context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.'585$this->source); })()), "min" => 0"max" => 20"step" => 0.5]]);
  952.                     echo "
  953.                             </div>
  954.                             <div>
  955.                                 <label class=\"block text-sm font-medium text-slate-700 mb-1\">Note 9</label>
  956.                                 ";
  957.                     // line 589
  958.                     echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env$this->source, (isset($context["form"]) || array_key_exists("form"$context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.'589$this->source); })()), "note9", [], "any"falsefalsefalse589), 'widget', ["attr" => ["class" => (isset($context["input_class"]) || array_key_exists("input_class"$context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.'589$this->source); })()), "min" => 0"max" => 20"step" => 0.5]]);
  959.                     echo "
  960.                             </div>
  961.                         </div>
  962.                         <div class=\"mt-4 mb-6\">
  963.                             <label class=\"block text-sm font-medium text-slate-700 mb-1\">Commentaire entretien</label>
  964.                             ";
  965.                     // line 595
  966.                     echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env$this->source, (isset($context["form"]) || array_key_exists("form"$context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.'595$this->source); })()), "entcom", [], "any"falsefalsefalse595), 'widget', ["attr" => ["class" => (isset($context["input_class"]) || array_key_exists("input_class"$context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.'595$this->source); })()), "rows" => 3"placeholder" => "Observations sur l'entretien..."]]);
  967.                     echo "
  968.                         </div>
  969.                     ";
  970.                 }
  971.                 // line 598
  972.                 echo "
  973.                     <!-- Évaluations existantes -->
  974.                     ";
  975.                 // line 600
  976.                 if ((array_key_exists("evaluations"$context) && (twig_length_filter($this->env, (isset($context["evaluations"]) || array_key_exists("evaluations"$context) ? $context["evaluations"] : (function () { throw new RuntimeError('Variable "evaluations" does not exist.'600$this->source); })())) > 0))) {
  977.                     // line 601
  978.                     echo "                    <div class=\"mb-6 space-y-3\" id=\"existing-evaluations\">
  979.                         <p class=\"text-sm font-medium text-slate-600 flex items-center mb-2\">
  980.                             <i class=\"fas fa-history text-indigo-500 mr-2\"></i>
  981.                             Évaluations précédentes
  982.                         </p>
  983.                         ";
  984.                     // line 606
  985.                     $context['_parent'] = $context;
  986.                     $context['_seq'] = twig_ensure_traversable((isset($context["evaluations"]) || array_key_exists("evaluations"$context) ? $context["evaluations"] : (function () { throw new RuntimeError('Variable "evaluations" does not exist.'606$this->source); })()));
  987.                     foreach ($context['_seq'] as $context["_key"] => $context["eval"]) {
  988.                         // line 607
  989.                         echo "                        <div class=\"bg-slate-50 rounded-xl p-4 border border-slate-200\">
  990.                             <div class=\"flex items-center justify-between mb-2\">
  991.                                 <div class=\"flex items-center gap-3\">
  992.                                     <span class=\"font-medium text-slate-800\">";
  993.                         // line 610
  994.                         echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source$context["eval"], "grille", [], "any"falsefalsefalse610), "nom", [], "any"falsefalsefalse610), "html"nulltrue);
  995.                         echo "</span>
  996.                                     <span class=\"text-xs text-slate-500\">";
  997.                         // line 611
  998.                         echo twig_escape_filter($this->envtwig_date_format_filter($this->envtwig_get_attribute($this->env$this->source$context["eval"], "createdAt", [], "any"falsefalsefalse611), "d/m/Y H:i"), "html"nulltrue);
  999.                         echo "</span>
  1000.                                 </div>
  1001.                                 <div class=\"flex items-center gap-2\">
  1002.                                     ";
  1003.                         // line 614
  1004.                         $context["percentage"] = (((twig_get_attribute($this->env$this->source$context["eval"], "noteMaxTotale", [], "any"falsefalsefalse614) > 0)) ? (((twig_get_attribute($this->env$this->source$context["eval"], "scoreTotal", [], "any"falsefalsefalse614) / twig_get_attribute($this->env$this->source$context["eval"], "noteMaxTotale", [], "any"falsefalsefalse614)) * 100)) : (0));
  1005.                         // line 615
  1006.                         echo "                                    <span class=\"inline-flex items-center px-3 py-1 rounded-full text-sm font-bold
  1007.                                         ";
  1008.                         // line 616
  1009.                         if (((isset($context["percentage"]) || array_key_exists("percentage"$context) ? $context["percentage"] : (function () { throw new RuntimeError('Variable "percentage" does not exist.'616$this->source); })()) >= 70)) {
  1010.                             echo "bg-green-100 text-green-700
  1011.                                         ";
  1012.                         } elseif ((                        // line 617
  1013. (isset($context["percentage"]) || array_key_exists("percentage"$context) ? $context["percentage"] : (function () { throw new RuntimeError('Variable "percentage" does not exist.'617$this->source); })()) >= 40)) {
  1014.                             echo "bg-yellow-100 text-yellow-700
  1015.                                         ";
  1016.                         } else {
  1017.                             // line 618
  1018.                             echo "bg-red-100 text-red-700";
  1019.                         }
  1020.                         echo "\">
  1021.                                         ";
  1022.                         // line 619
  1023.                         echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source$context["eval"], "scoreTotal", [], "any"falsefalsefalse619), "html"nulltrue);
  1024.                         echo " / ";
  1025.                         echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source$context["eval"], "noteMaxTotale", [], "any"falsefalsefalse619), "html"nulltrue);
  1026.                         echo "
  1027.                                     </span>
  1028.                                 </div>
  1029.                             </div>
  1030.                             <!-- Progress bar -->
  1031.                             <div class=\"w-full bg-slate-200 rounded-full h-2.5 mb-2\">
  1032.                                 <div class=\"h-2.5 rounded-full transition-all duration-500
  1033.                                     ";
  1034.                         // line 626
  1035.                         if (((isset($context["percentage"]) || array_key_exists("percentage"$context) ? $context["percentage"] : (function () { throw new RuntimeError('Variable "percentage" does not exist.'626$this->source); })()) >= 70)) {
  1036.                             echo "bg-green-500
  1037.                                     ";
  1038.                         } elseif ((                        // line 627
  1039. (isset($context["percentage"]) || array_key_exists("percentage"$context) ? $context["percentage"] : (function () { throw new RuntimeError('Variable "percentage" does not exist.'627$this->source); })()) >= 40)) {
  1040.                             echo "bg-yellow-500
  1041.                                     ";
  1042.                         } else {
  1043.                             // line 628
  1044.                             echo "bg-red-500";
  1045.                         }
  1046.                         echo "\" 
  1047.                                     style=\"width: ";
  1048.                         // line 629
  1049.                         echo twig_escape_filter($this->env, (isset($context["percentage"]) || array_key_exists("percentage"$context) ? $context["percentage"] : (function () { throw new RuntimeError('Variable "percentage" does not exist.'629$this->source); })()), "html"nulltrue);
  1050.                         echo "%\"></div>
  1051.                             </div>
  1052.                             ";
  1053.                         // line 631
  1054.                         if (twig_get_attribute($this->env$this->source$context["eval"], "commentaire", [], "any"falsefalsefalse631)) {
  1055.                             // line 632
  1056.                             echo "                            <p class=\"text-xs text-slate-500 mt-1\"><i class=\"fas fa-comment mr-1\"></i> ";
  1057.                             echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source$context["eval"], "commentaire", [], "any"falsefalsefalse632), "html"nulltrue);
  1058.                             echo "</p>
  1059.                             ";
  1060.                         }
  1061.                         // line 634
  1062.                         echo "                        </div>
  1063.                         ";
  1064.                     }
  1065.                     $_parent $context['_parent'];
  1066.                     unset($context['_seq'], $context['_iterated'], $context['_key'], $context['eval'], $context['_parent'], $context['loop']);
  1067.                     $context array_intersect_key($context$_parent) + $_parent;
  1068.                     // line 636
  1069.                     echo "                    </div>
  1070.                     ";
  1071.                 }
  1072.                 // line 638
  1073.                 echo "
  1074.                     ";
  1075.                 // line 658
  1076.                 echo "
  1077.                     <!-- Zone dynamique des critères -->
  1078.                     <div id=\"criteres-container\" class=\"hidden\">
  1079.                         <div class=\"bg-white rounded-xl border border-slate-200 overflow-hidden mb-4\">
  1080.                             <div class=\"px-5 py-3 bg-slate-50 border-b border-slate-200 flex items-center justify-between\">
  1081.                                 <span class=\"text-sm font-semibold text-slate-700\">
  1082.                                     <i class=\"fas fa-star text-yellow-500 mr-1\"></i>
  1083.                                     Critères d'évaluation
  1084.                                 </span>
  1085.                                 <span id=\"grille-name\" class=\"text-xs text-indigo-600 font-medium\"></span>
  1086.                             </div>
  1087.                             <div class=\"overflow-x-auto\">
  1088.                                 <table class=\"w-full\">
  1089.                                     <thead class=\"bg-slate-50/50\">
  1090.                                         <tr>
  1091.                                             <th class=\"px-5 py-3 text-left text-xs font-semibold text-slate-600 uppercase tracking-wider\">Critère</th>
  1092.                                             <th class=\"px-5 py-3 text-center text-xs font-semibold text-slate-600 uppercase tracking-wider w-28\">Note max</th>
  1093.                                             <th class=\"px-5 py-3 text-center text-xs font-semibold text-slate-600 uppercase tracking-wider w-36\">Note attribuée</th>
  1094.                                         </tr>
  1095.                                     </thead>
  1096.                                     <tbody id=\"criteres-body\" class=\"divide-y divide-slate-100\">
  1097.                                         <!-- Rempli dynamiquement par JS -->
  1098.                                     </tbody>
  1099.                                 </table>
  1100.                             </div>
  1101.                         </div>
  1102.                         <!-- Score total + progress bar -->
  1103.                         <div class=\"bg-white rounded-xl border border-slate-200 p-5 mb-4\">
  1104.                             <div class=\"flex items-center justify-between mb-3\">
  1105.                                 <span class=\"text-sm font-semibold text-slate-700\">
  1106.                                     <i class=\"fas fa-calculator text-indigo-500 mr-1\"></i>
  1107.                                     Score total
  1108.                                 </span>
  1109.                                 <span id=\"score-display\" class=\"text-lg font-bold text-slate-800\">0 / 0</span>
  1110.                             </div>
  1111.                             <div class=\"w-full bg-slate-200 rounded-full h-3\">
  1112.                                 <div id=\"score-bar\" class=\"h-3 rounded-full transition-all duration-300 bg-slate-400\" style=\"width: 0%\"></div>
  1113.                             </div>
  1114.                             <p id=\"score-label\" class=\"text-xs text-slate-500 mt-2 text-center\"></p>
  1115.                         </div>
  1116.                         <!-- Commentaire -->
  1117.                         <div class=\"bg-white rounded-xl border border-slate-200 p-5 mb-4\">
  1118.                             <label class=\"block text-sm font-medium text-slate-700 mb-2\">
  1119.                                 <i class=\"fas fa-comment-alt text-indigo-500 mr-1\"></i>
  1120.                                 Observation du jury
  1121.                             </label>
  1122.                             <textarea id=\"evaluation-commentaire\" rows=\"3\" 
  1123.                                 class=\"";
  1124.                 // line 707
  1125.                 echo twig_escape_filter($this->env, (isset($context["input_class"]) || array_key_exists("input_class"$context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.'707$this->source); })()), "html"nulltrue);
  1126.                 echo "\" 
  1127.                                 placeholder=\"Saisissez les observations du jury...\"></textarea>
  1128.                         </div>
  1129.                         <!-- Bouton enregistrer -->
  1130.                         <div class=\"flex justify-end\">
  1131.                             <button type=\"button\" id=\"save-evaluation-btn\" 
  1132.                                 class=\"px-6 py-2.5 bg-gradient-to-r from-indigo-600 to-purple-600 text-white font-semibold rounded-lg hover:from-indigo-700 hover:to-purple-700 transition transform hover:scale-105 shadow-lg inline-flex items-center\">
  1133.                                 <i class=\"fas fa-save mr-2\"></i>
  1134.                                 Enregistrer l'évaluation
  1135.                             </button>
  1136.                         </div>
  1137.                         <!-- Message de succès -->
  1138.                         <div id=\"evaluation-success\" class=\"hidden mt-4 p-4 rounded-xl bg-green-50 text-green-800 border border-green-200\">
  1139.                             <div class=\"flex items-center\">
  1140.                                 <i class=\"fas fa-check-circle text-green-500 mr-3 text-lg\"></i>
  1141.                                 <span id=\"evaluation-success-msg\">Évaluation enregistrée avec succès.</span>
  1142.                             </div>
  1143.                         </div>
  1144.                         <!-- Message d'erreur -->
  1145.                         <div id=\"evaluation-error\" class=\"hidden mt-4 p-4 rounded-xl bg-red-50 text-red-800 border border-red-200\">
  1146.                             <div class=\"flex items-center\">
  1147.                                 <i class=\"fas fa-exclamation-circle text-red-500 mr-3 text-lg\"></i>
  1148.                                 <span id=\"evaluation-error-msg\">Erreur lors de l'enregistrement.</span>
  1149.                             </div>
  1150.                         </div>
  1151.                     </div>
  1152.                 </div>
  1153.             ";
  1154.             }
  1155.             // line 738
  1156.             echo "
  1157.             <!-- SECTION 5: Visite médicale et résultat final -->
  1158.             ";
  1159.             // line 740
  1160.             if ((($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_ENT") || $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_JURY")) || $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_ADMIN"))) {
  1161.                 // line 741
  1162.                 echo "                <div class=\"bg-emerald-50 rounded-2xl border border-emerald-200 p-6\">
  1163.                     <h3 class=\"text-lg font-semibold text-emerald-800 mb-5 flex items-center border-b border-emerald-200 pb-3\">
  1164.                         <div class=\"w-8 h-8 bg-emerald-200 rounded-lg flex items-center justify-center mr-3\">
  1165.                             <i class=\"fas fa-hospital text-emerald-700\"></i>
  1166.                         </div>
  1167.                         VISITE MÉDICALE & Résultat final
  1168.                     </h3>
  1169.                     
  1170.                     <div class=\"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4\">
  1171.                         <div>
  1172.                             <label class=\"block text-sm font-medium text-slate-700 mb-1\">Date visite</label>
  1173.                             ";
  1174.                 // line 752
  1175.                 echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env$this->source, (isset($context["form"]) || array_key_exists("form"$context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.'752$this->source); })()), "visdate", [], "any"falsefalsefalse752), 'widget', ["attr" => ["class" => (isset($context["input_class"]) || array_key_exists("input_class"$context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.'752$this->source); })())]]);
  1176.                 echo "
  1177.                         </div>
  1178.                         <div>
  1179.                             <label class=\"block text-sm font-medium text-slate-700 mb-1\">Lieu visite</label>
  1180.                             ";
  1181.                 // line 756
  1182.                 echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env$this->source, (isset($context["form"]) || array_key_exists("form"$context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.'756$this->source); })()), "vislieu", [], "any"falsefalsefalse756), 'widget', ["attr" => ["class" => (isset($context["input_class"]) || array_key_exists("input_class"$context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.'756$this->source); })()), "placeholder" => "Ex: Centre médical"]]);
  1183.                 echo "
  1184.                         </div>
  1185.                     </div>
  1186.                     <div class=\"grid grid-cols-1 md:grid-cols-3 gap-4\">
  1187.                         <div>
  1188.                             <label class=\"block text-sm font-medium text-slate-700 mb-1\">Statut visite</label>
  1189.                             ";
  1190.                 // line 763
  1191.                 echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env$this->source, (isset($context["form"]) || array_key_exists("form"$context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.'763$this->source); })()), "visstatut", [], "any"falsefalsefalse763), 'widget', ["attr" => ["class" => (isset($context["input_class"]) || array_key_exists("input_class"$context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.'763$this->source); })())]]);
  1192.                 echo "
  1193.                         </div>
  1194.                         <div>
  1195.                             <label class=\"block text-sm font-medium text-slate-700 mb-1\">Résultat final</label>
  1196.                             ";
  1197.                 // line 767
  1198.                 echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env$this->source, (isset($context["form"]) || array_key_exists("form"$context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.'767$this->source); })()), "resultat", [], "any"falsefalsefalse767), 'widget', ["attr" => ["class" => (isset($context["input_class"]) || array_key_exists("input_class"$context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.'767$this->source); })())]]);
  1199.                 echo "
  1200.                         </div>
  1201.                         <div>
  1202.                             <label class=\"block text-sm font-medium text-slate-700 mb-1\">Commentaire</label>
  1203.                             ";
  1204.                 // line 771
  1205.                 echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env$this->source, (isset($context["form"]) || array_key_exists("form"$context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.'771$this->source); })()), "viscom", [], "any"falsefalsefalse771), 'widget', ["attr" => ["class" => (isset($context["input_class"]) || array_key_exists("input_class"$context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.'771$this->source); })()), "placeholder" => "Commentaire visite..."]]);
  1206.                 echo "
  1207.                         </div>
  1208.                     </div>
  1209.                 </div>
  1210.             ";
  1211.             }
  1212.             // line 776
  1213.             echo "
  1214.             <!-- Boutons d'action -->
  1215.             <div class=\"flex flex-col md:flex-row justify-between items-center gap-4 pt-6 border-t border-slate-200\">
  1216.                 <div class=\"text-sm text-slate-500\">
  1217.                     <i class=\"fas fa-info-circle mr-1\"></i>
  1218.                     Les champs marqués d'une <span class=\"text-red-500\">*</span> sont obligatoires
  1219.                 </div>
  1220.                 
  1221.                 <div class=\"flex gap-3\">
  1222.                     ";
  1223.             // line 785
  1224.             if (twig_get_attribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'785$this->source); })()), "user", [], "any"falsefalsefalse785)) {
  1225.                 // line 786
  1226.                 echo "                        ";
  1227.                 // line 787
  1228.                 echo "                        ";
  1229.                 $context["age"] = ((twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'787$this->source); })()), "user", [], "any"falsefalsefalse787), "datenaissance", [], "any"falsefalsefalse787)) ? (twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->sourcetwig_date_converter($this->env), "diff", [=> twig_date_converter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'787$this->source); })()), "user", [], "any"falsefalsefalse787), "datenaissance", [], "any"falsefalsefalse787))], "method"falsefalsefalse787), "y", [], "any"falsefalsefalse787)) : (null));
  1230.                 // line 788
  1231.                 echo "                        
  1232.                         ";
  1233.                 // line 789
  1234.                 if ((($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_ADMIN") || $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_ENT")) || $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_JURY"))) {
  1235.                     // line 790
  1236.                     echo "                            ";
  1237.                     // line 791
  1238.                     echo "                            <button type=\"submit\" class=\"px-8 py-2 bg-gradient-to-r from-indigo-600 to-purple-600 text-white font-semibold rounded-lg hover:from-indigo-700 hover:to-purple-700 transition transform hover:scale-105 shadow-lg flex items-center\">
  1239.                                 <i class=\"fas fa-paper-plane mr-2\"></i>
  1240.                                 Enregistrer l'évaluation
  1241.                             </button>
  1242.                         ";
  1243.                 } elseif (((                // line 795
  1244. (isset($context["age"]) || array_key_exists("age"$context) ? $context["age"] : (function () { throw new RuntimeError('Variable "age" does not exist.'795$this->source); })()) >= 16) && ((isset($context["age"]) || array_key_exists("age"$context) ? $context["age"] : (function () { throw new RuntimeError('Variable "age" does not exist.'795$this->source); })()) <= 40))) {
  1245.                     // line 796
  1246.                     echo "                            ";
  1247.                     // line 797
  1248.                     echo "                            <button type=\"submit\" class=\"px-8 py-2 bg-gradient-to-r from-indigo-600 to-purple-600 text-white font-semibold rounded-lg hover:from-indigo-700 hover:to-purple-700 transition transform hover:scale-105 shadow-lg flex items-center\">
  1249.                                 <i class=\"fas fa-paper-plane mr-2\"></i>
  1250.                                 Soumettre ma candidature
  1251.                             </button>
  1252.                         ";
  1253.                 } else {
  1254.                     // line 802
  1255.                     echo "                            ";
  1256.                     // line 803
  1257.                     echo "                            <button type=\"button\" disabled class=\"px-8 py-2 bg-gray-400 text-white font-semibold rounded-lg cursor-not-allowed opacity-50 flex items-center\" title=\"Vous ne remplissez pas les conditions d'âge\">
  1258.                                 <i class=\"fas fa-ban mr-2\"></i>
  1259.                                 Soumission impossible
  1260.                             </button>
  1261.                         ";
  1262.                 }
  1263.                 // line 808
  1264.                 echo "                    ";
  1265.             } else {
  1266.                 // line 809
  1267.                 echo "                        ";
  1268.                 $context["redirectUrl"] = $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("app_candidature_new", ["etablissement" => twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source,                 // line 810
  1269. (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'810$this->source); })()), "request", [], "any"falsefalsefalse810), "get", [=> "etablissement"], "method"falsefalsefalse810), "metier" => twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source,                 // line 811
  1270. (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'811$this->source); })()), "request", [], "any"falsefalsefalse811), "get", [=> "metier"], "method"falsefalsefalse811)]);
  1271.                 // line 813
  1272.                 echo "                        
  1273.                         <a href=\"";
  1274.                 // line 814
  1275.                 echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("app_login", ["redirect" => (isset($context["redirectUrl"]) || array_key_exists("redirectUrl"$context) ? $context["redirectUrl"] : (function () { throw new RuntimeError('Variable "redirectUrl" does not exist.'814$this->source); })())]), "html"nulltrue);
  1276.                 echo "\" 
  1277.                            class=\"px-8 py-2 bg-gradient-to-r from-indigo-600 to-purple-600 text-white font-semibold rounded-lg hover:from-indigo-700 hover:to-purple-700 transition transform hover:scale-105 shadow-lg flex items-center\">
  1278.                             <i class=\"fas fa-sign-in-alt mr-2\"></i>
  1279.                             Se connecter pour postuler
  1280.                         </a>
  1281.                     ";
  1282.             }
  1283.             // line 820
  1284.             echo "                </div>
  1285.             </div>
  1286.             ";
  1287.             // line 823
  1288.             echo             $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.'823$this->source); })()), 'form_end');
  1289.             echo "
  1290.         </div>
  1291.     </div>
  1292.     ";
  1293.         }
  1294.         // line 828
  1295.         echo "</div>
  1296. <!-- JavaScript pour la gestion dynamique établissement/métier -->
  1297. <script>
  1298. document.addEventListener('DOMContentLoaded', function() {
  1299.     const etablissementSelect = document.getElementById('candidature_etablissement');
  1300.     const metierSelect = document.getElementById('candidature_metier');
  1301.     const metierInfo = document.getElementById('metier-info');
  1302.     const metierSecteur = document.getElementById('metier-secteur');
  1303.     const metierNiveau = document.getElementById('metier-niveau');
  1304.     const metierNbrPlace = document.getElementById('metier-nbrplace');
  1305.     const metierDuree = document.getElementById('metier-duree');
  1306.     const etablissementLoading = document.getElementById('etablissement-loading');
  1307.     const metierLoading = document.getElementById('metier-loading');
  1308.     
  1309.     const currentMetierValue = metierSelect.value;
  1310.     function loadMetiers(etablissementId, callback) {
  1311.         if (!etablissementId) {
  1312.             metierSelect.innerHTML = '<option value=\"\">-- Choisissez d\\'abord un établissement --</option>';
  1313.             metierSelect.disabled = true;
  1314.             metierInfo.classList.add('hidden');
  1315.             if (callback) callback();
  1316.             return;
  1317.         }
  1318.         metierLoading.classList.remove('hidden');
  1319.         metierSelect.disabled = true;
  1320.         fetch('/candidature/etablissement/' + etablissementId + '/metiers')
  1321.             .then(response => response.json())
  1322.             .then(data => {
  1323.                 metierSelect.innerHTML = '<option value=\"\">-- Sélectionnez un métier --</option>';
  1324.                 
  1325.                 const grouped = {};
  1326.                 data.forEach(metier => {
  1327.                     const secteur = metier.secteur_nom || 'Autres';
  1328.                     if (!grouped[secteur]) {
  1329.                         grouped[secteur] = [];
  1330.                     }
  1331.                     grouped[secteur].push(metier);
  1332.                 });
  1333.                 
  1334.                 for (const [secteur, metiers] of Object.entries(grouped)) {
  1335.                     const optgroup = document.createElement('optgroup');
  1336.                     optgroup.label = secteur;
  1337.                     
  1338.                     metiers.sort((a, b) => a.nom.localeCompare(b.nom));
  1339.                     metiers.forEach(metier => {
  1340.                         const option = document.createElement('option');
  1341.                         option.value = metier.id;
  1342.                         option.dataset.secteur = metier.secteur_nom || '';
  1343.                         option.dataset.niveau = metier.niveau || '';
  1344.                         option.dataset.duree = metier.duree || '';
  1345.                         option.dataset.nbrplace = metier.nbrplace || '';
  1346.                         let label = metier.nom;
  1347.                         if (metier.nbrplace) {
  1348.                             label += ' (' + metier.nbrplace + ' places)';
  1349.                         }
  1350.                         option.textContent = label;
  1351.                         optgroup.appendChild(option);
  1352.                     });
  1353.                     
  1354.                     metierSelect.appendChild(optgroup);
  1355.                 }
  1356.                 
  1357.                 const metierToSelect = currentMetierValue || '";
  1358.         // line 894
  1359.         echo twig_escape_filter($this->env, ((twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, ($context["app"] ?? null), "request", [], "any"falsetruefalse894), "get", [=> "metier"], "method"truetruefalse894)) ? (_twig_default_filter(twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, ($context["app"] ?? null), "request", [], "any"falsetruefalse894), "get", [=> "metier"], "method"falsefalsefalse894), "")) : ("")), "html"nulltrue);
  1360.         echo "';
  1361.                 
  1362.                 if (metierToSelect) {
  1363.                     const options = metierSelect.options;
  1364.                     for (let i = 0; i < options.length; i++) {
  1365.                         if (options[i].value == metierToSelect) {
  1366.                             options[i].selected = true;
  1367.                             updateMetierInfo(options[i]);
  1368.                             break;
  1369.                         }
  1370.                     }
  1371.                 }
  1372.                 
  1373.                 metierSelect.disabled = false;
  1374.                 metierLoading.classList.add('hidden');
  1375.                 
  1376.                 if (callback) callback();
  1377.             })
  1378.             .catch(error => {
  1379.                 console.error('Erreur:', error);
  1380.                 metierSelect.disabled = false;
  1381.                 metierLoading.classList.add('hidden');
  1382.                 if (callback) callback();
  1383.             });
  1384.     }
  1385.     function updateMetierInfo(selectedOption) {
  1386.         if (!selectedOption || !selectedOption.value) {
  1387.             metierInfo.classList.add('hidden');
  1388.             return;
  1389.         }
  1390.         
  1391.         metierSecteur.textContent = selectedOption.dataset.secteur || 'Non spécifié';
  1392.         metierNiveau.textContent = selectedOption.dataset.niveau || 'Non spécifié';
  1393.         metierDuree.textContent = selectedOption.dataset.duree || 'Non spécifié';
  1394.         metierNbrPlace.textContent = selectedOption.dataset.nbrplace || 'Non spécifié';
  1395.         metierInfo.classList.remove('hidden');
  1396.     }
  1397.     ";
  1398.         // line 933
  1399.         if (twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'933$this->source); })()), "request", [], "any"falsefalsefalse933), "get", [=> "etablissement"], "method"falsefalsefalse933)) {
  1400.             // line 934
  1401.             echo "        const etablissementId = '";
  1402.             echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'934$this->source); })()), "request", [], "any"falsefalsefalse934), "get", [=> "etablissement"], "method"falsefalsefalse934), "html"nulltrue);
  1403.             echo "';
  1404.         if (etablissementId) {
  1405.             setTimeout(function() {
  1406.                 const options = etablissementSelect.options;
  1407.                 for (let i = 0; i < options.length; i++) {
  1408.                     if (options[i].value == etablissementId) {
  1409.                         options[i].selected = true;
  1410.                         break;
  1411.                     }
  1412.                 }
  1413.                 loadMetiers(etablissementId);
  1414.             }, 100);
  1415.         }
  1416.     ";
  1417.         } else {
  1418.             // line 948
  1419.             echo "        if (etablissementSelect.value) {
  1420.             loadMetiers(etablissementSelect.value);
  1421.         } else {
  1422.             metierSelect.innerHTML = '<option value=\"\">-- Choisissez d\\'abord un établissement --</option>';
  1423.             metierSelect.disabled = true;
  1424.         }
  1425.     ";
  1426.         }
  1427.         // line 955
  1428.         echo "
  1429.     etablissementSelect.addEventListener('change', function() {
  1430.         loadMetiers(this.value);
  1431.         metierInfo.classList.add('hidden');
  1432.     });
  1433.     metierSelect.addEventListener('change', function() {
  1434.         const selectedOption = this.options[this.selectedIndex];
  1435.         updateMetierInfo(selectedOption);
  1436.     });
  1437.     const form = document.getElementById('candidature-form');
  1438.     form.addEventListener('submit', function(e) {
  1439.         ";
  1440.         // line 968
  1441.         if ( !twig_get_attribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'968$this->source); })()), "user", [], "any"falsefalsefalse968)) {
  1442.             // line 969
  1443.             echo "        e.preventDefault();
  1444.         alert('Vous devez être connecté pour soumettre une candidature.');
  1445.         const redirectUrl = '/candidature/new?etablissement=' + etablissementSelect.value + '&metier=' + metierSelect.value;
  1446.         window.location.href = '/login?redirect=' + encodeURIComponent(redirectUrl);
  1447.         return false;
  1448.         ";
  1449.         }
  1450.         // line 975
  1451.         echo "
  1452.         ";
  1453.         // line 977
  1454.         echo "        ";
  1455.         if ((twig_get_attribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'977$this->source); })()), "user", [], "any"falsefalsefalse977) && twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'977$this->source); })()), "user", [], "any"falsefalsefalse977), "datenaissance", [], "any"falsefalsefalse977))) {
  1456.             // line 978
  1457.             echo "            ";
  1458.             $context["age"] = twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->sourcetwig_date_converter($this->env), "diff", [=> twig_date_converter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'978$this->source); })()), "user", [], "any"falsefalsefalse978), "datenaissance", [], "any"falsefalsefalse978))], "method"falsefalsefalse978), "y", [], "any"falsefalsefalse978);
  1459.             // line 979
  1460.             echo "            ";
  1461.             if ((((isset($context["age"]) || array_key_exists("age"$context) ? $context["age"] : (function () { throw new RuntimeError('Variable "age" does not exist.'979$this->source); })()) < 16) || ((isset($context["age"]) || array_key_exists("age"$context) ? $context["age"] : (function () { throw new RuntimeError('Variable "age" does not exist.'979$this->source); })()) > 40))) {
  1462.                 // line 980
  1463.                 echo "                e.preventDefault();
  1464.                 alert('Vous ne remplissez pas les conditions d\\'âge pour candidater (16 à 40 ans).');
  1465.                 return false;
  1466.             ";
  1467.             }
  1468.             // line 984
  1469.             echo "        ";
  1470.         }
  1471.         // line 985
  1472.         echo "
  1473.         if (!etablissementSelect.value) {
  1474.             e.preventDefault();
  1475.             alert('Veuillez sélectionner un établissement.');
  1476.             return false;
  1477.         }
  1478.         
  1479.         if (!metierSelect.value) {
  1480.             e.preventDefault();
  1481.             alert('Veuillez sélectionner un métier.');
  1482.             return false;
  1483.         }
  1484.     });
  1485. });
  1486. </script>
  1487. <!-- JavaScript pour la grille d'évaluation dynamique -->
  1488. ";
  1489.         // line 1002
  1490.         if ((((($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_ENT") || $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_ADMIN")) || $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_JURY")) && array_key_exists("candidature"$context)) && twig_get_attribute($this->env$this->source, (isset($context["candidature"]) || array_key_exists("candidature"$context) ? $context["candidature"] : (function () { throw new RuntimeError('Variable "candidature" does not exist.'1002$this->source); })()), "id", [], "any"falsefalsefalse1002))) {
  1491.             // line 1003
  1492.             echo "<script>
  1493. document.addEventListener('DOMContentLoaded', function() {
  1494.     const grilleSelect = document.getElementById('grille-select');
  1495.     const criteresContainer = document.getElementById('criteres-container');
  1496.     const criteresBody = document.getElementById('criteres-body');
  1497.     const grilleName = document.getElementById('grille-name');
  1498.     const scoreDisplay = document.getElementById('score-display');
  1499.     const scoreBar = document.getElementById('score-bar');
  1500.     const scoreLabel = document.getElementById('score-label');
  1501.     const saveBtn = document.getElementById('save-evaluation-btn');
  1502.     const commentaireField = document.getElementById('evaluation-commentaire');
  1503.     const successDiv = document.getElementById('evaluation-success');
  1504.     const errorDiv = document.getElementById('evaluation-error');
  1505.     const successMsg = document.getElementById('evaluation-success-msg');
  1506.     const errorMsg = document.getElementById('evaluation-error-msg');
  1507.     if (!grilleSelect) return;
  1508.     const candidatureId = ";
  1509.             // line 1021
  1510.             echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source, (isset($context["candidature"]) || array_key_exists("candidature"$context) ? $context["candidature"] : (function () { throw new RuntimeError('Variable "candidature" does not exist.'1021$this->source); })()), "id", [], "any"falsefalsefalse1021), "html"nulltrue);
  1511.             echo ";
  1512.     let currentGrilleId = null;
  1513.     let noteMaxTotale = 0;
  1514.     // Charger les critères quand on sélectionne une grille
  1515.     grilleSelect.addEventListener('change', function() {
  1516.         const grilleId = this.value;
  1517.         if (!grilleId) {
  1518.             criteresContainer.classList.add('hidden');
  1519.             currentGrilleId = null;
  1520.             return;
  1521.         }
  1522.         currentGrilleId = grilleId;
  1523.         loadCriteres(grilleId);
  1524.     });
  1525.     function loadCriteres(grilleId) {
  1526.         fetch('/evaluation/grille/' + grilleId + '/criteres')
  1527.             .then(r => r.json())
  1528.             .then(data => {
  1529.                 criteresBody.innerHTML = '';
  1530.                 noteMaxTotale = data.grille.noteMaxTotale;
  1531.                 grilleName.textContent = data.grille.nom;
  1532.                 data.criteres.forEach(critere => {
  1533.                     const tr = document.createElement('tr');
  1534.                     tr.className = 'hover:bg-slate-50/50 transition';
  1535.                     tr.innerHTML = `
  1536.                         <td class=\"px-5 py-3\">
  1537.                             <div>
  1538.                                 <span class=\"font-medium text-slate-800 text-sm\">\${critere.nom}</span>
  1539.                                 \${critere.description ? '<p class=\"text-xs text-slate-500 mt-0.5\">' + critere.description + '</p>' : ''}
  1540.                             </div>
  1541.                         </td>
  1542.                         <td class=\"px-5 py-3 text-center\">
  1543.                             <span class=\"inline-flex items-center px-2.5 py-1 rounded-full text-xs font-semibold bg-purple-100 text-purple-800\">\${critere.noteMax}</span>
  1544.                         </td>
  1545.                         <td class=\"px-5 py-3 text-center\">
  1546.                             <input type=\"number\" 
  1547.                                 class=\"w-24 mx-auto px-3 py-2 rounded-lg border border-slate-200 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-transparent transition text-center text-sm font-medium note-input\"
  1548.                                 data-critere-id=\"\${critere.id}\" 
  1549.                                 data-note-max=\"\${critere.noteMax}\"
  1550.                                 min=\"0\" 
  1551.                                 max=\"\${critere.noteMax}\" 
  1552.                                 step=\"0.5\" 
  1553.                                 placeholder=\"...\"
  1554.                             >
  1555.                         </td>
  1556.                     `;
  1557.                     criteresBody.appendChild(tr);
  1558.                 });
  1559.                 criteresContainer.classList.remove('hidden');
  1560.                 updateScore();
  1561.                 // Charger les notes existantes
  1562.                 loadExistingEvaluation(grilleId);
  1563.                 // Ajouter les écouteurs sur les champs de notes
  1564.                 document.querySelectorAll('.note-input').forEach(input => {
  1565.                     input.addEventListener('input', function() {
  1566.                         const max = parseFloat(this.dataset.noteMax);
  1567.                         let val = parseFloat(this.value);
  1568.                         if (val > max) { this.value = max; }
  1569.                         if (val < 0) { this.value = 0; }
  1570.                         updateScore();
  1571.                     });
  1572.                 });
  1573.             })
  1574.             .catch(err => {
  1575.                 console.error('Erreur chargement critères:', err);
  1576.             });
  1577.     }
  1578.     function loadExistingEvaluation(grilleId) {
  1579.         fetch('/evaluation/candidature/' + candidatureId + '/evaluation')
  1580.             .then(r => r.json())
  1581.             .then(evaluations => {
  1582.                 const existing = evaluations.find(e => e.grilleId == grilleId);
  1583.                 if (existing) {
  1584.                     existing.notations.forEach(n => {
  1585.                         const input = document.querySelector(`.note-input[data-critere-id=\"\${n.critereId}\"]`);
  1586.                         if (input && n.note !== null) {
  1587.                             input.value = n.note;
  1588.                         }
  1589.                     });
  1590.                     if (existing.commentaire) {
  1591.                         commentaireField.value = existing.commentaire;
  1592.                     }
  1593.                     updateScore();
  1594.                 }
  1595.             })
  1596.             .catch(err => console.error('Erreur chargement évaluation:', err));
  1597.     }
  1598.     function updateScore() {
  1599.         let total = 0;
  1600.         document.querySelectorAll('.note-input').forEach(input => {
  1601.             const val = parseFloat(input.value);
  1602.             if (!isNaN(val)) total += val;
  1603.         });
  1604.         scoreDisplay.textContent = total + ' / ' + noteMaxTotale;
  1605.         const percentage = noteMaxTotale > 0 ? (total / noteMaxTotale * 100) : 0;
  1606.         scoreBar.style.width = percentage + '%';
  1607.         // Couleur de la barre de progression
  1608.         scoreBar.classList.remove('bg-green-500', 'bg-yellow-500', 'bg-red-500', 'bg-slate-400');
  1609.         if (percentage >= 70) {
  1610.             scoreBar.classList.add('bg-green-500');
  1611.             scoreLabel.textContent = 'Excellent';
  1612.             scoreLabel.className = 'text-xs mt-2 text-center text-green-600 font-medium';
  1613.         } else if (percentage >= 40) {
  1614.             scoreBar.classList.add('bg-yellow-500');
  1615.             scoreLabel.textContent = 'Moyen';
  1616.             scoreLabel.className = 'text-xs mt-2 text-center text-yellow-600 font-medium';
  1617.         } else if (total > 0) {
  1618.             scoreBar.classList.add('bg-red-500');
  1619.             scoreLabel.textContent = 'Faible';
  1620.             scoreLabel.className = 'text-xs mt-2 text-center text-red-600 font-medium';
  1621.         } else {
  1622.             scoreBar.classList.add('bg-slate-400');
  1623.             scoreLabel.textContent = '';
  1624.         }
  1625.     }
  1626.     // Enregistrer l'évaluation
  1627.     saveBtn.addEventListener('click', function() {
  1628.         if (!currentGrilleId) return;
  1629.         successDiv.classList.add('hidden');
  1630.         errorDiv.classList.add('hidden');
  1631.         const notations = [];
  1632.         document.querySelectorAll('.note-input').forEach(input => {
  1633.             notations.push({
  1634.                 critereId: parseInt(input.dataset.critereId),
  1635.                 note: input.value !== '' ? parseFloat(input.value) : null,
  1636.             });
  1637.         });
  1638.         const payload = {
  1639.             grilleId: parseInt(currentGrilleId),
  1640.             notations: notations,
  1641.             commentaire: commentaireField.value || null,
  1642.         };
  1643.         saveBtn.disabled = true;
  1644.         saveBtn.innerHTML = '<i class=\"fas fa-spinner fa-spin mr-2\"></i> Enregistrement...';
  1645.         fetch('/evaluation/candidature/' + candidatureId + '/evaluer', {
  1646.             method: 'POST',
  1647.             headers: { 'Content-Type': 'application/json' },
  1648.             body: JSON.stringify(payload),
  1649.         })
  1650.         .then(r => r.json())
  1651.         .then(data => {
  1652.             if (data.success) {
  1653.                 successMsg.textContent = data.message;
  1654.                 successDiv.classList.remove('hidden');
  1655.                 errorDiv.classList.add('hidden');
  1656.                 // Mettre à jour l'affichage du score
  1657.                 scoreDisplay.textContent = data.scoreTotal + ' / ' + data.noteMaxTotale;
  1658.             } else {
  1659.                 errorMsg.textContent = data.error || 'Erreur inconnue.';
  1660.                 errorDiv.classList.remove('hidden');
  1661.                 successDiv.classList.add('hidden');
  1662.             }
  1663.         })
  1664.         .catch(err => {
  1665.             console.error('Erreur:', err);
  1666.             errorMsg.textContent = 'Erreur réseau lors de l\\'enregistrement.';
  1667.             errorDiv.classList.remove('hidden');
  1668.             successDiv.classList.add('hidden');
  1669.         })
  1670.         .finally(() => {
  1671.             saveBtn.disabled = false;
  1672.             saveBtn.innerHTML = '<i class=\"fas fa-save mr-2\"></i> Enregistrer l\\'évaluation';
  1673.         });
  1674.     });
  1675. });
  1676. </script>
  1677. ";
  1678.         }
  1679.         
  1680.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  1681.         
  1682.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  1683.     }
  1684.     public function getTemplateName()
  1685.     {
  1686.         return "candidature/form.html.twig";
  1687.     }
  1688.     public function isTraitable()
  1689.     {
  1690.         return false;
  1691.     }
  1692.     public function getDebugInfo()
  1693.     {
  1694.         return array (  1572 => 1021,  1552 => 1003,  1550 => 1002,  1531 => 985,  1528 => 984,  1522 => 980,  1519 => 979,  1516 => 978,  1513 => 977,  1510 => 975,  1502 => 969,  1500 => 968,  1485 => 955,  1476 => 948,  1458 => 934,  1456 => 933,  1414 => 894,  1346 => 828,  1338 => 823,  1333 => 820,  1324 => 814,  1321 => 813,  1319 => 811,  1318 => 810,  1316 => 809,  1313 => 808,  1306 => 803,  1304 => 802,  1297 => 797,  1295 => 796,  1293 => 795,  1287 => 791,  1285 => 790,  1283 => 789,  1280 => 788,  1277 => 787,  1275 => 786,  1273 => 785,  1262 => 776,  1254 => 771,  1247 => 767,  1240 => 763,  1230 => 756,  1223 => 752,  1210 => 741,  1208 => 740,  1204 => 738,  1170 => 707,  1119 => 658,  1116 => 638,  1112 => 636,  1105 => 634,  1099 => 632,  1097 => 631,  1092 => 629,  1087 => 628,  1082 => 627,  1078 => 626,  1066 => 619,  1061 => 618,  1056 => 617,  1052 => 616,  1049 => 615,  1047 => 614,  1041 => 611,  1037 => 610,  1032 => 607,  1028 => 606,  1021 => 601,  1019 => 600,  1015 => 598,  1009 => 595,  1000 => 589,  993 => 585,  986 => 581,  979 => 577,  972 => 573,  965 => 569,  958 => 565,  951 => 561,  944 => 557,  934 => 550,  927 => 546,  920 => 542,  910 => 535,  903 => 531,  898 => 528,  896 => 527,  886 => 519,  884 => 518,  880 => 516,  874 => 513,  865 => 507,  858 => 503,  851 => 499,  841 => 492,  834 => 488,  822 => 478,  820 => 477,  816 => 475,  809 => 471,  802 => 467,  790 => 457,  788 => 456,  784 => 454,  782 => 452,  781 => 451,  780 => 450,  779 => 449,  727 => 400,  716 => 391,  710 => 389,  704 => 387,  699 => 384,  693 => 382,  691 => 381,  689 => 380,  673 => 366,  665 => 361,  656 => 355,  642 => 343,  639 => 342,  636 => 340,  628 => 335,  619 => 328,  617 => 327,  612 => 325,  607 => 322,  599 => 317,  585 => 305,  583 => 304,  570 => 294,  566 => 292,  550 => 277,  547 => 275,  545 => 273,  544 => 272,  543 => 271,  542 => 270,  533 => 263,  498 => 229,  489 => 221,  485 => 219,  477 => 217,  475 => 216,  471 => 215,  464 => 211,  459 => 209,  454 => 207,  442 => 197,  439 => 195,  429 => 190,  420 => 186,  411 => 182,  399 => 172,  396 => 171,  391 => 168,  387 => 167,  379 => 162,  366 => 151,  363 => 149,  361 => 148,  358 => 147,  356 => 146,  352 => 145,  348 => 143,  345 => 142,  338 => 137,  332 => 135,  330 => 134,  325 => 133,  323 => 132,  313 => 124,  310 => 123,  307 => 122,  304 => 121,  301 => 119,  298 => 118,  291 => 113,  287 => 111,  283 => 110,  279 => 109,  274 => 108,  269 => 106,  265 => 104,  258 => 100,  253 => 97,  250 => 96,  247 => 95,  239 => 91,  230 => 84,  221 => 78,  214 => 74,  198 => 61,  191 => 57,  180 => 48,  177 => 47,  175 => 46,  168 => 41,  162 => 40,  158 => 38,  152 => 37,  141 => 28,  128 => 24,  125 => 23,  121 => 21,  117 => 19,  115 => 18,  112 => 17,  110 => 16,  107 => 15,  103 => 14,  100 => 13,  96 => 12,  93 => 10,  83 => 9,  64 => 3,  53 => 1,  51 => 7,  49 => 6,  36 => 1,);
  1695.     }
  1696.     public function getSourceContext()
  1697.     {
  1698.         return new Source("{% extends 'base.html.twig' %}
  1699. {% block title %}Nouvelle candidature | DAIP{% endblock %}
  1700. {# Définition de la classe CSS réutilisable #}
  1701. {% set input_class = 'w-full px-4 py-2 rounded-lg border border-slate-200 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-transparent transition' %}
  1702. {% set is_edit_page = app.request.attributes.get('_route') == 'app_candidature_edit' %}
  1703. {% block body %}
  1704. {# Flash messages #}
  1705. {% for label, messages in app.flashes %}
  1706.     {% for message in messages %}
  1707.         <div class=\"mb-4 p-4 rounded-lg border
  1708.             {% if label == 'error' %}
  1709.                 bg-red-50 border-red-200 text-red-800
  1710.             {% elseif label == 'success' %}
  1711.                 bg-green-50 border-green-200 text-green-800
  1712.             {% else %}
  1713.                 bg-blue-50 border-blue-200 text-blue-800
  1714.             {% endif %}
  1715.         \">
  1716.             {{ message|raw }}
  1717.         </div>
  1718.     {% endfor %}
  1719. {% endfor %}
  1720. <div class=\"bg-gradient-to-r from-indigo-600 to-purple-600 p-8 mb-8 text-white\">
  1721.     <div class=\"flex items-center gap-4 mb-4\">
  1722.         <div class=\"w-16 h-16 bg-white/20 rounded-full flex items-center justify-center\">
  1723.             <i class=\"fas fa-file-alt text-3xl\"></i>
  1724.         </div>
  1725.         <div>
  1726.             <h1 class=\"text-2xl font-bold\">
  1727.                 {% if is_edit_page %}Modification de candidature{% else %}Nouvelle candidature{% endif %}
  1728.             </h1>
  1729.             <p class=\"text-white/80\">
  1730.                 {% if is_edit_page %}Mettez a jour les informations de la candidature de facon claire et complete.{% else %}Vous etes sur le point de postuler a une formation{% endif %}
  1731.             </p>
  1732.         </div>
  1733.     </div>
  1734.     
  1735.     <!-- Informations du candidat -->
  1736.     {% if app.user %}
  1737.         {% if is_granted('ROLE_ENT') and is_edit_page and candidature is defined %}
  1738.             <div class=\"mt-4 grid grid-cols-1 lg:grid-cols-2 gap-4\">
  1739.                 <div class=\"bg-white/10 backdrop-blur-sm rounded-xl p-4 border border-white/20\">
  1740.                     <p class=\"text-sm font-semibold text-white/80 mb-3 flex items-center\">
  1741.                         <i class=\"fas fa-user-graduate mr-2\"></i>
  1742.                         Informations du candidat
  1743.                     </p>
  1744.                     <div class=\"space-y-3\">
  1745.                         <div class=\"bg-white/10 rounded-lg px-3 py-2\">
  1746.                             <p class=\"text-xs uppercase tracking-wide text-white/70\">Nom du candidat</p>
  1747.                             <p class=\"text-sm font-semibold text-white mt-1\">{{ candidature.user ? (candidature.user.nom ~ ' ' ~ candidature.user.prenoms)|trim : 'Non renseigne' }}</p>
  1748.                         </div>
  1749.                         <div class=\"bg-white/10 rounded-lg px-3 py-2\">
  1750.                             <p class=\"text-xs uppercase tracking-wide text-white/70\">Numero de candidature</p>
  1751.                             <p class=\"text-sm font-semibold text-white mt-1\">{{ candidature.numero|default('Non attribue') }}</p>
  1752.                         </div>
  1753.                     </div>
  1754.                 </div>
  1755.                 <div class=\"bg-white/10 backdrop-blur-sm rounded-xl p-4 border border-white/20\">
  1756.                     <p class=\"text-sm font-semibold text-white/80 mb-3 flex items-center\">
  1757.                         <i class=\"fas fa-file-signature mr-2\"></i>
  1758.                         Informations de la candidature
  1759.                     </p>
  1760.                     <div class=\"space-y-3\">
  1761.                         <div class=\"bg-white/10 rounded-lg px-3 py-2\">
  1762.                             <p class=\"text-xs uppercase tracking-wide text-white/70\">Etablissement choisi</p>
  1763.                             <p class=\"text-sm font-semibold text-white mt-1\">{{ candidature.etablissement ? candidature.etablissement.nom : 'Non renseigne' }}</p>
  1764.                         </div>
  1765.                         <div class=\"bg-white/10 rounded-lg px-3 py-2\">
  1766.                             <p class=\"text-xs uppercase tracking-wide text-white/70\">Metier choisi</p>
  1767.                             <p class=\"text-sm font-semibold text-white mt-1\">{{ candidature.metier ? candidature.metier.nom : 'Non renseigne' }}</p>
  1768.                         </div>
  1769.                     </div>
  1770.                 </div>
  1771.             </div>
  1772.         {% else %}
  1773.             <div class=\"bg-white/10 backdrop-blur-sm rounded-xl p-4 mt-4\">
  1774.                 <div class=\"flex items-center gap-3\">
  1775.                     <div class=\"w-10 h-10 bg-white/20 rounded-full flex items-center justify-center\">
  1776.                         <i class=\"fas fa-user\"></i>
  1777.                     </div>
  1778.                     <div>
  1779.                         <p class=\"text-sm text-white/80\">Candidat</p>
  1780.                         <p class=\"font-semibold\">{{ app.user.nom }} {{ app.user.prenoms }}</p>
  1781.                     </div>
  1782.                     {# Calcul et affichage de l'âge #}
  1783.                     {% if app.user.datenaissance %}
  1784.                         {% set age = date().diff(date(app.user.datenaissance)).y %}
  1785.                         <div class=\"ml-4 px-3 py-1 bg-white/20 rounded-full\">
  1786.                             <span class=\"text-sm\">
  1787.                                 <i class=\"fas fa-birthday-cake mr-1\"></i>
  1788.                                 {{ age }} ans
  1789.                             </span>
  1790.                         </div>
  1791.                     {% endif %}
  1792.                     <div class=\"ml-auto\">
  1793.                         <span class=\"px-3 py-1 bg-white/20 rounded-full text-sm\">{{ app.user.email }}</span>
  1794.                         <span class=\"ml-2 px-3 py-1 bg-indigo-500 rounded-full text-xs\">
  1795.                             {% if is_granted('ROLE_ADMIN') %}ADMIN
  1796.                             {% elseif is_granted('ROLE_ENT') %}ENT
  1797.                             {% elseif is_granted('ROLE_JURY') %}JURY
  1798.                             {% elseif is_granted('ROLE_CANDIDAT') %}CANDIDAT
  1799.                             {% endif %}
  1800.                         </span>
  1801.                     </div>
  1802.                 </div>
  1803.             </div>
  1804.         {% endif %}
  1805.     {% endif %}
  1806.     
  1807.     {# Vérification d'âge #}
  1808.     {% if app.user and app.user.datenaissance %}
  1809.         {% set age = date().diff(date(app.user.datenaissance)).y %}
  1810.         {% if age < 16 or age > 40 %}
  1811.             <div class=\"mt-4 bg-red-500/20 backdrop-blur-sm border border-red-500/30 rounded-xl p-4\">
  1812.                 <div class=\"flex items-center gap-3\">
  1813.                     <div class=\"w-10 h-10 bg-red-500/30 rounded-full flex items-center justify-center\">
  1814.                         <i class=\"fas fa-exclamation-triangle text-red-300\"></i>
  1815.                     </div>
  1816.                     <div>
  1817.                         <p class=\"font-semibold text-white\">Âge non conforme</p>
  1818.                         <p class=\"text-sm text-white/80\">
  1819.                             {% if age < 16 %}
  1820.                                 Vous avez {{ age }} ans. L'âge minimum requis pour candidater est de 16 ans.
  1821.                             {% elseif age > 40 %}
  1822.                                 Vous avez {{ age }} ans. L'âge maximum autorisé pour candidater est de 40 ans.
  1823.                             {% endif %}
  1824.                         </p>
  1825.                     </div>
  1826.                 </div>
  1827.             </div>
  1828.         {% endif %}
  1829.     {% endif %}
  1830. </div>
  1831. <div class=\"max-w-7xl mx-auto px-4 pb-16 {{ is_edit_page ? 'pt-2' : '' }}\">
  1832.     {% include 'partials/_flash_messages.html.twig' %}
  1833.     {% if is_edit_page and candidature is defined and candidature.id %}
  1834.         {# ===== PARTIE 1 : MISE À JOUR DES INFORMATIONS ===== #}
  1835.         <div class=\"bg-white rounded-2xl shadow-xl border border-slate-200 overflow-hidden mb-8\">
  1836.             <div class=\"p-6 md:p-8\">
  1837.                 <div class=\"rounded-xl border border-indigo-200 bg-indigo-50 p-4 md:p-5 mb-8\">
  1838.                     <div class=\"flex flex-col md:flex-row md:items-center md:justify-between gap-2\">
  1839.                         <div>
  1840.                             <p class=\"text-sm font-semibold text-indigo-800 flex items-center\">
  1841.                                 <i class=\"fas fa-edit mr-2\"></i> Partie 1 — Mise à jour des informations
  1842.                             </p>
  1843.                             <p class=\"text-sm text-indigo-700 mt-1\">Modifiez les informations du candidat, le métier et les documents.</p>
  1844.                         </div>
  1845.                         <span class=\"inline-flex items-center px-3 py-1 rounded-full bg-white text-indigo-700 text-sm font-semibold border border-indigo-200\">
  1846.                             N° {{ candidature.numero|default('Non attribué') }}
  1847.                         </span>
  1848.                     </div>
  1849.                 </div>
  1850.                 <form id=\"form-update-info\" action=\"{{ path('app_candidature_update_info', {id: candidature.id}) }}\" method=\"POST\" enctype=\"multipart/form-data\" class=\"space-y-10\">
  1851.                     <input type=\"hidden\" name=\"_token\" value=\"{{ csrf_token('candidature_update_info_' ~ candidature.id) }}\">
  1852.                     {# Identité du candidat (ENT/ADMIN) #}
  1853.                     {% if is_granted('ROLE_ENT') or is_granted('ROLE_ADMIN') %}
  1854.                         <div class=\"rounded-xl border border-orange-200 bg-orange-50 p-5\">
  1855.                             <h3 class=\"text-base font-semibold text-orange-800 mb-4 flex items-center\">
  1856.                                 <div class=\"w-7 h-7 bg-orange-200 rounded-lg flex items-center justify-center mr-2\">
  1857.                                     <i class=\"fas fa-user-edit text-orange-700 text-sm\"></i>
  1858.                                 </div>
  1859.                                 Identité du candidat
  1860.                             </h3>
  1861.                             <div class=\"grid grid-cols-1 md:grid-cols-2 gap-4\">
  1862.                                 <div>
  1863.                                     <label class=\"block text-sm font-medium text-slate-700 mb-1\">Nom <span class=\"text-red-500\">*</span></label>
  1864.                                     <input type=\"text\" name=\"nom\" value=\"{{ candidature.user ? candidature.user.nom : '' }}\" class=\"{{ input_class }}\" placeholder=\"Nom de famille\">
  1865.                                 </div>
  1866.                                 <div>
  1867.                                     <label class=\"block text-sm font-medium text-slate-700 mb-1\">Prénom(s) <span class=\"text-red-500\">*</span></label>
  1868.                                     <input type=\"text\" name=\"prenoms\" value=\"{{ candidature.user ? candidature.user.prenoms : '' }}\" class=\"{{ input_class }}\" placeholder=\"Prénom(s)\">
  1869.                                 </div>
  1870.                                 <div class=\"md:col-span-2\">
  1871.                                     <label class=\"block text-sm font-medium text-slate-700 mb-1\">Contact (téléphone)</label>
  1872.                                     <input type=\"text\" name=\"contact\" value=\"{{ candidature.user ? candidature.user.contact : '' }}\" class=\"{{ input_class }}\" placeholder=\"Ex: 0102030405\">
  1873.                                 </div>
  1874.                             </div>
  1875.                         </div>
  1876.                     {% endif %}
  1877.                     {# Formation souhaitée #}
  1878.                     <h3 class=\"text-lg font-semibold text-indigo-800 flex items-center border-b pb-3 mb-5\">
  1879.                         <div class=\"w-8 h-8 bg-indigo-200 rounded-lg flex items-center justify-center mr-3\">
  1880.                             <i class=\"fas fa-graduation-cap text-indigo-700\"></i>
  1881.                         </div>
  1882.                         Formation souhaitée
  1883.                     </h3>
  1884.                     <div class=\"grid grid-cols-1 md:grid-cols-2 gap-6\">
  1885.                         <div>
  1886.                             <label class=\"block text-sm font-medium text-slate-700 mb-1\">Établissement <span class=\"text-red-500\">*</span></label>
  1887.                             <div class=\"{{ input_class }} bg-slate-100 text-slate-600 cursor-default flex items-center gap-2\">
  1888.                                 <i class=\"fas fa-lock text-slate-400 text-xs\"></i>
  1889.                                 {{ candidature.etablissement ? candidature.etablissement.nom : 'Non renseigné' }}
  1890.                             </div>
  1891.                             <input type=\"hidden\" id=\"candidature_etablissement\" value=\"{{ candidature.etablissement ? candidature.etablissement.id : '' }}\">
  1892.                         </div>
  1893.                         <div>
  1894.                             <label class=\"block text-sm font-medium text-slate-700 mb-1\">Métier <span class=\"text-red-500\">*</span></label>
  1895.                             <select name=\"metier_id\" id=\"candidature_metier\" required class=\"{{ input_class }}\">
  1896.                                 {% if candidature.metier %}
  1897.                                     <option value=\"{{ candidature.metier.id }}\" selected>{{ candidature.metier.nom }}</option>
  1898.                                 {% else %}
  1899.                                     <option value=\"\">-- Sélectionnez un métier --</option>
  1900.                                 {% endif %}
  1901.                             </select>
  1902.                             <div id=\"metier-loading\" class=\"hidden text-sm text-indigo-600 mt-1\">
  1903.                                 <i class=\"fas fa-spinner fa-spin mr-1\"></i> Chargement...
  1904.                             </div>
  1905.                         </div>
  1906.                     </div>
  1907.                     {# Informations détaillées du métier #}
  1908.                     <div id=\"metier-info\" class=\"hidden mt-6\">
  1909.                         <div class=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-3\">
  1910.                             <div class=\"flex items-center gap-3 p-2 bg-indigo-100 rounded-lg\">
  1911.                                 <i class=\"fas fa-building text-indigo-600\"></i>
  1912.                                 <div>
  1913.                                     <p class=\"text-xs text-indigo-600\">Secteur</p>
  1914.                                     <p id=\"metier-secteur\" class=\"text-sm font-medium\">-</p>
  1915.                                 </div>
  1916.                             </div>
  1917.                             <div class=\"flex items-center gap-3 p-2 bg-purple-100 rounded-lg\">
  1918.                                 <i class=\"fas fa-users text-purple-600\"></i>
  1919.                                 <div>
  1920.                                     <p class=\"text-xs text-purple-600\">Places</p>
  1921.                                     <p id=\"metier-nbrplace\" class=\"text-sm font-medium\">-</p>
  1922.                                 </div>
  1923.                             </div>
  1924.                             <div class=\"flex items-center gap-3 p-2 bg-green-100 rounded-lg\">
  1925.                                 <i class=\"fas fa-graduation-cap text-green-600\"></i>
  1926.                                 <div>
  1927.                                     <p class=\"text-xs text-green-600\">Niveau</p>
  1928.                                     <p id=\"metier-niveau\" class=\"text-sm font-medium\">-</p>
  1929.                                 </div>
  1930.                             </div>
  1931.                             <div class=\"flex items-center gap-3 p-2 bg-amber-100 rounded-lg\">
  1932.                                 <i class=\"fas fa-clock text-amber-600\"></i>
  1933.                                 <div>
  1934.                                     <p class=\"text-xs text-amber-600\">Durée</p>
  1935.                                     <p id=\"metier-duree\" class=\"text-sm font-medium\">-</p>
  1936.                                 </div>
  1937.                             </div>
  1938.                         </div>
  1939.                     </div>
  1940.                     {# Documents #}
  1941.                     <h3 class=\"text-lg font-semibold text-purple-800 mb-5 flex items-center border-b pb-3\">
  1942.                         <div class=\"w-8 h-8 bg-purple-200 rounded-lg flex items-center justify-center mr-3\">
  1943.                             <i class=\"fas fa-cloud-upload-alt text-purple-700\"></i>
  1944.                         </div>
  1945.                         Documents à télécharger <span class=\"text-red-500\"> *</span>
  1946.                     </h3>
  1947.                     {% include 'partials/_document_upload_plain.html.twig' with {
  1948.                         'candidature': candidature,
  1949.                         'document_labels': document_labels,
  1950.                         'input_class': input_class
  1951.                     } %}
  1952.                     {# Bouton Mise à jour #}
  1953.                     <div class=\"flex flex-col md:flex-row justify-between items-center gap-4 pt-6 border-t border-slate-200\">
  1954.                         <div class=\"text-sm text-slate-500\">
  1955.                             <i class=\"fas fa-info-circle mr-1\"></i>
  1956.                             Les champs marqués d'une <span class=\"text-red-500\">*</span> sont obligatoires
  1957.                         </div>
  1958.                         <button type=\"submit\" class=\"px-8 py-2 bg-gradient-to-r from-indigo-600 to-purple-600 text-white font-semibold rounded-lg hover:from-indigo-700 hover:to-purple-700 transition transform hover:scale-105 shadow-lg flex items-center\">
  1959.                             <i class=\"fas fa-save mr-2\"></i>
  1960.                             Mise à jour
  1961.                         </button>
  1962.                     </div>
  1963.                 </form>
  1964.             </div>
  1965.         </div>
  1966.         {# ===== PARTIE 2 : ANALYSE DU DOSSIER ===== #}
  1967.         <div class=\"bg-white rounded-2xl shadow-xl border border-slate-200 overflow-hidden\">
  1968.             <div class=\"p-6 md:p-8\">
  1969.                 {{ form_start(form, {'attr': {'class': 'space-y-10', 'id': 'candidature-form'}}) }}
  1970.                     <div class=\"rounded-xl border border-amber-200 bg-amber-50 p-4 md:p-5 mb-4\">
  1971.                         <p class=\"text-sm font-semibold text-amber-800 flex items-center\">
  1972.                             <i class=\"fas fa-clipboard-list mr-2\"></i>
  1973.                             Partie 2 — Analyse du dossier
  1974.                         </p>
  1975.                         <p class=\"text-sm text-amber-700 mt-1\">Étudiez le dossier, évaluez le candidat et enregistrez le résultat.</p>
  1976.                     </div>
  1977.                     {% include 'partials/_candidature_evaluation_sections.html.twig' %}
  1978.                     <div class=\"flex flex-col md:flex-row justify-between items-center gap-4 pt-6 border-t border-slate-200\">
  1979.                         <div class=\"text-sm text-slate-500\">
  1980.                             <i class=\"fas fa-info-circle mr-1\"></i>
  1981.                             Les champs marqués d'une <span class=\"text-red-500\">*</span> sont obligatoires
  1982.                         </div>
  1983.                         <button type=\"submit\" class=\"px-8 py-2 bg-gradient-to-r from-indigo-600 to-purple-600 text-white font-semibold rounded-lg hover:from-indigo-700 hover:to-purple-700 transition transform hover:scale-105 shadow-lg flex items-center\">
  1984.                             <i class=\"fas fa-paper-plane mr-2\"></i>
  1985.                             Enregistrer l'évaluation
  1986.                         </button>
  1987.                     </div>
  1988.                 {{ form_end(form) }}
  1989.             </div>
  1990.         </div>
  1991.     {% else %}
  1992.     <div class=\"bg-white rounded-2xl shadow-xl border border-slate-200 overflow-hidden\">
  1993.         <div class=\"p-6 md:p-8\">
  1994.             {{ form_start(form, {'attr': {'class': 'space-y-10', 'enctype': 'multipart/form-data', 'id': 'candidature-form'}}) }}
  1995.             {% if is_edit_page and candidature is defined %}
  1996.                 <div class=\"rounded-xl border border-indigo-200 bg-indigo-50 p-4 md:p-5\">
  1997.                     <div class=\"flex flex-col md:flex-row md:items-center md:justify-between gap-2\">
  1998.                         <div>
  1999.                             <p class=\"text-sm font-semibold text-indigo-800\">Edition de candidature</p>
  2000.                             <p class=\"text-sm text-indigo-700 mt-1\">Verifiez les informations puis mettez a jour les documents si necessaire.</p>
  2001.                         </div>
  2002.                         <span class=\"inline-flex items-center px-3 py-1 rounded-full bg-white text-indigo-700 text-sm font-semibold border border-indigo-200\">
  2003.                             N° {{ candidature.numero|default('Non attribue') }}
  2004.                         </span>
  2005.                     </div>
  2006.                 </div>
  2007.             {% endif %}
  2008.             {# Section : Identité du candidat (visible ENT / ADMIN en mode édition) #}
  2009.             {% if is_edit_page and (is_granted('ROLE_ENT') or is_granted('ROLE_ADMIN')) and form.nom is defined %}
  2010.                 <div class=\"rounded-xl border border-orange-200 bg-orange-50 p-5\">
  2011.                     <h3 class=\"text-base font-semibold text-orange-800 mb-4 flex items-center\">
  2012.                         <div class=\"w-7 h-7 bg-orange-200 rounded-lg flex items-center justify-center mr-2\">
  2013.                             <i class=\"fas fa-user-edit text-orange-700 text-sm\"></i>
  2014.                         </div>
  2015.                         Identité du candidat
  2016.                     </h3>
  2017.                     <div class=\"grid grid-cols-1 md:grid-cols-2 gap-4\">
  2018.                         <div>
  2019.                             <label class=\"block text-sm font-medium text-slate-700 mb-1\">
  2020.                                 Nom <span class=\"text-red-500\">*</span>
  2021.                             </label>
  2022.                             {{ form_widget(form.nom, {'attr': {'class': input_class, 'placeholder': 'Nom de famille'}}) }}
  2023.                         </div>
  2024.                         <div>
  2025.                             <label class=\"block text-sm font-medium text-slate-700 mb-1\">
  2026.                                 Prénom(s) <span class=\"text-red-500\">*</span>
  2027.                             </label>
  2028.                             {{ form_widget(form.prenoms, {'attr': {'class': input_class, 'placeholder': 'Prénom(s)'}}) }}
  2029.                         </div>
  2030.                     </div>
  2031.                 </div>
  2032.             {% endif %}
  2033.             <!-- SECTION 1: TOUS LES UTILISATEURS - Formation souhaitée -->
  2034.             <h3 class=\"text-lg font-semibold text-indigo-800 flex items-center border-b pb-3 mb-5\">
  2035.                 <div class=\"w-8 h-8 bg-indigo-200 rounded-lg flex items-center justify-center mr-3\">
  2036.                     <i class=\"fas fa-graduation-cap text-indigo-700\"></i>
  2037.                 </div>
  2038.                 Formation souhaitée
  2039.             </h3>
  2040.             
  2041.             <div class=\"grid grid-cols-1 md:grid-cols-2 gap-6\">
  2042.                 <div>
  2043.                     <label class=\"block text-sm font-medium text-slate-700 mb-1\">
  2044.                         Établissement <span class=\"text-red-500\">*</span>
  2045.                     </label>
  2046.                     {% if is_edit_page and candidature is defined and candidature.etablissement %}
  2047.                         {# En mode édition : établissement fixe (lecture seule) #}
  2048.                         <div class=\"{{ input_class }} bg-slate-100 text-slate-600 cursor-default flex items-center gap-2\">
  2049.                             <i class=\"fas fa-lock text-slate-400 text-xs\"></i>
  2050.                             {{ candidature.etablissement.nom }}
  2051.                         </div>
  2052.                         {# Champ caché pour maintenir la valeur lors de la soumission #}
  2053.                         {{ form_widget(form.etablissement, {'attr': {'class': 'hidden', 'id': 'candidature_etablissement'}}) }}
  2054.                     {% else %}
  2055.                         {{ form_widget(form.etablissement, {'attr': {'class': input_class, 'id': 'candidature_etablissement'}}) }}
  2056.                     {% endif %}
  2057.                     <div id=\"etablissement-loading\" class=\"hidden text-sm text-indigo-600 mt-1\">
  2058.                         <i class=\"fas fa-spinner fa-spin mr-1\"></i> Chargement...
  2059.                     </div>
  2060.                 </div>
  2061.                 
  2062.                 <div>
  2063.                     <label class=\"block text-sm font-medium text-slate-700 mb-1\">
  2064.                         Métier <span class=\"text-red-500\">*</span>
  2065.                     </label>
  2066.                     {{ form_widget(form.metier, {'attr': {'class': input_class, 'id': 'candidature_metier'}}) }}
  2067.                     <div id=\"metier-loading\" class=\"hidden text-sm text-indigo-600 mt-1\">
  2068.                         <i class=\"fas fa-spinner fa-spin mr-1\"></i> Chargement...
  2069.                     </div>
  2070.                 </div>
  2071.             </div>
  2072.             <!-- Informations détaillées du métier -->
  2073.             <div id=\"metier-info\" class=\"hidden mt-6\">
  2074.                 <div class=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-3\">
  2075.                     <div class=\"flex items-center gap-3 p-2 bg-indigo-100 rounded-lg\">
  2076.                         <i class=\"fas fa-building text-indigo-600\"></i>
  2077.                         <div>
  2078.                             <p class=\"text-xs text-indigo-600\">Secteur</p>
  2079.                             <p id=\"metier-secteur\" class=\"text-sm font-medium\">-</p>
  2080.                         </div>
  2081.                     </div>
  2082.                     <div class=\"flex items-center gap-3 p-2 bg-purple-100 rounded-lg\">
  2083.                         <i class=\"fas fa-users text-purple-600\"></i>
  2084.                         <div>
  2085.                             <p class=\"text-xs text-purple-600\">Places</p>
  2086.                             <p id=\"metier-nbrplace\" class=\"text-sm font-medium\">-</p>
  2087.                         </div>
  2088.                     </div>
  2089.                     <div class=\"flex items-center gap-3 p-2 bg-green-100 rounded-lg\">
  2090.                         <i class=\"fas fa-graduation-cap text-green-600\"></i>
  2091.                         <div>
  2092.                             <p class=\"text-xs text-green-600\">Niveau</p>
  2093.                             <p id=\"metier-niveau\" class=\"text-sm font-medium\">-</p>
  2094.                         </div>
  2095.                     </div>
  2096.                     <div class=\"flex items-center gap-3 p-2 bg-amber-100 rounded-lg\">
  2097.                         <i class=\"fas fa-clock text-amber-600\"></i>
  2098.                         <div>
  2099.                             <p class=\"text-xs text-amber-600\">Durée</p>
  2100.                             <p id=\"metier-duree\" class=\"text-sm font-medium\">-</p>
  2101.                         </div>
  2102.                     </div>
  2103.                 </div>
  2104.             </div>
  2105.             <!-- SECTION 2: DOCUMENTS -->
  2106.             <h3 class=\"text-lg font-semibold text-purple-800 mb-5 flex items-center border-b pb-3\">
  2107.                 <div class=\"w-8 h-8 bg-purple-200 rounded-lg flex items-center justify-center mr-3\">
  2108.                     <i class=\"fas fa-cloud-upload-alt text-purple-700\"></i>
  2109.                 </div>
  2110.                 Documents à télécharger <span class=\"text-red-500\"> *</span>
  2111.             </h3>
  2112.             
  2113.             {% include 'partials/_document_upload.html.twig' with {
  2114.                 'form': form,
  2115.                 'document_labels': document_labels,
  2116.                 'input_class': input_class
  2117.             } %}
  2118.             <!-- SECTION 3: POUR ENT ET ADMIN - Étude de dossier -->
  2119.             {% if is_granted('ROLE_ENT') or is_granted('ROLE_ADMIN') %}
  2120.                 <h3 class=\"text-lg font-semibold text-amber-800 mb-5 flex items-center border-b pb-3\">
  2121.                     <div class=\"w-8 h-8 bg-amber-200 rounded-lg flex items-center justify-center mr-3\">
  2122.                         <i class=\"fas fa-clipboard-check text-amber-700\"></i>
  2123.                     </div>
  2124.                     Étude de dossier (ENT)
  2125.                 </h3>
  2126.                 
  2127.                 <div class=\"grid grid-cols-1 md:grid-cols-2 gap-4\">
  2128.                     <div>
  2129.                         <label class=\"block text-sm font-medium text-slate-700 mb-1\">Statut dossier</label>
  2130.                         {{ form_widget(form.etustatut, {'attr': {'class': input_class}}) }}
  2131.                     </div>
  2132.                     <div>
  2133.                         <label class=\"block text-sm font-medium text-slate-700 mb-1\">Commentaire</label>
  2134.                         {{ form_widget(form.etucom, {'attr': {'class': input_class, 'placeholder': 'Commentaire sur le dossier...'}}) }}
  2135.                     </div>
  2136.                 </div>
  2137.             {% endif %}
  2138.             <!-- SECTION 4: POUR JURY ET ADMIN - Évaluation entretien -->
  2139.             {% if is_granted('ROLE_JURY') or is_granted('ROLE_ADMIN') %}
  2140.                 <h3 class=\"text-lg font-semibold text-blue-800 mb-5 flex items-center border-b pb-3\">
  2141.                     <div class=\"w-8 h-8 bg-blue-200 rounded-lg flex items-center justify-center mr-3\">
  2142.                         <i class=\"fas fa-microphone-alt text-blue-700\"></i>
  2143.                     </div>
  2144.                     Évaluation entretien (Jury)
  2145.                 </h3>
  2146.                 
  2147.                 <div class=\"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4\">
  2148.                     <div>
  2149.                         <label class=\"block text-sm font-medium text-slate-700 mb-1\">Date entretien</label>
  2150.                         {{ form_widget(form.entdate, {'attr': {'class': input_class}}) }}
  2151.                     </div>
  2152.                     <div>
  2153.                         <label class=\"block text-sm font-medium text-slate-700 mb-1\">Lieu entretien</label>
  2154.                         {{ form_widget(form.entlieu, {'attr': {'class': input_class, 'placeholder': 'Ex: Salle 101'}}) }}
  2155.                     </div>
  2156.                 </div>
  2157.                 <div class=\"grid grid-cols-1 md:grid-cols-3 gap-4 mb-4\">
  2158.                     <div>
  2159.                         <label class=\"block text-sm font-medium text-slate-700 mb-1\">Jury n°</label>
  2160.                         {{ form_widget(form.jury, {'attr': {'class': input_class, 'min': 1, 'max': 20}}) }}
  2161.                     </div>
  2162.                     <div>
  2163.                         <label class=\"block text-sm font-medium text-slate-700 mb-1\">Vague</label>
  2164.                         {{ form_widget(form.vague, {'attr': {'class': input_class, 'min': 1}}) }}
  2165.                     </div>
  2166.                     <div>
  2167.                         <label class=\"block text-sm font-medium text-slate-700 mb-1\">Décision jury</label>
  2168.                         {{ form_widget(form.entstatut, {'attr': {'class': input_class}}) }}
  2169.                     </div>
  2170.                 </div>
  2171.                 <div class=\"mt-4\">
  2172.                     <label class=\"block text-sm font-medium text-slate-700 mb-1\">Commentaire entretien</label>
  2173.                     {{ form_widget(form.entcom, {'attr': {'class': input_class, 'rows': 3, 'placeholder': \"Observations sur l'entretien...\"}}) }}
  2174.                 </div>
  2175.             {% endif %}
  2176.             <!-- SECTION 4bis: GRILLE D'ÉVALUATION DYNAMIQUE -->
  2177.             {% if (is_granted('ROLE_ENT') or is_granted('ROLE_ADMIN') or is_granted('ROLE_JURY')) and candidature is defined and candidature.id %}
  2178.                 <div id=\"evaluation-section\">
  2179.                     <h3 class=\"text-lg font-semibold text-indigo-800 mb-5 flex items-center border-b pb-3\">
  2180.                         <div class=\"w-8 h-8 bg-indigo-200 rounded-lg flex items-center justify-center mr-3\">
  2181.                             <i class=\"fas fa-clipboard-check text-indigo-700\"></i>
  2182.                         </div>
  2183.                         Évaluation de l'entretien
  2184.                     </h3>
  2185.                     {% if is_granted('ROLE_ENT') %}
  2186.                         <div class=\"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4\">
  2187.                             <div>
  2188.                                 <label class=\"block text-sm font-medium text-slate-700 mb-1\">Date entretien</label>
  2189.                                 {{ form_widget(form.entdate, {'attr': {'class': input_class}}) }}
  2190.                             </div>
  2191.                             <div>
  2192.                                 <label class=\"block text-sm font-medium text-slate-700 mb-1\">Lieu entretien</label>
  2193.                                 {{ form_widget(form.entlieu, {'attr': {'class': input_class, 'placeholder': 'Ex: Salle 101'}}) }}
  2194.                             </div>
  2195.                         </div>
  2196.                         <div class=\"grid grid-cols-1 md:grid-cols-3 gap-4 mb-4\">
  2197.                             <div>
  2198.                                 <label class=\"block text-sm font-medium text-slate-700 mb-1\">Numéro du jury</label>
  2199.                                 {{ form_widget(form.jury, {'attr': {'class': input_class, 'min': 1, 'max': 20}}) }}
  2200.                             </div>
  2201.                             <div>
  2202.                                 <label class=\"block text-sm font-medium text-slate-700 mb-1\">Vague</label>
  2203.                                 {{ form_widget(form.vague, {'attr': {'class': input_class, 'min': 1}}) }}
  2204.                             </div>
  2205.                             <div>
  2206.                                 <label class=\"block text-sm font-medium text-slate-700 mb-1\">Décision du jury</label>
  2207.                                 {{ form_widget(form.entstatut, {'attr': {'class': input_class}}) }}
  2208.                             </div>
  2209.                         </div>
  2210.                         <div class=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 mb-4\">
  2211.                             <div>
  2212.                                 <label class=\"block text-sm font-medium text-slate-700 mb-1\">Note 1</label>
  2213.                                 {{ form_widget(form.note1, {'attr': {'class': input_class, 'min': 0, 'max': 20, 'step': 0.5}}) }}
  2214.                             </div>
  2215.                             <div>
  2216.                                 <label class=\"block text-sm font-medium text-slate-700 mb-1\">Note 2</label>
  2217.                                 {{ form_widget(form.note2, {'attr': {'class': input_class, 'min': 0, 'max': 20, 'step': 0.5}}) }}
  2218.                             </div>
  2219.                             <div>
  2220.                                 <label class=\"block text-sm font-medium text-slate-700 mb-1\">Note 3</label>
  2221.                                 {{ form_widget(form.note3, {'attr': {'class': input_class, 'min': 0, 'max': 20, 'step': 0.5}}) }}
  2222.                             </div>
  2223.                             <div>
  2224.                                 <label class=\"block text-sm font-medium text-slate-700 mb-1\">Note 4</label>
  2225.                                 {{ form_widget(form.note4, {'attr': {'class': input_class, 'min': 0, 'max': 20, 'step': 0.5}}) }}
  2226.                             </div>
  2227.                             <div>
  2228.                                 <label class=\"block text-sm font-medium text-slate-700 mb-1\">Note 5</label>
  2229.                                 {{ form_widget(form.note5, {'attr': {'class': input_class, 'min': 0, 'max': 20, 'step': 0.5}}) }}
  2230.                             </div>
  2231.                             <div>
  2232.                                 <label class=\"block text-sm font-medium text-slate-700 mb-1\">Note 6</label>
  2233.                                 {{ form_widget(form.note6, {'attr': {'class': input_class, 'min': 0, 'max': 20, 'step': 0.5}}) }}
  2234.                             </div>
  2235.                             <div>
  2236.                                 <label class=\"block text-sm font-medium text-slate-700 mb-1\">Note 7</label>
  2237.                                 {{ form_widget(form.note7, {'attr': {'class': input_class, 'min': 0, 'max': 20, 'step': 0.5}}) }}
  2238.                             </div>
  2239.                             <div>
  2240.                                 <label class=\"block text-sm font-medium text-slate-700 mb-1\">Note 8</label>
  2241.                                 {{ form_widget(form.note8, {'attr': {'class': input_class, 'min': 0, 'max': 20, 'step': 0.5}}) }}
  2242.                             </div>
  2243.                             <div>
  2244.                                 <label class=\"block text-sm font-medium text-slate-700 mb-1\">Note 9</label>
  2245.                                 {{ form_widget(form.note9, {'attr': {'class': input_class, 'min': 0, 'max': 20, 'step': 0.5}}) }}
  2246.                             </div>
  2247.                         </div>
  2248.                         <div class=\"mt-4 mb-6\">
  2249.                             <label class=\"block text-sm font-medium text-slate-700 mb-1\">Commentaire entretien</label>
  2250.                             {{ form_widget(form.entcom, {'attr': {'class': input_class, 'rows': 3, 'placeholder': \"Observations sur l'entretien...\"}}) }}
  2251.                         </div>
  2252.                     {% endif %}
  2253.                     <!-- Évaluations existantes -->
  2254.                     {% if evaluations is defined and evaluations|length > 0 %}
  2255.                     <div class=\"mb-6 space-y-3\" id=\"existing-evaluations\">
  2256.                         <p class=\"text-sm font-medium text-slate-600 flex items-center mb-2\">
  2257.                             <i class=\"fas fa-history text-indigo-500 mr-2\"></i>
  2258.                             Évaluations précédentes
  2259.                         </p>
  2260.                         {% for eval in evaluations %}
  2261.                         <div class=\"bg-slate-50 rounded-xl p-4 border border-slate-200\">
  2262.                             <div class=\"flex items-center justify-between mb-2\">
  2263.                                 <div class=\"flex items-center gap-3\">
  2264.                                     <span class=\"font-medium text-slate-800\">{{ eval.grille.nom }}</span>
  2265.                                     <span class=\"text-xs text-slate-500\">{{ eval.createdAt|date('d/m/Y H:i') }}</span>
  2266.                                 </div>
  2267.                                 <div class=\"flex items-center gap-2\">
  2268.                                     {% set percentage = eval.noteMaxTotale > 0 ? (eval.scoreTotal / eval.noteMaxTotale * 100) : 0 %}
  2269.                                     <span class=\"inline-flex items-center px-3 py-1 rounded-full text-sm font-bold
  2270.                                         {% if percentage >= 70 %}bg-green-100 text-green-700
  2271.                                         {% elseif percentage >= 40 %}bg-yellow-100 text-yellow-700
  2272.                                         {% else %}bg-red-100 text-red-700{% endif %}\">
  2273.                                         {{ eval.scoreTotal }} / {{ eval.noteMaxTotale }}
  2274.                                     </span>
  2275.                                 </div>
  2276.                             </div>
  2277.                             <!-- Progress bar -->
  2278.                             <div class=\"w-full bg-slate-200 rounded-full h-2.5 mb-2\">
  2279.                                 <div class=\"h-2.5 rounded-full transition-all duration-500
  2280.                                     {% if percentage >= 70 %}bg-green-500
  2281.                                     {% elseif percentage >= 40 %}bg-yellow-500
  2282.                                     {% else %}bg-red-500{% endif %}\" 
  2283.                                     style=\"width: {{ percentage }}%\"></div>
  2284.                             </div>
  2285.                             {% if eval.commentaire %}
  2286.                             <p class=\"text-xs text-slate-500 mt-1\"><i class=\"fas fa-comment mr-1\"></i> {{ eval.commentaire }}</p>
  2287.                             {% endif %}
  2288.                         </div>
  2289.                         {% endfor %}
  2290.                     </div>
  2291.                     {% endif %}
  2292.                     {#
  2293.                     <!-- Sélection de la grille -->
  2294.                     <div class=\"bg-white rounded-xl border border-slate-200 p-5 mb-4\">
  2295.                         <label class=\"block text-sm font-medium text-slate-700 mb-2\">
  2296.                             <i class=\"fas fa-th-list text-indigo-500 mr-1\"></i>
  2297.                             Sélectionner une grille d'évaluation
  2298.                         </label>
  2299.                         <select id=\"grille-select\" class=\"{{ input_class }}\">
  2300.                             <option value=\"\">-- Choisir une grille --</option>
  2301.                             {% if grilles is defined %}
  2302.                                 {% for grille in grilles %}
  2303.                                     <option value=\"{{ grille.id }}\" data-note-max=\"{{ grille.noteMaxTotale }}\" data-nb-criteres=\"{{ grille.criteres|length }}\">
  2304.                                         {{ grille.nom }} ({{ grille.criteres|length }} critères — max {{ grille.noteMaxTotale }})
  2305.                                     </option>
  2306.                                 {% endfor %}
  2307.                             {% endif %}
  2308.                         </select>
  2309.                     </div>
  2310.                     #}
  2311.                     <!-- Zone dynamique des critères -->
  2312.                     <div id=\"criteres-container\" class=\"hidden\">
  2313.                         <div class=\"bg-white rounded-xl border border-slate-200 overflow-hidden mb-4\">
  2314.                             <div class=\"px-5 py-3 bg-slate-50 border-b border-slate-200 flex items-center justify-between\">
  2315.                                 <span class=\"text-sm font-semibold text-slate-700\">
  2316.                                     <i class=\"fas fa-star text-yellow-500 mr-1\"></i>
  2317.                                     Critères d'évaluation
  2318.                                 </span>
  2319.                                 <span id=\"grille-name\" class=\"text-xs text-indigo-600 font-medium\"></span>
  2320.                             </div>
  2321.                             <div class=\"overflow-x-auto\">
  2322.                                 <table class=\"w-full\">
  2323.                                     <thead class=\"bg-slate-50/50\">
  2324.                                         <tr>
  2325.                                             <th class=\"px-5 py-3 text-left text-xs font-semibold text-slate-600 uppercase tracking-wider\">Critère</th>
  2326.                                             <th class=\"px-5 py-3 text-center text-xs font-semibold text-slate-600 uppercase tracking-wider w-28\">Note max</th>
  2327.                                             <th class=\"px-5 py-3 text-center text-xs font-semibold text-slate-600 uppercase tracking-wider w-36\">Note attribuée</th>
  2328.                                         </tr>
  2329.                                     </thead>
  2330.                                     <tbody id=\"criteres-body\" class=\"divide-y divide-slate-100\">
  2331.                                         <!-- Rempli dynamiquement par JS -->
  2332.                                     </tbody>
  2333.                                 </table>
  2334.                             </div>
  2335.                         </div>
  2336.                         <!-- Score total + progress bar -->
  2337.                         <div class=\"bg-white rounded-xl border border-slate-200 p-5 mb-4\">
  2338.                             <div class=\"flex items-center justify-between mb-3\">
  2339.                                 <span class=\"text-sm font-semibold text-slate-700\">
  2340.                                     <i class=\"fas fa-calculator text-indigo-500 mr-1\"></i>
  2341.                                     Score total
  2342.                                 </span>
  2343.                                 <span id=\"score-display\" class=\"text-lg font-bold text-slate-800\">0 / 0</span>
  2344.                             </div>
  2345.                             <div class=\"w-full bg-slate-200 rounded-full h-3\">
  2346.                                 <div id=\"score-bar\" class=\"h-3 rounded-full transition-all duration-300 bg-slate-400\" style=\"width: 0%\"></div>
  2347.                             </div>
  2348.                             <p id=\"score-label\" class=\"text-xs text-slate-500 mt-2 text-center\"></p>
  2349.                         </div>
  2350.                         <!-- Commentaire -->
  2351.                         <div class=\"bg-white rounded-xl border border-slate-200 p-5 mb-4\">
  2352.                             <label class=\"block text-sm font-medium text-slate-700 mb-2\">
  2353.                                 <i class=\"fas fa-comment-alt text-indigo-500 mr-1\"></i>
  2354.                                 Observation du jury
  2355.                             </label>
  2356.                             <textarea id=\"evaluation-commentaire\" rows=\"3\" 
  2357.                                 class=\"{{ input_class }}\" 
  2358.                                 placeholder=\"Saisissez les observations du jury...\"></textarea>
  2359.                         </div>
  2360.                         <!-- Bouton enregistrer -->
  2361.                         <div class=\"flex justify-end\">
  2362.                             <button type=\"button\" id=\"save-evaluation-btn\" 
  2363.                                 class=\"px-6 py-2.5 bg-gradient-to-r from-indigo-600 to-purple-600 text-white font-semibold rounded-lg hover:from-indigo-700 hover:to-purple-700 transition transform hover:scale-105 shadow-lg inline-flex items-center\">
  2364.                                 <i class=\"fas fa-save mr-2\"></i>
  2365.                                 Enregistrer l'évaluation
  2366.                             </button>
  2367.                         </div>
  2368.                         <!-- Message de succès -->
  2369.                         <div id=\"evaluation-success\" class=\"hidden mt-4 p-4 rounded-xl bg-green-50 text-green-800 border border-green-200\">
  2370.                             <div class=\"flex items-center\">
  2371.                                 <i class=\"fas fa-check-circle text-green-500 mr-3 text-lg\"></i>
  2372.                                 <span id=\"evaluation-success-msg\">Évaluation enregistrée avec succès.</span>
  2373.                             </div>
  2374.                         </div>
  2375.                         <!-- Message d'erreur -->
  2376.                         <div id=\"evaluation-error\" class=\"hidden mt-4 p-4 rounded-xl bg-red-50 text-red-800 border border-red-200\">
  2377.                             <div class=\"flex items-center\">
  2378.                                 <i class=\"fas fa-exclamation-circle text-red-500 mr-3 text-lg\"></i>
  2379.                                 <span id=\"evaluation-error-msg\">Erreur lors de l'enregistrement.</span>
  2380.                             </div>
  2381.                         </div>
  2382.                     </div>
  2383.                 </div>
  2384.             {% endif %}
  2385.             <!-- SECTION 5: Visite médicale et résultat final -->
  2386.             {% if is_granted('ROLE_ENT') or is_granted('ROLE_JURY') or is_granted('ROLE_ADMIN') %}
  2387.                 <div class=\"bg-emerald-50 rounded-2xl border border-emerald-200 p-6\">
  2388.                     <h3 class=\"text-lg font-semibold text-emerald-800 mb-5 flex items-center border-b border-emerald-200 pb-3\">
  2389.                         <div class=\"w-8 h-8 bg-emerald-200 rounded-lg flex items-center justify-center mr-3\">
  2390.                             <i class=\"fas fa-hospital text-emerald-700\"></i>
  2391.                         </div>
  2392.                         VISITE MÉDICALE & Résultat final
  2393.                     </h3>
  2394.                     
  2395.                     <div class=\"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4\">
  2396.                         <div>
  2397.                             <label class=\"block text-sm font-medium text-slate-700 mb-1\">Date visite</label>
  2398.                             {{ form_widget(form.visdate, {'attr': {'class': input_class}}) }}
  2399.                         </div>
  2400.                         <div>
  2401.                             <label class=\"block text-sm font-medium text-slate-700 mb-1\">Lieu visite</label>
  2402.                             {{ form_widget(form.vislieu, {'attr': {'class': input_class, 'placeholder': 'Ex: Centre médical'}}) }}
  2403.                         </div>
  2404.                     </div>
  2405.                     <div class=\"grid grid-cols-1 md:grid-cols-3 gap-4\">
  2406.                         <div>
  2407.                             <label class=\"block text-sm font-medium text-slate-700 mb-1\">Statut visite</label>
  2408.                             {{ form_widget(form.visstatut, {'attr': {'class': input_class}}) }}
  2409.                         </div>
  2410.                         <div>
  2411.                             <label class=\"block text-sm font-medium text-slate-700 mb-1\">Résultat final</label>
  2412.                             {{ form_widget(form.resultat, {'attr': {'class': input_class}}) }}
  2413.                         </div>
  2414.                         <div>
  2415.                             <label class=\"block text-sm font-medium text-slate-700 mb-1\">Commentaire</label>
  2416.                             {{ form_widget(form.viscom, {'attr': {'class': input_class, 'placeholder': 'Commentaire visite...'}}) }}
  2417.                         </div>
  2418.                     </div>
  2419.                 </div>
  2420.             {% endif %}
  2421.             <!-- Boutons d'action -->
  2422.             <div class=\"flex flex-col md:flex-row justify-between items-center gap-4 pt-6 border-t border-slate-200\">
  2423.                 <div class=\"text-sm text-slate-500\">
  2424.                     <i class=\"fas fa-info-circle mr-1\"></i>
  2425.                     Les champs marqués d'une <span class=\"text-red-500\">*</span> sont obligatoires
  2426.                 </div>
  2427.                 
  2428.                 <div class=\"flex gap-3\">
  2429.                     {% if app.user %}
  2430.                         {# Vérification de l'âge pour afficher/masquer le bouton de soumission #}
  2431.                         {% set age = app.user.datenaissance ? date().diff(date(app.user.datenaissance)).y : null %}
  2432.                         
  2433.                         {% if is_granted('ROLE_ADMIN') or is_granted('ROLE_ENT') or is_granted('ROLE_JURY') %}
  2434.                             {# Les rôles admin/ent/jury peuvent toujours soumettre #}
  2435.                             <button type=\"submit\" class=\"px-8 py-2 bg-gradient-to-r from-indigo-600 to-purple-600 text-white font-semibold rounded-lg hover:from-indigo-700 hover:to-purple-700 transition transform hover:scale-105 shadow-lg flex items-center\">
  2436.                                 <i class=\"fas fa-paper-plane mr-2\"></i>
  2437.                                 Enregistrer l'évaluation
  2438.                             </button>
  2439.                         {% elseif age >= 16 and age <= 40 %}
  2440.                             {# Candidat avec âge valide #}
  2441.                             <button type=\"submit\" class=\"px-8 py-2 bg-gradient-to-r from-indigo-600 to-purple-600 text-white font-semibold rounded-lg hover:from-indigo-700 hover:to-purple-700 transition transform hover:scale-105 shadow-lg flex items-center\">
  2442.                                 <i class=\"fas fa-paper-plane mr-2\"></i>
  2443.                                 Soumettre ma candidature
  2444.                             </button>
  2445.                         {% else %}
  2446.                             {# Candidat avec âge invalide - bouton désactivé #}
  2447.                             <button type=\"button\" disabled class=\"px-8 py-2 bg-gray-400 text-white font-semibold rounded-lg cursor-not-allowed opacity-50 flex items-center\" title=\"Vous ne remplissez pas les conditions d'âge\">
  2448.                                 <i class=\"fas fa-ban mr-2\"></i>
  2449.                                 Soumission impossible
  2450.                             </button>
  2451.                         {% endif %}
  2452.                     {% else %}
  2453.                         {% set redirectUrl = path('app_candidature_new', {
  2454.                             'etablissement': app.request.get('etablissement'),
  2455.                             'metier': app.request.get('metier')
  2456.                         }) %}
  2457.                         
  2458.                         <a href=\"{{ path('app_login', {'redirect': redirectUrl}) }}\" 
  2459.                            class=\"px-8 py-2 bg-gradient-to-r from-indigo-600 to-purple-600 text-white font-semibold rounded-lg hover:from-indigo-700 hover:to-purple-700 transition transform hover:scale-105 shadow-lg flex items-center\">
  2460.                             <i class=\"fas fa-sign-in-alt mr-2\"></i>
  2461.                             Se connecter pour postuler
  2462.                         </a>
  2463.                     {% endif %}
  2464.                 </div>
  2465.             </div>
  2466.             {{ form_end(form) }}
  2467.         </div>
  2468.     </div>
  2469.     {% endif %}
  2470. </div>
  2471. <!-- JavaScript pour la gestion dynamique établissement/métier -->
  2472. <script>
  2473. document.addEventListener('DOMContentLoaded', function() {
  2474.     const etablissementSelect = document.getElementById('candidature_etablissement');
  2475.     const metierSelect = document.getElementById('candidature_metier');
  2476.     const metierInfo = document.getElementById('metier-info');
  2477.     const metierSecteur = document.getElementById('metier-secteur');
  2478.     const metierNiveau = document.getElementById('metier-niveau');
  2479.     const metierNbrPlace = document.getElementById('metier-nbrplace');
  2480.     const metierDuree = document.getElementById('metier-duree');
  2481.     const etablissementLoading = document.getElementById('etablissement-loading');
  2482.     const metierLoading = document.getElementById('metier-loading');
  2483.     
  2484.     const currentMetierValue = metierSelect.value;
  2485.     function loadMetiers(etablissementId, callback) {
  2486.         if (!etablissementId) {
  2487.             metierSelect.innerHTML = '<option value=\"\">-- Choisissez d\\'abord un établissement --</option>';
  2488.             metierSelect.disabled = true;
  2489.             metierInfo.classList.add('hidden');
  2490.             if (callback) callback();
  2491.             return;
  2492.         }
  2493.         metierLoading.classList.remove('hidden');
  2494.         metierSelect.disabled = true;
  2495.         fetch('/candidature/etablissement/' + etablissementId + '/metiers')
  2496.             .then(response => response.json())
  2497.             .then(data => {
  2498.                 metierSelect.innerHTML = '<option value=\"\">-- Sélectionnez un métier --</option>';
  2499.                 
  2500.                 const grouped = {};
  2501.                 data.forEach(metier => {
  2502.                     const secteur = metier.secteur_nom || 'Autres';
  2503.                     if (!grouped[secteur]) {
  2504.                         grouped[secteur] = [];
  2505.                     }
  2506.                     grouped[secteur].push(metier);
  2507.                 });
  2508.                 
  2509.                 for (const [secteur, metiers] of Object.entries(grouped)) {
  2510.                     const optgroup = document.createElement('optgroup');
  2511.                     optgroup.label = secteur;
  2512.                     
  2513.                     metiers.sort((a, b) => a.nom.localeCompare(b.nom));
  2514.                     metiers.forEach(metier => {
  2515.                         const option = document.createElement('option');
  2516.                         option.value = metier.id;
  2517.                         option.dataset.secteur = metier.secteur_nom || '';
  2518.                         option.dataset.niveau = metier.niveau || '';
  2519.                         option.dataset.duree = metier.duree || '';
  2520.                         option.dataset.nbrplace = metier.nbrplace || '';
  2521.                         let label = metier.nom;
  2522.                         if (metier.nbrplace) {
  2523.                             label += ' (' + metier.nbrplace + ' places)';
  2524.                         }
  2525.                         option.textContent = label;
  2526.                         optgroup.appendChild(option);
  2527.                     });
  2528.                     
  2529.                     metierSelect.appendChild(optgroup);
  2530.                 }
  2531.                 
  2532.                 const metierToSelect = currentMetierValue || '{{ app.request.get('metier')|default('') }}';
  2533.                 
  2534.                 if (metierToSelect) {
  2535.                     const options = metierSelect.options;
  2536.                     for (let i = 0; i < options.length; i++) {
  2537.                         if (options[i].value == metierToSelect) {
  2538.                             options[i].selected = true;
  2539.                             updateMetierInfo(options[i]);
  2540.                             break;
  2541.                         }
  2542.                     }
  2543.                 }
  2544.                 
  2545.                 metierSelect.disabled = false;
  2546.                 metierLoading.classList.add('hidden');
  2547.                 
  2548.                 if (callback) callback();
  2549.             })
  2550.             .catch(error => {
  2551.                 console.error('Erreur:', error);
  2552.                 metierSelect.disabled = false;
  2553.                 metierLoading.classList.add('hidden');
  2554.                 if (callback) callback();
  2555.             });
  2556.     }
  2557.     function updateMetierInfo(selectedOption) {
  2558.         if (!selectedOption || !selectedOption.value) {
  2559.             metierInfo.classList.add('hidden');
  2560.             return;
  2561.         }
  2562.         
  2563.         metierSecteur.textContent = selectedOption.dataset.secteur || 'Non spécifié';
  2564.         metierNiveau.textContent = selectedOption.dataset.niveau || 'Non spécifié';
  2565.         metierDuree.textContent = selectedOption.dataset.duree || 'Non spécifié';
  2566.         metierNbrPlace.textContent = selectedOption.dataset.nbrplace || 'Non spécifié';
  2567.         metierInfo.classList.remove('hidden');
  2568.     }
  2569.     {% if app.request.get('etablissement') %}
  2570.         const etablissementId = '{{ app.request.get('etablissement') }}';
  2571.         if (etablissementId) {
  2572.             setTimeout(function() {
  2573.                 const options = etablissementSelect.options;
  2574.                 for (let i = 0; i < options.length; i++) {
  2575.                     if (options[i].value == etablissementId) {
  2576.                         options[i].selected = true;
  2577.                         break;
  2578.                     }
  2579.                 }
  2580.                 loadMetiers(etablissementId);
  2581.             }, 100);
  2582.         }
  2583.     {% else %}
  2584.         if (etablissementSelect.value) {
  2585.             loadMetiers(etablissementSelect.value);
  2586.         } else {
  2587.             metierSelect.innerHTML = '<option value=\"\">-- Choisissez d\\'abord un établissement --</option>';
  2588.             metierSelect.disabled = true;
  2589.         }
  2590.     {% endif %}
  2591.     etablissementSelect.addEventListener('change', function() {
  2592.         loadMetiers(this.value);
  2593.         metierInfo.classList.add('hidden');
  2594.     });
  2595.     metierSelect.addEventListener('change', function() {
  2596.         const selectedOption = this.options[this.selectedIndex];
  2597.         updateMetierInfo(selectedOption);
  2598.     });
  2599.     const form = document.getElementById('candidature-form');
  2600.     form.addEventListener('submit', function(e) {
  2601.         {% if not app.user %}
  2602.         e.preventDefault();
  2603.         alert('Vous devez être connecté pour soumettre une candidature.');
  2604.         const redirectUrl = '/candidature/new?etablissement=' + etablissementSelect.value + '&metier=' + metierSelect.value;
  2605.         window.location.href = '/login?redirect=' + encodeURIComponent(redirectUrl);
  2606.         return false;
  2607.         {% endif %}
  2608.         {# Vérification supplémentaire en JavaScript #}
  2609.         {% if app.user and app.user.datenaissance %}
  2610.             {% set age = date().diff(date(app.user.datenaissance)).y %}
  2611.             {% if age < 16 or age > 40 %}
  2612.                 e.preventDefault();
  2613.                 alert('Vous ne remplissez pas les conditions d\\'âge pour candidater (16 à 40 ans).');
  2614.                 return false;
  2615.             {% endif %}
  2616.         {% endif %}
  2617.         if (!etablissementSelect.value) {
  2618.             e.preventDefault();
  2619.             alert('Veuillez sélectionner un établissement.');
  2620.             return false;
  2621.         }
  2622.         
  2623.         if (!metierSelect.value) {
  2624.             e.preventDefault();
  2625.             alert('Veuillez sélectionner un métier.');
  2626.             return false;
  2627.         }
  2628.     });
  2629. });
  2630. </script>
  2631. <!-- JavaScript pour la grille d'évaluation dynamique -->
  2632. {% if (is_granted('ROLE_ENT') or is_granted('ROLE_ADMIN') or is_granted('ROLE_JURY')) and candidature is defined and candidature.id %}
  2633. <script>
  2634. document.addEventListener('DOMContentLoaded', function() {
  2635.     const grilleSelect = document.getElementById('grille-select');
  2636.     const criteresContainer = document.getElementById('criteres-container');
  2637.     const criteresBody = document.getElementById('criteres-body');
  2638.     const grilleName = document.getElementById('grille-name');
  2639.     const scoreDisplay = document.getElementById('score-display');
  2640.     const scoreBar = document.getElementById('score-bar');
  2641.     const scoreLabel = document.getElementById('score-label');
  2642.     const saveBtn = document.getElementById('save-evaluation-btn');
  2643.     const commentaireField = document.getElementById('evaluation-commentaire');
  2644.     const successDiv = document.getElementById('evaluation-success');
  2645.     const errorDiv = document.getElementById('evaluation-error');
  2646.     const successMsg = document.getElementById('evaluation-success-msg');
  2647.     const errorMsg = document.getElementById('evaluation-error-msg');
  2648.     if (!grilleSelect) return;
  2649.     const candidatureId = {{ candidature.id }};
  2650.     let currentGrilleId = null;
  2651.     let noteMaxTotale = 0;
  2652.     // Charger les critères quand on sélectionne une grille
  2653.     grilleSelect.addEventListener('change', function() {
  2654.         const grilleId = this.value;
  2655.         if (!grilleId) {
  2656.             criteresContainer.classList.add('hidden');
  2657.             currentGrilleId = null;
  2658.             return;
  2659.         }
  2660.         currentGrilleId = grilleId;
  2661.         loadCriteres(grilleId);
  2662.     });
  2663.     function loadCriteres(grilleId) {
  2664.         fetch('/evaluation/grille/' + grilleId + '/criteres')
  2665.             .then(r => r.json())
  2666.             .then(data => {
  2667.                 criteresBody.innerHTML = '';
  2668.                 noteMaxTotale = data.grille.noteMaxTotale;
  2669.                 grilleName.textContent = data.grille.nom;
  2670.                 data.criteres.forEach(critere => {
  2671.                     const tr = document.createElement('tr');
  2672.                     tr.className = 'hover:bg-slate-50/50 transition';
  2673.                     tr.innerHTML = `
  2674.                         <td class=\"px-5 py-3\">
  2675.                             <div>
  2676.                                 <span class=\"font-medium text-slate-800 text-sm\">\${critere.nom}</span>
  2677.                                 \${critere.description ? '<p class=\"text-xs text-slate-500 mt-0.5\">' + critere.description + '</p>' : ''}
  2678.                             </div>
  2679.                         </td>
  2680.                         <td class=\"px-5 py-3 text-center\">
  2681.                             <span class=\"inline-flex items-center px-2.5 py-1 rounded-full text-xs font-semibold bg-purple-100 text-purple-800\">\${critere.noteMax}</span>
  2682.                         </td>
  2683.                         <td class=\"px-5 py-3 text-center\">
  2684.                             <input type=\"number\" 
  2685.                                 class=\"w-24 mx-auto px-3 py-2 rounded-lg border border-slate-200 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-transparent transition text-center text-sm font-medium note-input\"
  2686.                                 data-critere-id=\"\${critere.id}\" 
  2687.                                 data-note-max=\"\${critere.noteMax}\"
  2688.                                 min=\"0\" 
  2689.                                 max=\"\${critere.noteMax}\" 
  2690.                                 step=\"0.5\" 
  2691.                                 placeholder=\"...\"
  2692.                             >
  2693.                         </td>
  2694.                     `;
  2695.                     criteresBody.appendChild(tr);
  2696.                 });
  2697.                 criteresContainer.classList.remove('hidden');
  2698.                 updateScore();
  2699.                 // Charger les notes existantes
  2700.                 loadExistingEvaluation(grilleId);
  2701.                 // Ajouter les écouteurs sur les champs de notes
  2702.                 document.querySelectorAll('.note-input').forEach(input => {
  2703.                     input.addEventListener('input', function() {
  2704.                         const max = parseFloat(this.dataset.noteMax);
  2705.                         let val = parseFloat(this.value);
  2706.                         if (val > max) { this.value = max; }
  2707.                         if (val < 0) { this.value = 0; }
  2708.                         updateScore();
  2709.                     });
  2710.                 });
  2711.             })
  2712.             .catch(err => {
  2713.                 console.error('Erreur chargement critères:', err);
  2714.             });
  2715.     }
  2716.     function loadExistingEvaluation(grilleId) {
  2717.         fetch('/evaluation/candidature/' + candidatureId + '/evaluation')
  2718.             .then(r => r.json())
  2719.             .then(evaluations => {
  2720.                 const existing = evaluations.find(e => e.grilleId == grilleId);
  2721.                 if (existing) {
  2722.                     existing.notations.forEach(n => {
  2723.                         const input = document.querySelector(`.note-input[data-critere-id=\"\${n.critereId}\"]`);
  2724.                         if (input && n.note !== null) {
  2725.                             input.value = n.note;
  2726.                         }
  2727.                     });
  2728.                     if (existing.commentaire) {
  2729.                         commentaireField.value = existing.commentaire;
  2730.                     }
  2731.                     updateScore();
  2732.                 }
  2733.             })
  2734.             .catch(err => console.error('Erreur chargement évaluation:', err));
  2735.     }
  2736.     function updateScore() {
  2737.         let total = 0;
  2738.         document.querySelectorAll('.note-input').forEach(input => {
  2739.             const val = parseFloat(input.value);
  2740.             if (!isNaN(val)) total += val;
  2741.         });
  2742.         scoreDisplay.textContent = total + ' / ' + noteMaxTotale;
  2743.         const percentage = noteMaxTotale > 0 ? (total / noteMaxTotale * 100) : 0;
  2744.         scoreBar.style.width = percentage + '%';
  2745.         // Couleur de la barre de progression
  2746.         scoreBar.classList.remove('bg-green-500', 'bg-yellow-500', 'bg-red-500', 'bg-slate-400');
  2747.         if (percentage >= 70) {
  2748.             scoreBar.classList.add('bg-green-500');
  2749.             scoreLabel.textContent = 'Excellent';
  2750.             scoreLabel.className = 'text-xs mt-2 text-center text-green-600 font-medium';
  2751.         } else if (percentage >= 40) {
  2752.             scoreBar.classList.add('bg-yellow-500');
  2753.             scoreLabel.textContent = 'Moyen';
  2754.             scoreLabel.className = 'text-xs mt-2 text-center text-yellow-600 font-medium';
  2755.         } else if (total > 0) {
  2756.             scoreBar.classList.add('bg-red-500');
  2757.             scoreLabel.textContent = 'Faible';
  2758.             scoreLabel.className = 'text-xs mt-2 text-center text-red-600 font-medium';
  2759.         } else {
  2760.             scoreBar.classList.add('bg-slate-400');
  2761.             scoreLabel.textContent = '';
  2762.         }
  2763.     }
  2764.     // Enregistrer l'évaluation
  2765.     saveBtn.addEventListener('click', function() {
  2766.         if (!currentGrilleId) return;
  2767.         successDiv.classList.add('hidden');
  2768.         errorDiv.classList.add('hidden');
  2769.         const notations = [];
  2770.         document.querySelectorAll('.note-input').forEach(input => {
  2771.             notations.push({
  2772.                 critereId: parseInt(input.dataset.critereId),
  2773.                 note: input.value !== '' ? parseFloat(input.value) : null,
  2774.             });
  2775.         });
  2776.         const payload = {
  2777.             grilleId: parseInt(currentGrilleId),
  2778.             notations: notations,
  2779.             commentaire: commentaireField.value || null,
  2780.         };
  2781.         saveBtn.disabled = true;
  2782.         saveBtn.innerHTML = '<i class=\"fas fa-spinner fa-spin mr-2\"></i> Enregistrement...';
  2783.         fetch('/evaluation/candidature/' + candidatureId + '/evaluer', {
  2784.             method: 'POST',
  2785.             headers: { 'Content-Type': 'application/json' },
  2786.             body: JSON.stringify(payload),
  2787.         })
  2788.         .then(r => r.json())
  2789.         .then(data => {
  2790.             if (data.success) {
  2791.                 successMsg.textContent = data.message;
  2792.                 successDiv.classList.remove('hidden');
  2793.                 errorDiv.classList.add('hidden');
  2794.                 // Mettre à jour l'affichage du score
  2795.                 scoreDisplay.textContent = data.scoreTotal + ' / ' + data.noteMaxTotale;
  2796.             } else {
  2797.                 errorMsg.textContent = data.error || 'Erreur inconnue.';
  2798.                 errorDiv.classList.remove('hidden');
  2799.                 successDiv.classList.add('hidden');
  2800.             }
  2801.         })
  2802.         .catch(err => {
  2803.             console.error('Erreur:', err);
  2804.             errorMsg.textContent = 'Erreur réseau lors de l\\'enregistrement.';
  2805.             errorDiv.classList.remove('hidden');
  2806.             successDiv.classList.add('hidden');
  2807.         })
  2808.         .finally(() => {
  2809.             saveBtn.disabled = false;
  2810.             saveBtn.innerHTML = '<i class=\"fas fa-save mr-2\"></i> Enregistrer l\\'évaluation';
  2811.         });
  2812.     });
  2813. });
  2814. </script>
  2815. {% endif %}
  2816. {% endblock %}""candidature/form.html.twig""/home/daip/temporaire/templates/candidature/form.html.twig");
  2817.     }
  2818. }