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

  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 des informations
  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, ENT 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")) || $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_ENT"))) {
  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
  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\">Numéro du jury</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 du 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.                 ";
  832.                 // line 511
  833.                 if (twig_get_attribute($this->env$this->source, ($context["form"] ?? null), "note1", [], "any"truetruefalse511)) {
  834.                     // line 512
  835.                     echo "                <div class=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 mb-4\">
  836.                     <div>
  837.                         <label class=\"block text-sm font-medium text-slate-700 mb-1\">Note 1</label>
  838.                         ";
  839.                     // line 515
  840.                     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.'515$this->source); })()), "note1", [], "any"falsefalsefalse515), '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.'515$this->source); })()), "min" => 0"max" => 20"step" => 0.5]]);
  841.                     echo "
  842.                     </div>
  843.                     <div>
  844.                         <label class=\"block text-sm font-medium text-slate-700 mb-1\">Note 2</label>
  845.                         ";
  846.                     // line 519
  847.                     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.'519$this->source); })()), "note2", [], "any"falsefalsefalse519), '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.'519$this->source); })()), "min" => 0"max" => 20"step" => 0.5]]);
  848.                     echo "
  849.                     </div>
  850.                     <div>
  851.                         <label class=\"block text-sm font-medium text-slate-700 mb-1\">Note 3</label>
  852.                         ";
  853.                     // line 523
  854.                     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.'523$this->source); })()), "note3", [], "any"falsefalsefalse523), '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.'523$this->source); })()), "min" => 0"max" => 20"step" => 0.5]]);
  855.                     echo "
  856.                     </div>
  857.                     <div>
  858.                         <label class=\"block text-sm font-medium text-slate-700 mb-1\">Note 4</label>
  859.                         ";
  860.                     // line 527
  861.                     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.'527$this->source); })()), "note4", [], "any"falsefalsefalse527), '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.'527$this->source); })()), "min" => 0"max" => 20"step" => 0.5]]);
  862.                     echo "
  863.                     </div>
  864.                     <div>
  865.                         <label class=\"block text-sm font-medium text-slate-700 mb-1\">Note 5</label>
  866.                         ";
  867.                     // line 531
  868.                     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); })()), "note5", [], "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); })()), "min" => 0"max" => 20"step" => 0.5]]);
  869.                     echo "
  870.                     </div>
  871.                     <div>
  872.                         <label class=\"block text-sm font-medium text-slate-700 mb-1\">Note 6</label>
  873.                         ";
  874.                     // line 535
  875.                     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); })()), "note6", [], "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); })()), "min" => 0"max" => 20"step" => 0.5]]);
  876.                     echo "
  877.                     </div>
  878.                     <div>
  879.                         <label class=\"block text-sm font-medium text-slate-700 mb-1\">Note 7</label>
  880.                         ";
  881.                     // line 539
  882.                     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.'539$this->source); })()), "note7", [], "any"falsefalsefalse539), '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.'539$this->source); })()), "min" => 0"max" => 20"step" => 0.5]]);
  883.                     echo "
  884.                     </div>
  885.                     <div>
  886.                         <label class=\"block text-sm font-medium text-slate-700 mb-1\">Note 8</label>
  887.                         ";
  888.                     // line 543
  889.                     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.'543$this->source); })()), "note8", [], "any"falsefalsefalse543), '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.'543$this->source); })()), "min" => 0"max" => 20"step" => 0.5]]);
  890.                     echo "
  891.                     </div>
  892.                     <div>
  893.                         <label class=\"block text-sm font-medium text-slate-700 mb-1\">Note 9</label>
  894.                         ";
  895.                     // line 547
  896.                     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.'547$this->source); })()), "note9", [], "any"falsefalsefalse547), '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.'547$this->source); })()), "min" => 0"max" => 20"step" => 0.5]]);
  897.                     echo "
  898.                     </div>
  899.                 </div>
  900.                 ";
  901.                 }
  902.                 // line 551
  903.                 echo "
  904.                 <div class=\"mt-4 mb-6\">
  905.                     <label class=\"block text-sm font-medium text-slate-700 mb-1\">Commentaire entretien</label>
  906.                     ";
  907.                 // line 554
  908.                 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.'554$this->source); })()), "entcom", [], "any"falsefalsefalse554), '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.'554$this->source); })()), "rows" => 3"placeholder" => "Observations sur l'entretien..."]]);
  909.                 echo "
  910.                 </div>
  911.             ";
  912.             }
  913.             // line 557
  914.             echo "
  915.             <!-- SECTION 4bis: GRILLE D'ÉVALUATION DYNAMIQUE -->
  916.             ";
  917.             // line 559
  918.             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.'559$this->source); })()), "id", [], "any"falsefalsefalse559))) {
  919.                 // line 560
  920.                 echo "                <div id=\"evaluation-section\">
  921.                     <h3 class=\"text-lg font-semibold text-indigo-800 mb-5 flex items-center border-b pb-3\">
  922.                         <div class=\"w-8 h-8 bg-indigo-200 rounded-lg flex items-center justify-center mr-3\">
  923.                             <i class=\"fas fa-clipboard-check text-indigo-700\"></i>
  924.                         </div>
  925.                         Grille d'évaluation dynamique
  926.                     </h3>
  927.                     <!-- Évaluations existantes -->
  928.                     ";
  929.                 // line 569
  930.                 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.'569$this->source); })())) > 0))) {
  931.                     // line 570
  932.                     echo "                    <div class=\"mb-6 space-y-3\" id=\"existing-evaluations\">
  933.                         <p class=\"text-sm font-medium text-slate-600 flex items-center mb-2\">
  934.                             <i class=\"fas fa-history text-indigo-500 mr-2\"></i>
  935.                             Évaluations précédentes
  936.                         </p>
  937.                         ";
  938.                     // line 575
  939.                     $context['_parent'] = $context;
  940.                     $context['_seq'] = twig_ensure_traversable((isset($context["evaluations"]) || array_key_exists("evaluations"$context) ? $context["evaluations"] : (function () { throw new RuntimeError('Variable "evaluations" does not exist.'575$this->source); })()));
  941.                     foreach ($context['_seq'] as $context["_key"] => $context["eval"]) {
  942.                         // line 576
  943.                         echo "                        <div class=\"bg-slate-50 rounded-xl p-4 border border-slate-200\">
  944.                             <div class=\"flex items-center justify-between mb-2\">
  945.                                 <div class=\"flex items-center gap-3\">
  946.                                     <span class=\"font-medium text-slate-800\">";
  947.                         // line 579
  948.                         echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source$context["eval"], "grille", [], "any"falsefalsefalse579), "nom", [], "any"falsefalsefalse579), "html"nulltrue);
  949.                         echo "</span>
  950.                                     <span class=\"text-xs text-slate-500\">";
  951.                         // line 580
  952.                         echo twig_escape_filter($this->envtwig_date_format_filter($this->envtwig_get_attribute($this->env$this->source$context["eval"], "createdAt", [], "any"falsefalsefalse580), "d/m/Y H:i"), "html"nulltrue);
  953.                         echo "</span>
  954.                                 </div>
  955.                                 <div class=\"flex items-center gap-2\">
  956.                                     ";
  957.                         // line 583
  958.                         $context["percentage"] = (((twig_get_attribute($this->env$this->source$context["eval"], "noteMaxTotale", [], "any"falsefalsefalse583) > 0)) ? (((twig_get_attribute($this->env$this->source$context["eval"], "scoreTotal", [], "any"falsefalsefalse583) / twig_get_attribute($this->env$this->source$context["eval"], "noteMaxTotale", [], "any"falsefalsefalse583)) * 100)) : (0));
  959.                         // line 584
  960.                         echo "                                    <span class=\"inline-flex items-center px-3 py-1 rounded-full text-sm font-bold
  961.                                         ";
  962.                         // line 585
  963.                         if (((isset($context["percentage"]) || array_key_exists("percentage"$context) ? $context["percentage"] : (function () { throw new RuntimeError('Variable "percentage" does not exist.'585$this->source); })()) >= 70)) {
  964.                             echo "bg-green-100 text-green-700
  965.                                         ";
  966.                         } elseif ((                        // line 586
  967. (isset($context["percentage"]) || array_key_exists("percentage"$context) ? $context["percentage"] : (function () { throw new RuntimeError('Variable "percentage" does not exist.'586$this->source); })()) >= 40)) {
  968.                             echo "bg-yellow-100 text-yellow-700
  969.                                         ";
  970.                         } else {
  971.                             // line 587
  972.                             echo "bg-red-100 text-red-700";
  973.                         }
  974.                         echo "\">
  975.                                         ";
  976.                         // line 588
  977.                         echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source$context["eval"], "scoreTotal", [], "any"falsefalsefalse588), "html"nulltrue);
  978.                         echo " / ";
  979.                         echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source$context["eval"], "noteMaxTotale", [], "any"falsefalsefalse588), "html"nulltrue);
  980.                         echo "
  981.                                     </span>
  982.                                 </div>
  983.                             </div>
  984.                             <!-- Progress bar -->
  985.                             <div class=\"w-full bg-slate-200 rounded-full h-2.5 mb-2\">
  986.                                 <div class=\"h-2.5 rounded-full transition-all duration-500
  987.                                     ";
  988.                         // line 595
  989.                         if (((isset($context["percentage"]) || array_key_exists("percentage"$context) ? $context["percentage"] : (function () { throw new RuntimeError('Variable "percentage" does not exist.'595$this->source); })()) >= 70)) {
  990.                             echo "bg-green-500
  991.                                     ";
  992.                         } elseif ((                        // line 596
  993. (isset($context["percentage"]) || array_key_exists("percentage"$context) ? $context["percentage"] : (function () { throw new RuntimeError('Variable "percentage" does not exist.'596$this->source); })()) >= 40)) {
  994.                             echo "bg-yellow-500
  995.                                     ";
  996.                         } else {
  997.                             // line 597
  998.                             echo "bg-red-500";
  999.                         }
  1000.                         echo "\" 
  1001.                                     style=\"width: ";
  1002.                         // line 598
  1003.                         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.'598$this->source); })()), "html"nulltrue);
  1004.                         echo "%\"></div>
  1005.                             </div>
  1006.                             ";
  1007.                         // line 600
  1008.                         if (twig_get_attribute($this->env$this->source$context["eval"], "commentaire", [], "any"falsefalsefalse600)) {
  1009.                             // line 601
  1010.                             echo "                            <p class=\"text-xs text-slate-500 mt-1\"><i class=\"fas fa-comment mr-1\"></i> ";
  1011.                             echo twig_escape_filter($this->envtwig_get_attribute($this->env$this->source$context["eval"], "commentaire", [], "any"falsefalsefalse601), "html"nulltrue);
  1012.                             echo "</p>
  1013.                             ";
  1014.                         }
  1015.                         // line 603
  1016.                         echo "                        </div>
  1017.                         ";
  1018.                     }
  1019.                     $_parent $context['_parent'];
  1020.                     unset($context['_seq'], $context['_iterated'], $context['_key'], $context['eval'], $context['_parent'], $context['loop']);
  1021.                     $context array_intersect_key($context$_parent) + $_parent;
  1022.                     // line 605
  1023.                     echo "                    </div>
  1024.                     ";
  1025.                 }
  1026.                 // line 607
  1027.                 echo "
  1028.                     ";
  1029.                 // line 627
  1030.                 echo "
  1031.                     <!-- Zone dynamique des critères -->
  1032.                     <div id=\"criteres-container\" class=\"hidden\">
  1033.                         <div class=\"bg-white rounded-xl border border-slate-200 overflow-hidden mb-4\">
  1034.                             <div class=\"px-5 py-3 bg-slate-50 border-b border-slate-200 flex items-center justify-between\">
  1035.                                 <span class=\"text-sm font-semibold text-slate-700\">
  1036.                                     <i class=\"fas fa-star text-yellow-500 mr-1\"></i>
  1037.                                     Critères d'évaluation
  1038.                                 </span>
  1039.                                 <span id=\"grille-name\" class=\"text-xs text-indigo-600 font-medium\"></span>
  1040.                             </div>
  1041.                             <div class=\"overflow-x-auto\">
  1042.                                 <table class=\"w-full\">
  1043.                                     <thead class=\"bg-slate-50/50\">
  1044.                                         <tr>
  1045.                                             <th class=\"px-5 py-3 text-left text-xs font-semibold text-slate-600 uppercase tracking-wider\">Critère</th>
  1046.                                             <th class=\"px-5 py-3 text-center text-xs font-semibold text-slate-600 uppercase tracking-wider w-28\">Note max</th>
  1047.                                             <th class=\"px-5 py-3 text-center text-xs font-semibold text-slate-600 uppercase tracking-wider w-36\">Note attribuée</th>
  1048.                                         </tr>
  1049.                                     </thead>
  1050.                                     <tbody id=\"criteres-body\" class=\"divide-y divide-slate-100\">
  1051.                                         <!-- Rempli dynamiquement par JS -->
  1052.                                     </tbody>
  1053.                                 </table>
  1054.                             </div>
  1055.                         </div>
  1056.                         <!-- Score total + progress bar -->
  1057.                         <div class=\"bg-white rounded-xl border border-slate-200 p-5 mb-4\">
  1058.                             <div class=\"flex items-center justify-between mb-3\">
  1059.                                 <span class=\"text-sm font-semibold text-slate-700\">
  1060.                                     <i class=\"fas fa-calculator text-indigo-500 mr-1\"></i>
  1061.                                     Score total
  1062.                                 </span>
  1063.                                 <span id=\"score-display\" class=\"text-lg font-bold text-slate-800\">0 / 0</span>
  1064.                             </div>
  1065.                             <div class=\"w-full bg-slate-200 rounded-full h-3\">
  1066.                                 <div id=\"score-bar\" class=\"h-3 rounded-full transition-all duration-300 bg-slate-400\" style=\"width: 0%\"></div>
  1067.                             </div>
  1068.                             <p id=\"score-label\" class=\"text-xs text-slate-500 mt-2 text-center\"></p>
  1069.                         </div>
  1070.                         <!-- Commentaire -->
  1071.                         <div class=\"bg-white rounded-xl border border-slate-200 p-5 mb-4\">
  1072.                             <label class=\"block text-sm font-medium text-slate-700 mb-2\">
  1073.                                 <i class=\"fas fa-comment-alt text-indigo-500 mr-1\"></i>
  1074.                                 Observation du jury
  1075.                             </label>
  1076.                             <textarea id=\"evaluation-commentaire\" rows=\"3\" 
  1077.                                 class=\"";
  1078.                 // line 676
  1079.                 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.'676$this->source); })()), "html"nulltrue);
  1080.                 echo "\" 
  1081.                                 placeholder=\"Saisissez les observations du jury...\"></textarea>
  1082.                         </div>
  1083.                         <!-- Bouton enregistrer -->
  1084.                         <div class=\"flex justify-end\">
  1085.                             <button type=\"button\" id=\"save-evaluation-btn\" 
  1086.                                 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\">
  1087.                                 <i class=\"fas fa-save mr-2\"></i>
  1088.                                 Enregistrer l'évaluation
  1089.                             </button>
  1090.                         </div>
  1091.                         <!-- Message de succès -->
  1092.                         <div id=\"evaluation-success\" class=\"hidden mt-4 p-4 rounded-xl bg-green-50 text-green-800 border border-green-200\">
  1093.                             <div class=\"flex items-center\">
  1094.                                 <i class=\"fas fa-check-circle text-green-500 mr-3 text-lg\"></i>
  1095.                                 <span id=\"evaluation-success-msg\">Évaluation enregistrée avec succès.</span>
  1096.                             </div>
  1097.                         </div>
  1098.                         <!-- Message d'erreur -->
  1099.                         <div id=\"evaluation-error\" class=\"hidden mt-4 p-4 rounded-xl bg-red-50 text-red-800 border border-red-200\">
  1100.                             <div class=\"flex items-center\">
  1101.                                 <i class=\"fas fa-exclamation-circle text-red-500 mr-3 text-lg\"></i>
  1102.                                 <span id=\"evaluation-error-msg\">Erreur lors de l'enregistrement.</span>
  1103.                             </div>
  1104.                         </div>
  1105.                     </div>
  1106.                 </div>
  1107.             ";
  1108.             }
  1109.             // line 707
  1110.             echo "
  1111.             <!-- SECTION 5: Visite médicale et résultat final -->
  1112.             ";
  1113.             // line 709
  1114.             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"))) {
  1115.                 // line 710
  1116.                 echo "                <div class=\"bg-emerald-50 rounded-2xl border border-emerald-200 p-6\">
  1117.                     <h3 class=\"text-lg font-semibold text-emerald-800 mb-5 flex items-center border-b border-emerald-200 pb-3\">
  1118.                         <div class=\"w-8 h-8 bg-emerald-200 rounded-lg flex items-center justify-center mr-3\">
  1119.                             <i class=\"fas fa-hospital text-emerald-700\"></i>
  1120.                         </div>
  1121.                         VISITE MÉDICALE & Résultat final
  1122.                     </h3>
  1123.                     
  1124.                     <div class=\"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4\">
  1125.                         <div>
  1126.                             <label class=\"block text-sm font-medium text-slate-700 mb-1\">Date visite</label>
  1127.                             ";
  1128.                 // line 721
  1129.                 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.'721$this->source); })()), "visdate", [], "any"falsefalsefalse721), '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.'721$this->source); })())]]);
  1130.                 echo "
  1131.                         </div>
  1132.                         <div>
  1133.                             <label class=\"block text-sm font-medium text-slate-700 mb-1\">Lieu visite</label>
  1134.                             ";
  1135.                 // line 725
  1136.                 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.'725$this->source); })()), "vislieu", [], "any"falsefalsefalse725), '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.'725$this->source); })()), "placeholder" => "Ex: Centre médical"]]);
  1137.                 echo "
  1138.                         </div>
  1139.                     </div>
  1140.                     <div class=\"grid grid-cols-1 md:grid-cols-3 gap-4\">
  1141.                         <div>
  1142.                             <label class=\"block text-sm font-medium text-slate-700 mb-1\">Statut visite</label>
  1143.                             ";
  1144.                 // line 732
  1145.                 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.'732$this->source); })()), "visstatut", [], "any"falsefalsefalse732), '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.'732$this->source); })())]]);
  1146.                 echo "
  1147.                         </div>
  1148.                         <div>
  1149.                             <label class=\"block text-sm font-medium text-slate-700 mb-1\">Résultat final</label>
  1150.                             ";
  1151.                 // line 736
  1152.                 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.'736$this->source); })()), "resultat", [], "any"falsefalsefalse736), '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.'736$this->source); })())]]);
  1153.                 echo "
  1154.                         </div>
  1155.                         <div>
  1156.                             <label class=\"block text-sm font-medium text-slate-700 mb-1\">Commentaire</label>
  1157.                             ";
  1158.                 // line 740
  1159.                 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.'740$this->source); })()), "viscom", [], "any"falsefalsefalse740), '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.'740$this->source); })()), "placeholder" => "Commentaire visite..."]]);
  1160.                 echo "
  1161.                         </div>
  1162.                     </div>
  1163.                 </div>
  1164.             ";
  1165.             }
  1166.             // line 745
  1167.             echo "
  1168.             <!-- Boutons d'action -->
  1169.             <div class=\"flex flex-col md:flex-row justify-between items-center gap-4 pt-6 border-t border-slate-200\">
  1170.                 <div class=\"text-sm text-slate-500\">
  1171.                     <i class=\"fas fa-info-circle mr-1\"></i>
  1172.                     Les champs marqués d'une <span class=\"text-red-500\">*</span> sont obligatoires
  1173.                 </div>
  1174.                 
  1175.                 <div class=\"flex gap-3\">
  1176.                     ";
  1177.             // line 754
  1178.             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.'754$this->source); })()), "user", [], "any"falsefalsefalse754)) {
  1179.                 // line 755
  1180.                 echo "                        ";
  1181.                 // line 756
  1182.                 echo "                        ";
  1183.                 $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.'756$this->source); })()), "user", [], "any"falsefalsefalse756), "datenaissance", [], "any"falsefalsefalse756)) ? (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.'756$this->source); })()), "user", [], "any"falsefalsefalse756), "datenaissance", [], "any"falsefalsefalse756))], "method"falsefalsefalse756), "y", [], "any"falsefalsefalse756)) : (null));
  1184.                 // line 757
  1185.                 echo "                        
  1186.                         ";
  1187.                 // line 758
  1188.                 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"))) {
  1189.                     // line 759
  1190.                     echo "                            ";
  1191.                     // line 760
  1192.                     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\">
  1193.                                 <i class=\"fas fa-paper-plane mr-2\"></i>
  1194.                                 Enregistrer l'évaluation
  1195.                             </button>
  1196.                         ";
  1197.                 } elseif (((                // line 764
  1198. (isset($context["age"]) || array_key_exists("age"$context) ? $context["age"] : (function () { throw new RuntimeError('Variable "age" does not exist.'764$this->source); })()) >= 16) && ((isset($context["age"]) || array_key_exists("age"$context) ? $context["age"] : (function () { throw new RuntimeError('Variable "age" does not exist.'764$this->source); })()) <= 40))) {
  1199.                     // line 765
  1200.                     echo "                            ";
  1201.                     // line 766
  1202.                     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\">
  1203.                                 <i class=\"fas fa-paper-plane mr-2\"></i>
  1204.                                 Soumettre ma candidature
  1205.                             </button>
  1206.                         ";
  1207.                 } else {
  1208.                     // line 771
  1209.                     echo "                            ";
  1210.                     // line 772
  1211.                     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\">
  1212.                                 <i class=\"fas fa-ban mr-2\"></i>
  1213.                                 Soumission impossible
  1214.                             </button>
  1215.                         ";
  1216.                 }
  1217.                 // line 777
  1218.                 echo "                    ";
  1219.             } else {
  1220.                 // line 778
  1221.                 echo "                        ";
  1222.                 $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 779
  1223. (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'779$this->source); })()), "request", [], "any"falsefalsefalse779), "get", [=> "etablissement"], "method"falsefalsefalse779), "metier" => twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source,                 // line 780
  1224. (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'780$this->source); })()), "request", [], "any"falsefalsefalse780), "get", [=> "metier"], "method"falsefalsefalse780)]);
  1225.                 // line 782
  1226.                 echo "                        
  1227.                         <a href=\"";
  1228.                 // line 783
  1229.                 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.'783$this->source); })())]), "html"nulltrue);
  1230.                 echo "\" 
  1231.                            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\">
  1232.                             <i class=\"fas fa-sign-in-alt mr-2\"></i>
  1233.                             Se connecter pour postuler
  1234.                         </a>
  1235.                     ";
  1236.             }
  1237.             // line 789
  1238.             echo "                </div>
  1239.             </div>
  1240.             ";
  1241.             // line 792
  1242.             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.'792$this->source); })()), 'form_end');
  1243.             echo "
  1244.         </div>
  1245.     </div>
  1246.     ";
  1247.         }
  1248.         // line 797
  1249.         echo "</div>
  1250. <!-- JavaScript pour la gestion dynamique établissement/métier -->
  1251. <script>
  1252. document.addEventListener('DOMContentLoaded', function() {
  1253.     const etablissementSelect = document.getElementById('candidature_etablissement');
  1254.     const metierSelect = document.getElementById('candidature_metier');
  1255.     const metierInfo = document.getElementById('metier-info');
  1256.     const metierSecteur = document.getElementById('metier-secteur');
  1257.     const metierNiveau = document.getElementById('metier-niveau');
  1258.     const metierNbrPlace = document.getElementById('metier-nbrplace');
  1259.     const metierDuree = document.getElementById('metier-duree');
  1260.     const etablissementLoading = document.getElementById('etablissement-loading');
  1261.     const metierLoading = document.getElementById('metier-loading');
  1262.     
  1263.     const currentMetierValue = metierSelect.value;
  1264.     function loadMetiers(etablissementId, callback) {
  1265.         if (!etablissementId) {
  1266.             metierSelect.innerHTML = '<option value=\"\">-- Choisissez d\\'abord un établissement --</option>';
  1267.             metierSelect.disabled = true;
  1268.             metierInfo.classList.add('hidden');
  1269.             if (callback) callback();
  1270.             return;
  1271.         }
  1272.         metierLoading.classList.remove('hidden');
  1273.         metierSelect.disabled = true;
  1274.         fetch('/candidature/etablissement/' + etablissementId + '/metiers')
  1275.             .then(response => response.json())
  1276.             .then(data => {
  1277.                 metierSelect.innerHTML = '<option value=\"\">-- Sélectionnez un métier --</option>';
  1278.                 
  1279.                 const grouped = {};
  1280.                 data.forEach(metier => {
  1281.                     const secteur = metier.secteur_nom || 'Autres';
  1282.                     if (!grouped[secteur]) {
  1283.                         grouped[secteur] = [];
  1284.                     }
  1285.                     grouped[secteur].push(metier);
  1286.                 });
  1287.                 
  1288.                 for (const [secteur, metiers] of Object.entries(grouped)) {
  1289.                     const optgroup = document.createElement('optgroup');
  1290.                     optgroup.label = secteur;
  1291.                     
  1292.                     metiers.sort((a, b) => a.nom.localeCompare(b.nom));
  1293.                     metiers.forEach(metier => {
  1294.                         const option = document.createElement('option');
  1295.                         option.value = metier.id;
  1296.                         option.dataset.secteur = metier.secteur_nom || '';
  1297.                         option.dataset.niveau = metier.niveau || '';
  1298.                         option.dataset.duree = metier.duree || '';
  1299.                         option.dataset.nbrplace = metier.nbrplace || '';
  1300.                         let label = metier.nom;
  1301.                         if (metier.nbrplace) {
  1302.                             label += ' (' + metier.nbrplace + ' places)';
  1303.                         }
  1304.                         option.textContent = label;
  1305.                         optgroup.appendChild(option);
  1306.                     });
  1307.                     
  1308.                     metierSelect.appendChild(optgroup);
  1309.                 }
  1310.                 
  1311.                 const metierToSelect = currentMetierValue || '";
  1312.         // line 863
  1313.         echo twig_escape_filter($this->env, ((twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, ($context["app"] ?? null), "request", [], "any"falsetruefalse863), "get", [=> "metier"], "method"truetruefalse863)) ? (_twig_default_filter(twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, ($context["app"] ?? null), "request", [], "any"falsetruefalse863), "get", [=> "metier"], "method"falsefalsefalse863), "")) : ("")), "html"nulltrue);
  1314.         echo "';
  1315.                 
  1316.                 if (metierToSelect) {
  1317.                     const options = metierSelect.options;
  1318.                     for (let i = 0; i < options.length; i++) {
  1319.                         if (options[i].value == metierToSelect) {
  1320.                             options[i].selected = true;
  1321.                             updateMetierInfo(options[i]);
  1322.                             break;
  1323.                         }
  1324.                     }
  1325.                 }
  1326.                 
  1327.                 metierSelect.disabled = false;
  1328.                 metierLoading.classList.add('hidden');
  1329.                 
  1330.                 if (callback) callback();
  1331.             })
  1332.             .catch(error => {
  1333.                 console.error('Erreur:', error);
  1334.                 metierSelect.disabled = false;
  1335.                 metierLoading.classList.add('hidden');
  1336.                 if (callback) callback();
  1337.             });
  1338.     }
  1339.     function updateMetierInfo(selectedOption) {
  1340.         if (!selectedOption || !selectedOption.value) {
  1341.             metierInfo.classList.add('hidden');
  1342.             return;
  1343.         }
  1344.         
  1345.         metierSecteur.textContent = selectedOption.dataset.secteur || 'Non spécifié';
  1346.         metierNiveau.textContent = selectedOption.dataset.niveau || 'Non spécifié';
  1347.         metierDuree.textContent = selectedOption.dataset.duree || 'Non spécifié';
  1348.         metierNbrPlace.textContent = selectedOption.dataset.nbrplace || 'Non spécifié';
  1349.         metierInfo.classList.remove('hidden');
  1350.     }
  1351.     ";
  1352.         // line 902
  1353.         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.'902$this->source); })()), "request", [], "any"falsefalsefalse902), "get", [=> "etablissement"], "method"falsefalsefalse902)) {
  1354.             // line 903
  1355.             echo "        const etablissementId = '";
  1356.             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.'903$this->source); })()), "request", [], "any"falsefalsefalse903), "get", [=> "etablissement"], "method"falsefalsefalse903), "html"nulltrue);
  1357.             echo "';
  1358.         if (etablissementId) {
  1359.             setTimeout(function() {
  1360.                 const options = etablissementSelect.options;
  1361.                 for (let i = 0; i < options.length; i++) {
  1362.                     if (options[i].value == etablissementId) {
  1363.                         options[i].selected = true;
  1364.                         break;
  1365.                     }
  1366.                 }
  1367.                 loadMetiers(etablissementId);
  1368.             }, 100);
  1369.         }
  1370.     ";
  1371.         } else {
  1372.             // line 917
  1373.             echo "        if (etablissementSelect.value) {
  1374.             loadMetiers(etablissementSelect.value);
  1375.         } else {
  1376.             metierSelect.innerHTML = '<option value=\"\">-- Choisissez d\\'abord un établissement --</option>';
  1377.             metierSelect.disabled = true;
  1378.         }
  1379.     ";
  1380.         }
  1381.         // line 924
  1382.         echo "
  1383.     etablissementSelect.addEventListener('change', function() {
  1384.         loadMetiers(this.value);
  1385.         metierInfo.classList.add('hidden');
  1386.     });
  1387.     metierSelect.addEventListener('change', function() {
  1388.         const selectedOption = this.options[this.selectedIndex];
  1389.         updateMetierInfo(selectedOption);
  1390.     });
  1391.     const form = document.getElementById('candidature-form');
  1392.     form.addEventListener('submit', function(e) {
  1393.         ";
  1394.         // line 937
  1395.         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.'937$this->source); })()), "user", [], "any"falsefalsefalse937)) {
  1396.             // line 938
  1397.             echo "        e.preventDefault();
  1398.         alert('Vous devez être connecté pour soumettre une candidature.');
  1399.         const redirectUrl = '/candidature/new?etablissement=' + etablissementSelect.value + '&metier=' + metierSelect.value;
  1400.         window.location.href = '/login?redirect=' + encodeURIComponent(redirectUrl);
  1401.         return false;
  1402.         ";
  1403.         }
  1404.         // line 944
  1405.         echo "
  1406.         ";
  1407.         // line 946
  1408.         echo "        ";
  1409.         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.'946$this->source); })()), "user", [], "any"falsefalsefalse946) && 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.'946$this->source); })()), "user", [], "any"falsefalsefalse946), "datenaissance", [], "any"falsefalsefalse946))) {
  1410.             // line 947
  1411.             echo "            ";
  1412.             $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.'947$this->source); })()), "user", [], "any"falsefalsefalse947), "datenaissance", [], "any"falsefalsefalse947))], "method"falsefalsefalse947), "y", [], "any"falsefalsefalse947);
  1413.             // line 948
  1414.             echo "            ";
  1415.             if ((((isset($context["age"]) || array_key_exists("age"$context) ? $context["age"] : (function () { throw new RuntimeError('Variable "age" does not exist.'948$this->source); })()) < 16) || ((isset($context["age"]) || array_key_exists("age"$context) ? $context["age"] : (function () { throw new RuntimeError('Variable "age" does not exist.'948$this->source); })()) > 40))) {
  1416.                 // line 949
  1417.                 echo "                e.preventDefault();
  1418.                 alert('Vous ne remplissez pas les conditions d\\'âge pour candidater (16 à 40 ans).');
  1419.                 return false;
  1420.             ";
  1421.             }
  1422.             // line 953
  1423.             echo "        ";
  1424.         }
  1425.         // line 954
  1426.         echo "
  1427.         if (!etablissementSelect.value) {
  1428.             e.preventDefault();
  1429.             alert('Veuillez sélectionner un établissement.');
  1430.             return false;
  1431.         }
  1432.         
  1433.         if (!metierSelect.value) {
  1434.             e.preventDefault();
  1435.             alert('Veuillez sélectionner un métier.');
  1436.             return false;
  1437.         }
  1438.     });
  1439. });
  1440. </script>
  1441. <!-- JavaScript pour la grille d'évaluation dynamique -->
  1442. ";
  1443.         // line 971
  1444.         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.'971$this->source); })()), "id", [], "any"falsefalsefalse971))) {
  1445.             // line 972
  1446.             echo "<script>
  1447. document.addEventListener('DOMContentLoaded', function() {
  1448.     const grilleSelect = document.getElementById('grille-select');
  1449.     const criteresContainer = document.getElementById('criteres-container');
  1450.     const criteresBody = document.getElementById('criteres-body');
  1451.     const grilleName = document.getElementById('grille-name');
  1452.     const scoreDisplay = document.getElementById('score-display');
  1453.     const scoreBar = document.getElementById('score-bar');
  1454.     const scoreLabel = document.getElementById('score-label');
  1455.     const saveBtn = document.getElementById('save-evaluation-btn');
  1456.     const commentaireField = document.getElementById('evaluation-commentaire');
  1457.     const successDiv = document.getElementById('evaluation-success');
  1458.     const errorDiv = document.getElementById('evaluation-error');
  1459.     const successMsg = document.getElementById('evaluation-success-msg');
  1460.     const errorMsg = document.getElementById('evaluation-error-msg');
  1461.     if (!grilleSelect) return;
  1462.     const candidatureId = ";
  1463.             // line 990
  1464.             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.'990$this->source); })()), "id", [], "any"falsefalsefalse990), "html"nulltrue);
  1465.             echo ";
  1466.     let currentGrilleId = null;
  1467.     let noteMaxTotale = 0;
  1468.     // Charger les critères quand on sélectionne une grille
  1469.     grilleSelect.addEventListener('change', function() {
  1470.         const grilleId = this.value;
  1471.         if (!grilleId) {
  1472.             criteresContainer.classList.add('hidden');
  1473.             currentGrilleId = null;
  1474.             return;
  1475.         }
  1476.         currentGrilleId = grilleId;
  1477.         loadCriteres(grilleId);
  1478.     });
  1479.     function loadCriteres(grilleId) {
  1480.         fetch('/evaluation/grille/' + grilleId + '/criteres')
  1481.             .then(r => r.json())
  1482.             .then(data => {
  1483.                 criteresBody.innerHTML = '';
  1484.                 noteMaxTotale = data.grille.noteMaxTotale;
  1485.                 grilleName.textContent = data.grille.nom;
  1486.                 data.criteres.forEach(critere => {
  1487.                     const tr = document.createElement('tr');
  1488.                     tr.className = 'hover:bg-slate-50/50 transition';
  1489.                     tr.innerHTML = `
  1490.                         <td class=\"px-5 py-3\">
  1491.                             <div>
  1492.                                 <span class=\"font-medium text-slate-800 text-sm\">\${critere.nom}</span>
  1493.                                 \${critere.description ? '<p class=\"text-xs text-slate-500 mt-0.5\">' + critere.description + '</p>' : ''}
  1494.                             </div>
  1495.                         </td>
  1496.                         <td class=\"px-5 py-3 text-center\">
  1497.                             <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>
  1498.                         </td>
  1499.                         <td class=\"px-5 py-3 text-center\">
  1500.                             <input type=\"number\" 
  1501.                                 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\"
  1502.                                 data-critere-id=\"\${critere.id}\" 
  1503.                                 data-note-max=\"\${critere.noteMax}\"
  1504.                                 min=\"0\" 
  1505.                                 max=\"\${critere.noteMax}\" 
  1506.                                 step=\"0.5\" 
  1507.                                 placeholder=\"...\"
  1508.                             >
  1509.                         </td>
  1510.                     `;
  1511.                     criteresBody.appendChild(tr);
  1512.                 });
  1513.                 criteresContainer.classList.remove('hidden');
  1514.                 updateScore();
  1515.                 // Charger les notes existantes
  1516.                 loadExistingEvaluation(grilleId);
  1517.                 // Ajouter les écouteurs sur les champs de notes
  1518.                 document.querySelectorAll('.note-input').forEach(input => {
  1519.                     input.addEventListener('input', function() {
  1520.                         const max = parseFloat(this.dataset.noteMax);
  1521.                         let val = parseFloat(this.value);
  1522.                         if (val > max) { this.value = max; }
  1523.                         if (val < 0) { this.value = 0; }
  1524.                         updateScore();
  1525.                     });
  1526.                 });
  1527.             })
  1528.             .catch(err => {
  1529.                 console.error('Erreur chargement critères:', err);
  1530.             });
  1531.     }
  1532.     function loadExistingEvaluation(grilleId) {
  1533.         fetch('/evaluation/candidature/' + candidatureId + '/evaluation')
  1534.             .then(r => r.json())
  1535.             .then(evaluations => {
  1536.                 const existing = evaluations.find(e => e.grilleId == grilleId);
  1537.                 if (existing) {
  1538.                     existing.notations.forEach(n => {
  1539.                         const input = document.querySelector(`.note-input[data-critere-id=\"\${n.critereId}\"]`);
  1540.                         if (input && n.note !== null) {
  1541.                             input.value = n.note;
  1542.                         }
  1543.                     });
  1544.                     if (existing.commentaire) {
  1545.                         commentaireField.value = existing.commentaire;
  1546.                     }
  1547.                     updateScore();
  1548.                 }
  1549.             })
  1550.             .catch(err => console.error('Erreur chargement évaluation:', err));
  1551.     }
  1552.     function updateScore() {
  1553.         let total = 0;
  1554.         document.querySelectorAll('.note-input').forEach(input => {
  1555.             const val = parseFloat(input.value);
  1556.             if (!isNaN(val)) total += val;
  1557.         });
  1558.         scoreDisplay.textContent = total + ' / ' + noteMaxTotale;
  1559.         const percentage = noteMaxTotale > 0 ? (total / noteMaxTotale * 100) : 0;
  1560.         scoreBar.style.width = percentage + '%';
  1561.         // Couleur de la barre de progression
  1562.         scoreBar.classList.remove('bg-green-500', 'bg-yellow-500', 'bg-red-500', 'bg-slate-400');
  1563.         if (percentage >= 70) {
  1564.             scoreBar.classList.add('bg-green-500');
  1565.             scoreLabel.textContent = 'Excellent';
  1566.             scoreLabel.className = 'text-xs mt-2 text-center text-green-600 font-medium';
  1567.         } else if (percentage >= 40) {
  1568.             scoreBar.classList.add('bg-yellow-500');
  1569.             scoreLabel.textContent = 'Moyen';
  1570.             scoreLabel.className = 'text-xs mt-2 text-center text-yellow-600 font-medium';
  1571.         } else if (total > 0) {
  1572.             scoreBar.classList.add('bg-red-500');
  1573.             scoreLabel.textContent = 'Faible';
  1574.             scoreLabel.className = 'text-xs mt-2 text-center text-red-600 font-medium';
  1575.         } else {
  1576.             scoreBar.classList.add('bg-slate-400');
  1577.             scoreLabel.textContent = '';
  1578.         }
  1579.     }
  1580.     // Enregistrer l'évaluation
  1581.     saveBtn.addEventListener('click', function() {
  1582.         if (!currentGrilleId) return;
  1583.         successDiv.classList.add('hidden');
  1584.         errorDiv.classList.add('hidden');
  1585.         const notations = [];
  1586.         document.querySelectorAll('.note-input').forEach(input => {
  1587.             notations.push({
  1588.                 critereId: parseInt(input.dataset.critereId),
  1589.                 note: input.value !== '' ? parseFloat(input.value) : null,
  1590.             });
  1591.         });
  1592.         const payload = {
  1593.             grilleId: parseInt(currentGrilleId),
  1594.             notations: notations,
  1595.             commentaire: commentaireField.value || null,
  1596.         };
  1597.         saveBtn.disabled = true;
  1598.         saveBtn.innerHTML = '<i class=\"fas fa-spinner fa-spin mr-2\"></i> Enregistrement...';
  1599.         fetch('/evaluation/candidature/' + candidatureId + '/evaluer', {
  1600.             method: 'POST',
  1601.             headers: { 'Content-Type': 'application/json' },
  1602.             body: JSON.stringify(payload),
  1603.         })
  1604.         .then(r => r.json())
  1605.         .then(data => {
  1606.             if (data.success) {
  1607.                 successMsg.textContent = data.message;
  1608.                 successDiv.classList.remove('hidden');
  1609.                 errorDiv.classList.add('hidden');
  1610.                 // Mettre à jour l'affichage du score
  1611.                 scoreDisplay.textContent = data.scoreTotal + ' / ' + data.noteMaxTotale;
  1612.             } else {
  1613.                 errorMsg.textContent = data.error || 'Erreur inconnue.';
  1614.                 errorDiv.classList.remove('hidden');
  1615.                 successDiv.classList.add('hidden');
  1616.             }
  1617.         })
  1618.         .catch(err => {
  1619.             console.error('Erreur:', err);
  1620.             errorMsg.textContent = 'Erreur réseau lors de l\\'enregistrement.';
  1621.             errorDiv.classList.remove('hidden');
  1622.             successDiv.classList.add('hidden');
  1623.         })
  1624.         .finally(() => {
  1625.             saveBtn.disabled = false;
  1626.             saveBtn.innerHTML = '<i class=\"fas fa-save mr-2\"></i> Enregistrer l\\'évaluation';
  1627.         });
  1628.     });
  1629. });
  1630. </script>
  1631. ";
  1632.         }
  1633.         
  1634.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  1635.         
  1636.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  1637.     }
  1638.     public function getTemplateName()
  1639.     {
  1640.         return "candidature/form.html.twig";
  1641.     }
  1642.     public function isTraitable()
  1643.     {
  1644.         return false;
  1645.     }
  1646.     public function getDebugInfo()
  1647.     {
  1648.         return array (  1523 => 990,  1503 => 972,  1501 => 971,  1482 => 954,  1479 => 953,  1473 => 949,  1470 => 948,  1467 => 947,  1464 => 946,  1461 => 944,  1453 => 938,  1451 => 937,  1436 => 924,  1427 => 917,  1409 => 903,  1407 => 902,  1365 => 863,  1297 => 797,  1289 => 792,  1284 => 789,  1275 => 783,  1272 => 782,  1270 => 780,  1269 => 779,  1267 => 778,  1264 => 777,  1257 => 772,  1255 => 771,  1248 => 766,  1246 => 765,  1244 => 764,  1238 => 760,  1236 => 759,  1234 => 758,  1231 => 757,  1228 => 756,  1226 => 755,  1224 => 754,  1213 => 745,  1205 => 740,  1198 => 736,  1191 => 732,  1181 => 725,  1174 => 721,  1161 => 710,  1159 => 709,  1155 => 707,  1121 => 676,  1070 => 627,  1067 => 607,  1063 => 605,  1056 => 603,  1050 => 601,  1048 => 600,  1043 => 598,  1038 => 597,  1033 => 596,  1029 => 595,  1017 => 588,  1012 => 587,  1007 => 586,  1003 => 585,  1000 => 584,  998 => 583,  992 => 580,  988 => 579,  983 => 576,  979 => 575,  972 => 570,  970 => 569,  959 => 560,  957 => 559,  953 => 557,  947 => 554,  942 => 551,  935 => 547,  928 => 543,  921 => 539,  914 => 535,  907 => 531,  900 => 527,  893 => 523,  886 => 519,  879 => 515,  874 => 512,  872 => 511,  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,);
  1649.     }
  1650.     public function getSourceContext()
  1651.     {
  1652.         return new Source("{% extends 'base.html.twig' %}
  1653. {% block title %}Nouvelle candidature | DAIP{% endblock %}
  1654. {# Définition de la classe CSS réutilisable #}
  1655. {% 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' %}
  1656. {% set is_edit_page = app.request.attributes.get('_route') == 'app_candidature_edit' %}
  1657. {% block body %}
  1658. {# Flash messages #}
  1659. {% for label, messages in app.flashes %}
  1660.     {% for message in messages %}
  1661.         <div class=\"mb-4 p-4 rounded-lg border
  1662.             {% if label == 'error' %}
  1663.                 bg-red-50 border-red-200 text-red-800
  1664.             {% elseif label == 'success' %}
  1665.                 bg-green-50 border-green-200 text-green-800
  1666.             {% else %}
  1667.                 bg-blue-50 border-blue-200 text-blue-800
  1668.             {% endif %}
  1669.         \">
  1670.             {{ message|raw }}
  1671.         </div>
  1672.     {% endfor %}
  1673. {% endfor %}
  1674. <div class=\"bg-gradient-to-r from-indigo-600 to-purple-600 p-8 mb-8 text-white\">
  1675.     <div class=\"flex items-center gap-4 mb-4\">
  1676.         <div class=\"w-16 h-16 bg-white/20 rounded-full flex items-center justify-center\">
  1677.             <i class=\"fas fa-file-alt text-3xl\"></i>
  1678.         </div>
  1679.         <div>
  1680.             <h1 class=\"text-2xl font-bold\">
  1681.                 {% if is_edit_page %}Modification de candidature{% else %}Nouvelle candidature{% endif %}
  1682.             </h1>
  1683.             <p class=\"text-white/80\">
  1684.                 {% 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 %}
  1685.             </p>
  1686.         </div>
  1687.     </div>
  1688.     
  1689.     <!-- Informations du candidat -->
  1690.     {% if app.user %}
  1691.         {% if is_granted('ROLE_ENT') and is_edit_page and candidature is defined %}
  1692.             <div class=\"mt-4 grid grid-cols-1 lg:grid-cols-2 gap-4\">
  1693.                 <div class=\"bg-white/10 backdrop-blur-sm rounded-xl p-4 border border-white/20\">
  1694.                     <p class=\"text-sm font-semibold text-white/80 mb-3 flex items-center\">
  1695.                         <i class=\"fas fa-user-graduate mr-2\"></i>
  1696.                         Informations du candidat
  1697.                     </p>
  1698.                     <div class=\"space-y-3\">
  1699.                         <div class=\"bg-white/10 rounded-lg px-3 py-2\">
  1700.                             <p class=\"text-xs uppercase tracking-wide text-white/70\">Nom du candidat</p>
  1701.                             <p class=\"text-sm font-semibold text-white mt-1\">{{ candidature.user ? (candidature.user.nom ~ ' ' ~ candidature.user.prenoms)|trim : 'Non renseigne' }}</p>
  1702.                         </div>
  1703.                         <div class=\"bg-white/10 rounded-lg px-3 py-2\">
  1704.                             <p class=\"text-xs uppercase tracking-wide text-white/70\">Numero de candidature</p>
  1705.                             <p class=\"text-sm font-semibold text-white mt-1\">{{ candidature.numero|default('Non attribue') }}</p>
  1706.                         </div>
  1707.                     </div>
  1708.                 </div>
  1709.                 <div class=\"bg-white/10 backdrop-blur-sm rounded-xl p-4 border border-white/20\">
  1710.                     <p class=\"text-sm font-semibold text-white/80 mb-3 flex items-center\">
  1711.                         <i class=\"fas fa-file-signature mr-2\"></i>
  1712.                         Informations de la candidature
  1713.                     </p>
  1714.                     <div class=\"space-y-3\">
  1715.                         <div class=\"bg-white/10 rounded-lg px-3 py-2\">
  1716.                             <p class=\"text-xs uppercase tracking-wide text-white/70\">Etablissement choisi</p>
  1717.                             <p class=\"text-sm font-semibold text-white mt-1\">{{ candidature.etablissement ? candidature.etablissement.nom : 'Non renseigne' }}</p>
  1718.                         </div>
  1719.                         <div class=\"bg-white/10 rounded-lg px-3 py-2\">
  1720.                             <p class=\"text-xs uppercase tracking-wide text-white/70\">Metier choisi</p>
  1721.                             <p class=\"text-sm font-semibold text-white mt-1\">{{ candidature.metier ? candidature.metier.nom : 'Non renseigne' }}</p>
  1722.                         </div>
  1723.                     </div>
  1724.                 </div>
  1725.             </div>
  1726.         {% else %}
  1727.             <div class=\"bg-white/10 backdrop-blur-sm rounded-xl p-4 mt-4\">
  1728.                 <div class=\"flex items-center gap-3\">
  1729.                     <div class=\"w-10 h-10 bg-white/20 rounded-full flex items-center justify-center\">
  1730.                         <i class=\"fas fa-user\"></i>
  1731.                     </div>
  1732.                     <div>
  1733.                         <p class=\"text-sm text-white/80\">Candidat</p>
  1734.                         <p class=\"font-semibold\">{{ app.user.nom }} {{ app.user.prenoms }}</p>
  1735.                     </div>
  1736.                     {# Calcul et affichage de l'âge #}
  1737.                     {% if app.user.datenaissance %}
  1738.                         {% set age = date().diff(date(app.user.datenaissance)).y %}
  1739.                         <div class=\"ml-4 px-3 py-1 bg-white/20 rounded-full\">
  1740.                             <span class=\"text-sm\">
  1741.                                 <i class=\"fas fa-birthday-cake mr-1\"></i>
  1742.                                 {{ age }} ans
  1743.                             </span>
  1744.                         </div>
  1745.                     {% endif %}
  1746.                     <div class=\"ml-auto\">
  1747.                         <span class=\"px-3 py-1 bg-white/20 rounded-full text-sm\">{{ app.user.email }}</span>
  1748.                         <span class=\"ml-2 px-3 py-1 bg-indigo-500 rounded-full text-xs\">
  1749.                             {% if is_granted('ROLE_ADMIN') %}ADMIN
  1750.                             {% elseif is_granted('ROLE_ENT') %}ENT
  1751.                             {% elseif is_granted('ROLE_JURY') %}JURY
  1752.                             {% elseif is_granted('ROLE_CANDIDAT') %}CANDIDAT
  1753.                             {% endif %}
  1754.                         </span>
  1755.                     </div>
  1756.                 </div>
  1757.             </div>
  1758.         {% endif %}
  1759.     {% endif %}
  1760.     
  1761.     {# Vérification d'âge #}
  1762.     {% if app.user and app.user.datenaissance %}
  1763.         {% set age = date().diff(date(app.user.datenaissance)).y %}
  1764.         {% if age < 16 or age > 40 %}
  1765.             <div class=\"mt-4 bg-red-500/20 backdrop-blur-sm border border-red-500/30 rounded-xl p-4\">
  1766.                 <div class=\"flex items-center gap-3\">
  1767.                     <div class=\"w-10 h-10 bg-red-500/30 rounded-full flex items-center justify-center\">
  1768.                         <i class=\"fas fa-exclamation-triangle text-red-300\"></i>
  1769.                     </div>
  1770.                     <div>
  1771.                         <p class=\"font-semibold text-white\">Âge non conforme</p>
  1772.                         <p class=\"text-sm text-white/80\">
  1773.                             {% if age < 16 %}
  1774.                                 Vous avez {{ age }} ans. L'âge minimum requis pour candidater est de 16 ans.
  1775.                             {% elseif age > 40 %}
  1776.                                 Vous avez {{ age }} ans. L'âge maximum autorisé pour candidater est de 40 ans.
  1777.                             {% endif %}
  1778.                         </p>
  1779.                     </div>
  1780.                 </div>
  1781.             </div>
  1782.         {% endif %}
  1783.     {% endif %}
  1784. </div>
  1785. <div class=\"max-w-7xl mx-auto px-4 pb-16 {{ is_edit_page ? 'pt-2' : '' }}\">
  1786.     {% include 'partials/_flash_messages.html.twig' %}
  1787.     {% if is_edit_page and candidature is defined and candidature.id %}
  1788.         {# ===== PARTIE 1 : MISE À JOUR DES INFORMATIONS ===== #}
  1789.         <div class=\"bg-white rounded-2xl shadow-xl border border-slate-200 overflow-hidden mb-8\">
  1790.             <div class=\"p-6 md:p-8\">
  1791.                 <div class=\"rounded-xl border border-indigo-200 bg-indigo-50 p-4 md:p-5 mb-8\">
  1792.                     <div class=\"flex flex-col md:flex-row md:items-center md:justify-between gap-2\">
  1793.                         <div>
  1794.                             <p class=\"text-sm font-semibold text-indigo-800 flex items-center\">
  1795.                                 <i class=\"fas fa-edit mr-2\"></i> Partie 1 — Mise à jour des informations
  1796.                             </p>
  1797.                             <p class=\"text-sm text-indigo-700 mt-1\">Modifiez les informations du candidat, le métier et les documents.</p>
  1798.                         </div>
  1799.                         <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\">
  1800.                             N° {{ candidature.numero|default('Non attribué') }}
  1801.                         </span>
  1802.                     </div>
  1803.                 </div>
  1804.                 <form id=\"form-update-info\" action=\"{{ path('app_candidature_update_info', {id: candidature.id}) }}\" method=\"POST\" enctype=\"multipart/form-data\" class=\"space-y-10\">
  1805.                     <input type=\"hidden\" name=\"_token\" value=\"{{ csrf_token('candidature_update_info_' ~ candidature.id) }}\">
  1806.                     {# Identité du candidat (ENT/ADMIN) #}
  1807.                     {% if is_granted('ROLE_ENT') or is_granted('ROLE_ADMIN') %}
  1808.                         <div class=\"rounded-xl border border-orange-200 bg-orange-50 p-5\">
  1809.                             <h3 class=\"text-base font-semibold text-orange-800 mb-4 flex items-center\">
  1810.                                 <div class=\"w-7 h-7 bg-orange-200 rounded-lg flex items-center justify-center mr-2\">
  1811.                                     <i class=\"fas fa-user-edit text-orange-700 text-sm\"></i>
  1812.                                 </div>
  1813.                                 Identité du candidat
  1814.                             </h3>
  1815.                             <div class=\"grid grid-cols-1 md:grid-cols-2 gap-4\">
  1816.                                 <div>
  1817.                                     <label class=\"block text-sm font-medium text-slate-700 mb-1\">Nom <span class=\"text-red-500\">*</span></label>
  1818.                                     <input type=\"text\" name=\"nom\" value=\"{{ candidature.user ? candidature.user.nom : '' }}\" class=\"{{ input_class }}\" placeholder=\"Nom de famille\">
  1819.                                 </div>
  1820.                                 <div>
  1821.                                     <label class=\"block text-sm font-medium text-slate-700 mb-1\">Prénom(s) <span class=\"text-red-500\">*</span></label>
  1822.                                     <input type=\"text\" name=\"prenoms\" value=\"{{ candidature.user ? candidature.user.prenoms : '' }}\" class=\"{{ input_class }}\" placeholder=\"Prénom(s)\">
  1823.                                 </div>
  1824.                                 <div class=\"md:col-span-2\">
  1825.                                     <label class=\"block text-sm font-medium text-slate-700 mb-1\">Contact (téléphone)</label>
  1826.                                     <input type=\"text\" name=\"contact\" value=\"{{ candidature.user ? candidature.user.contact : '' }}\" class=\"{{ input_class }}\" placeholder=\"Ex: 0102030405\">
  1827.                                 </div>
  1828.                             </div>
  1829.                         </div>
  1830.                     {% endif %}
  1831.                     {# Formation souhaitée #}
  1832.                     <h3 class=\"text-lg font-semibold text-indigo-800 flex items-center border-b pb-3 mb-5\">
  1833.                         <div class=\"w-8 h-8 bg-indigo-200 rounded-lg flex items-center justify-center mr-3\">
  1834.                             <i class=\"fas fa-graduation-cap text-indigo-700\"></i>
  1835.                         </div>
  1836.                         Formation souhaitée
  1837.                     </h3>
  1838.                     <div class=\"grid grid-cols-1 md:grid-cols-2 gap-6\">
  1839.                         <div>
  1840.                             <label class=\"block text-sm font-medium text-slate-700 mb-1\">Établissement <span class=\"text-red-500\">*</span></label>
  1841.                             <div class=\"{{ input_class }} bg-slate-100 text-slate-600 cursor-default flex items-center gap-2\">
  1842.                                 <i class=\"fas fa-lock text-slate-400 text-xs\"></i>
  1843.                                 {{ candidature.etablissement ? candidature.etablissement.nom : 'Non renseigné' }}
  1844.                             </div>
  1845.                             <input type=\"hidden\" id=\"candidature_etablissement\" value=\"{{ candidature.etablissement ? candidature.etablissement.id : '' }}\">
  1846.                         </div>
  1847.                         <div>
  1848.                             <label class=\"block text-sm font-medium text-slate-700 mb-1\">Métier <span class=\"text-red-500\">*</span></label>
  1849.                             <select name=\"metier_id\" id=\"candidature_metier\" required class=\"{{ input_class }}\">
  1850.                                 {% if candidature.metier %}
  1851.                                     <option value=\"{{ candidature.metier.id }}\" selected>{{ candidature.metier.nom }}</option>
  1852.                                 {% else %}
  1853.                                     <option value=\"\">-- Sélectionnez un métier --</option>
  1854.                                 {% endif %}
  1855.                             </select>
  1856.                             <div id=\"metier-loading\" class=\"hidden text-sm text-indigo-600 mt-1\">
  1857.                                 <i class=\"fas fa-spinner fa-spin mr-1\"></i> Chargement...
  1858.                             </div>
  1859.                         </div>
  1860.                     </div>
  1861.                     {# Informations détaillées du métier #}
  1862.                     <div id=\"metier-info\" class=\"hidden mt-6\">
  1863.                         <div class=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-3\">
  1864.                             <div class=\"flex items-center gap-3 p-2 bg-indigo-100 rounded-lg\">
  1865.                                 <i class=\"fas fa-building text-indigo-600\"></i>
  1866.                                 <div>
  1867.                                     <p class=\"text-xs text-indigo-600\">Secteur</p>
  1868.                                     <p id=\"metier-secteur\" class=\"text-sm font-medium\">-</p>
  1869.                                 </div>
  1870.                             </div>
  1871.                             <div class=\"flex items-center gap-3 p-2 bg-purple-100 rounded-lg\">
  1872.                                 <i class=\"fas fa-users text-purple-600\"></i>
  1873.                                 <div>
  1874.                                     <p class=\"text-xs text-purple-600\">Places</p>
  1875.                                     <p id=\"metier-nbrplace\" class=\"text-sm font-medium\">-</p>
  1876.                                 </div>
  1877.                             </div>
  1878.                             <div class=\"flex items-center gap-3 p-2 bg-green-100 rounded-lg\">
  1879.                                 <i class=\"fas fa-graduation-cap text-green-600\"></i>
  1880.                                 <div>
  1881.                                     <p class=\"text-xs text-green-600\">Niveau</p>
  1882.                                     <p id=\"metier-niveau\" class=\"text-sm font-medium\">-</p>
  1883.                                 </div>
  1884.                             </div>
  1885.                             <div class=\"flex items-center gap-3 p-2 bg-amber-100 rounded-lg\">
  1886.                                 <i class=\"fas fa-clock text-amber-600\"></i>
  1887.                                 <div>
  1888.                                     <p class=\"text-xs text-amber-600\">Durée</p>
  1889.                                     <p id=\"metier-duree\" class=\"text-sm font-medium\">-</p>
  1890.                                 </div>
  1891.                             </div>
  1892.                         </div>
  1893.                     </div>
  1894.                     {# Documents #}
  1895.                     <h3 class=\"text-lg font-semibold text-purple-800 mb-5 flex items-center border-b pb-3\">
  1896.                         <div class=\"w-8 h-8 bg-purple-200 rounded-lg flex items-center justify-center mr-3\">
  1897.                             <i class=\"fas fa-cloud-upload-alt text-purple-700\"></i>
  1898.                         </div>
  1899.                         Documents à télécharger <span class=\"text-red-500\"> *</span>
  1900.                     </h3>
  1901.                     {% include 'partials/_document_upload_plain.html.twig' with {
  1902.                         'candidature': candidature,
  1903.                         'document_labels': document_labels,
  1904.                         'input_class': input_class
  1905.                     } %}
  1906.                     {# Bouton Mise à jour #}
  1907.                     <div class=\"flex flex-col md:flex-row justify-between items-center gap-4 pt-6 border-t border-slate-200\">
  1908.                         <div class=\"text-sm text-slate-500\">
  1909.                             <i class=\"fas fa-info-circle mr-1\"></i>
  1910.                             Les champs marqués d'une <span class=\"text-red-500\">*</span> sont obligatoires
  1911.                         </div>
  1912.                         <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\">
  1913.                             <i class=\"fas fa-save mr-2\"></i>
  1914.                             Mise à jour des informations
  1915.                         </button>
  1916.                     </div>
  1917.                 </form>
  1918.             </div>
  1919.         </div>
  1920.         {# ===== PARTIE 2 : ANALYSE DU DOSSIER ===== #}
  1921.         <div class=\"bg-white rounded-2xl shadow-xl border border-slate-200 overflow-hidden\">
  1922.             <div class=\"p-6 md:p-8\">
  1923.                 {{ form_start(form, {'attr': {'class': 'space-y-10', 'id': 'candidature-form'}}) }}
  1924.                     <div class=\"rounded-xl border border-amber-200 bg-amber-50 p-4 md:p-5 mb-4\">
  1925.                         <p class=\"text-sm font-semibold text-amber-800 flex items-center\">
  1926.                             <i class=\"fas fa-clipboard-list mr-2\"></i>
  1927.                             Partie 2 — Analyse du dossier
  1928.                         </p>
  1929.                         <p class=\"text-sm text-amber-700 mt-1\">Étudiez le dossier, évaluez le candidat et enregistrez le résultat.</p>
  1930.                     </div>
  1931.                     {% include 'partials/_candidature_evaluation_sections.html.twig' %}
  1932.                     <div class=\"flex flex-col md:flex-row justify-between items-center gap-4 pt-6 border-t border-slate-200\">
  1933.                         <div class=\"text-sm text-slate-500\">
  1934.                             <i class=\"fas fa-info-circle mr-1\"></i>
  1935.                             Les champs marqués d'une <span class=\"text-red-500\">*</span> sont obligatoires
  1936.                         </div>
  1937.                         <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\">
  1938.                             <i class=\"fas fa-paper-plane mr-2\"></i>
  1939.                             Enregistrer l'évaluation
  1940.                         </button>
  1941.                     </div>
  1942.                 {{ form_end(form) }}
  1943.             </div>
  1944.         </div>
  1945.     {% else %}
  1946.     <div class=\"bg-white rounded-2xl shadow-xl border border-slate-200 overflow-hidden\">
  1947.         <div class=\"p-6 md:p-8\">
  1948.             {{ form_start(form, {'attr': {'class': 'space-y-10', 'enctype': 'multipart/form-data', 'id': 'candidature-form'}}) }}
  1949.             {% if is_edit_page and candidature is defined %}
  1950.                 <div class=\"rounded-xl border border-indigo-200 bg-indigo-50 p-4 md:p-5\">
  1951.                     <div class=\"flex flex-col md:flex-row md:items-center md:justify-between gap-2\">
  1952.                         <div>
  1953.                             <p class=\"text-sm font-semibold text-indigo-800\">Edition de candidature</p>
  1954.                             <p class=\"text-sm text-indigo-700 mt-1\">Verifiez les informations puis mettez a jour les documents si necessaire.</p>
  1955.                         </div>
  1956.                         <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\">
  1957.                             N° {{ candidature.numero|default('Non attribue') }}
  1958.                         </span>
  1959.                     </div>
  1960.                 </div>
  1961.             {% endif %}
  1962.             {# Section : Identité du candidat (visible ENT / ADMIN en mode édition) #}
  1963.             {% if is_edit_page and (is_granted('ROLE_ENT') or is_granted('ROLE_ADMIN')) and form.nom is defined %}
  1964.                 <div class=\"rounded-xl border border-orange-200 bg-orange-50 p-5\">
  1965.                     <h3 class=\"text-base font-semibold text-orange-800 mb-4 flex items-center\">
  1966.                         <div class=\"w-7 h-7 bg-orange-200 rounded-lg flex items-center justify-center mr-2\">
  1967.                             <i class=\"fas fa-user-edit text-orange-700 text-sm\"></i>
  1968.                         </div>
  1969.                         Identité du candidat
  1970.                     </h3>
  1971.                     <div class=\"grid grid-cols-1 md:grid-cols-2 gap-4\">
  1972.                         <div>
  1973.                             <label class=\"block text-sm font-medium text-slate-700 mb-1\">
  1974.                                 Nom <span class=\"text-red-500\">*</span>
  1975.                             </label>
  1976.                             {{ form_widget(form.nom, {'attr': {'class': input_class, 'placeholder': 'Nom de famille'}}) }}
  1977.                         </div>
  1978.                         <div>
  1979.                             <label class=\"block text-sm font-medium text-slate-700 mb-1\">
  1980.                                 Prénom(s) <span class=\"text-red-500\">*</span>
  1981.                             </label>
  1982.                             {{ form_widget(form.prenoms, {'attr': {'class': input_class, 'placeholder': 'Prénom(s)'}}) }}
  1983.                         </div>
  1984.                     </div>
  1985.                 </div>
  1986.             {% endif %}
  1987.             <!-- SECTION 1: TOUS LES UTILISATEURS - Formation souhaitée -->
  1988.             <h3 class=\"text-lg font-semibold text-indigo-800 flex items-center border-b pb-3 mb-5\">
  1989.                 <div class=\"w-8 h-8 bg-indigo-200 rounded-lg flex items-center justify-center mr-3\">
  1990.                     <i class=\"fas fa-graduation-cap text-indigo-700\"></i>
  1991.                 </div>
  1992.                 Formation souhaitée
  1993.             </h3>
  1994.             
  1995.             <div class=\"grid grid-cols-1 md:grid-cols-2 gap-6\">
  1996.                 <div>
  1997.                     <label class=\"block text-sm font-medium text-slate-700 mb-1\">
  1998.                         Établissement <span class=\"text-red-500\">*</span>
  1999.                     </label>
  2000.                     {% if is_edit_page and candidature is defined and candidature.etablissement %}
  2001.                         {# En mode édition : établissement fixe (lecture seule) #}
  2002.                         <div class=\"{{ input_class }} bg-slate-100 text-slate-600 cursor-default flex items-center gap-2\">
  2003.                             <i class=\"fas fa-lock text-slate-400 text-xs\"></i>
  2004.                             {{ candidature.etablissement.nom }}
  2005.                         </div>
  2006.                         {# Champ caché pour maintenir la valeur lors de la soumission #}
  2007.                         {{ form_widget(form.etablissement, {'attr': {'class': 'hidden', 'id': 'candidature_etablissement'}}) }}
  2008.                     {% else %}
  2009.                         {{ form_widget(form.etablissement, {'attr': {'class': input_class, 'id': 'candidature_etablissement'}}) }}
  2010.                     {% endif %}
  2011.                     <div id=\"etablissement-loading\" class=\"hidden text-sm text-indigo-600 mt-1\">
  2012.                         <i class=\"fas fa-spinner fa-spin mr-1\"></i> Chargement...
  2013.                     </div>
  2014.                 </div>
  2015.                 
  2016.                 <div>
  2017.                     <label class=\"block text-sm font-medium text-slate-700 mb-1\">
  2018.                         Métier <span class=\"text-red-500\">*</span>
  2019.                     </label>
  2020.                     {{ form_widget(form.metier, {'attr': {'class': input_class, 'id': 'candidature_metier'}}) }}
  2021.                     <div id=\"metier-loading\" class=\"hidden text-sm text-indigo-600 mt-1\">
  2022.                         <i class=\"fas fa-spinner fa-spin mr-1\"></i> Chargement...
  2023.                     </div>
  2024.                 </div>
  2025.             </div>
  2026.             <!-- Informations détaillées du métier -->
  2027.             <div id=\"metier-info\" class=\"hidden mt-6\">
  2028.                 <div class=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-3\">
  2029.                     <div class=\"flex items-center gap-3 p-2 bg-indigo-100 rounded-lg\">
  2030.                         <i class=\"fas fa-building text-indigo-600\"></i>
  2031.                         <div>
  2032.                             <p class=\"text-xs text-indigo-600\">Secteur</p>
  2033.                             <p id=\"metier-secteur\" class=\"text-sm font-medium\">-</p>
  2034.                         </div>
  2035.                     </div>
  2036.                     <div class=\"flex items-center gap-3 p-2 bg-purple-100 rounded-lg\">
  2037.                         <i class=\"fas fa-users text-purple-600\"></i>
  2038.                         <div>
  2039.                             <p class=\"text-xs text-purple-600\">Places</p>
  2040.                             <p id=\"metier-nbrplace\" class=\"text-sm font-medium\">-</p>
  2041.                         </div>
  2042.                     </div>
  2043.                     <div class=\"flex items-center gap-3 p-2 bg-green-100 rounded-lg\">
  2044.                         <i class=\"fas fa-graduation-cap text-green-600\"></i>
  2045.                         <div>
  2046.                             <p class=\"text-xs text-green-600\">Niveau</p>
  2047.                             <p id=\"metier-niveau\" class=\"text-sm font-medium\">-</p>
  2048.                         </div>
  2049.                     </div>
  2050.                     <div class=\"flex items-center gap-3 p-2 bg-amber-100 rounded-lg\">
  2051.                         <i class=\"fas fa-clock text-amber-600\"></i>
  2052.                         <div>
  2053.                             <p class=\"text-xs text-amber-600\">Durée</p>
  2054.                             <p id=\"metier-duree\" class=\"text-sm font-medium\">-</p>
  2055.                         </div>
  2056.                     </div>
  2057.                 </div>
  2058.             </div>
  2059.             <!-- SECTION 2: DOCUMENTS -->
  2060.             <h3 class=\"text-lg font-semibold text-purple-800 mb-5 flex items-center border-b pb-3\">
  2061.                 <div class=\"w-8 h-8 bg-purple-200 rounded-lg flex items-center justify-center mr-3\">
  2062.                     <i class=\"fas fa-cloud-upload-alt text-purple-700\"></i>
  2063.                 </div>
  2064.                 Documents à télécharger <span class=\"text-red-500\"> *</span>
  2065.             </h3>
  2066.             
  2067.             {% include 'partials/_document_upload.html.twig' with {
  2068.                 'form': form,
  2069.                 'document_labels': document_labels,
  2070.                 'input_class': input_class
  2071.             } %}
  2072.             <!-- SECTION 3: POUR ENT ET ADMIN - Étude de dossier -->
  2073.             {% if is_granted('ROLE_ENT') or is_granted('ROLE_ADMIN') %}
  2074.                 <h3 class=\"text-lg font-semibold text-amber-800 mb-5 flex items-center border-b pb-3\">
  2075.                     <div class=\"w-8 h-8 bg-amber-200 rounded-lg flex items-center justify-center mr-3\">
  2076.                         <i class=\"fas fa-clipboard-check text-amber-700\"></i>
  2077.                     </div>
  2078.                     Étude de dossier (ENT)
  2079.                 </h3>
  2080.                 
  2081.                 <div class=\"grid grid-cols-1 md:grid-cols-2 gap-4\">
  2082.                     <div>
  2083.                         <label class=\"block text-sm font-medium text-slate-700 mb-1\">Statut dossier</label>
  2084.                         {{ form_widget(form.etustatut, {'attr': {'class': input_class}}) }}
  2085.                     </div>
  2086.                     <div>
  2087.                         <label class=\"block text-sm font-medium text-slate-700 mb-1\">Commentaire</label>
  2088.                         {{ form_widget(form.etucom, {'attr': {'class': input_class, 'placeholder': 'Commentaire sur le dossier...'}}) }}
  2089.                     </div>
  2090.                 </div>
  2091.             {% endif %}
  2092.             <!-- SECTION 4: POUR JURY, ENT ET ADMIN - Évaluation entretien -->
  2093.             {% if is_granted('ROLE_JURY') or is_granted('ROLE_ADMIN') or is_granted('ROLE_ENT') %}
  2094.                 <h3 class=\"text-lg font-semibold text-blue-800 mb-5 flex items-center border-b pb-3\">
  2095.                     <div class=\"w-8 h-8 bg-blue-200 rounded-lg flex items-center justify-center mr-3\">
  2096.                         <i class=\"fas fa-microphone-alt text-blue-700\"></i>
  2097.                     </div>
  2098.                     Évaluation entretien
  2099.                 </h3>
  2100.                 
  2101.                 <div class=\"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4\">
  2102.                     <div>
  2103.                         <label class=\"block text-sm font-medium text-slate-700 mb-1\">Date entretien</label>
  2104.                         {{ form_widget(form.entdate, {'attr': {'class': input_class}}) }}
  2105.                     </div>
  2106.                     <div>
  2107.                         <label class=\"block text-sm font-medium text-slate-700 mb-1\">Lieu entretien</label>
  2108.                         {{ form_widget(form.entlieu, {'attr': {'class': input_class, 'placeholder': 'Ex: Salle 101'}}) }}
  2109.                     </div>
  2110.                 </div>
  2111.                 <div class=\"grid grid-cols-1 md:grid-cols-3 gap-4 mb-4\">
  2112.                     <div>
  2113.                         <label class=\"block text-sm font-medium text-slate-700 mb-1\">Numéro du jury</label>
  2114.                         {{ form_widget(form.jury, {'attr': {'class': input_class, 'min': 1, 'max': 20}}) }}
  2115.                     </div>
  2116.                     <div>
  2117.                         <label class=\"block text-sm font-medium text-slate-700 mb-1\">Vague</label>
  2118.                         {{ form_widget(form.vague, {'attr': {'class': input_class, 'min': 1}}) }}
  2119.                     </div>
  2120.                     <div>
  2121.                         <label class=\"block text-sm font-medium text-slate-700 mb-1\">Décision du jury</label>
  2122.                         {{ form_widget(form.entstatut, {'attr': {'class': input_class}}) }}
  2123.                     </div>
  2124.                 </div>
  2125.                 {% if form.note1 is defined %}
  2126.                 <div class=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 mb-4\">
  2127.                     <div>
  2128.                         <label class=\"block text-sm font-medium text-slate-700 mb-1\">Note 1</label>
  2129.                         {{ form_widget(form.note1, {'attr': {'class': input_class, 'min': 0, 'max': 20, 'step': 0.5}}) }}
  2130.                     </div>
  2131.                     <div>
  2132.                         <label class=\"block text-sm font-medium text-slate-700 mb-1\">Note 2</label>
  2133.                         {{ form_widget(form.note2, {'attr': {'class': input_class, 'min': 0, 'max': 20, 'step': 0.5}}) }}
  2134.                     </div>
  2135.                     <div>
  2136.                         <label class=\"block text-sm font-medium text-slate-700 mb-1\">Note 3</label>
  2137.                         {{ form_widget(form.note3, {'attr': {'class': input_class, 'min': 0, 'max': 20, 'step': 0.5}}) }}
  2138.                     </div>
  2139.                     <div>
  2140.                         <label class=\"block text-sm font-medium text-slate-700 mb-1\">Note 4</label>
  2141.                         {{ form_widget(form.note4, {'attr': {'class': input_class, 'min': 0, 'max': 20, 'step': 0.5}}) }}
  2142.                     </div>
  2143.                     <div>
  2144.                         <label class=\"block text-sm font-medium text-slate-700 mb-1\">Note 5</label>
  2145.                         {{ form_widget(form.note5, {'attr': {'class': input_class, 'min': 0, 'max': 20, 'step': 0.5}}) }}
  2146.                     </div>
  2147.                     <div>
  2148.                         <label class=\"block text-sm font-medium text-slate-700 mb-1\">Note 6</label>
  2149.                         {{ form_widget(form.note6, {'attr': {'class': input_class, 'min': 0, 'max': 20, 'step': 0.5}}) }}
  2150.                     </div>
  2151.                     <div>
  2152.                         <label class=\"block text-sm font-medium text-slate-700 mb-1\">Note 7</label>
  2153.                         {{ form_widget(form.note7, {'attr': {'class': input_class, 'min': 0, 'max': 20, 'step': 0.5}}) }}
  2154.                     </div>
  2155.                     <div>
  2156.                         <label class=\"block text-sm font-medium text-slate-700 mb-1\">Note 8</label>
  2157.                         {{ form_widget(form.note8, {'attr': {'class': input_class, 'min': 0, 'max': 20, 'step': 0.5}}) }}
  2158.                     </div>
  2159.                     <div>
  2160.                         <label class=\"block text-sm font-medium text-slate-700 mb-1\">Note 9</label>
  2161.                         {{ form_widget(form.note9, {'attr': {'class': input_class, 'min': 0, 'max': 20, 'step': 0.5}}) }}
  2162.                     </div>
  2163.                 </div>
  2164.                 {% endif %}
  2165.                 <div class=\"mt-4 mb-6\">
  2166.                     <label class=\"block text-sm font-medium text-slate-700 mb-1\">Commentaire entretien</label>
  2167.                     {{ form_widget(form.entcom, {'attr': {'class': input_class, 'rows': 3, 'placeholder': \"Observations sur l'entretien...\"}}) }}
  2168.                 </div>
  2169.             {% endif %}
  2170.             <!-- SECTION 4bis: GRILLE D'ÉVALUATION DYNAMIQUE -->
  2171.             {% if (is_granted('ROLE_ENT') or is_granted('ROLE_ADMIN') or is_granted('ROLE_JURY')) and candidature is defined and candidature.id %}
  2172.                 <div id=\"evaluation-section\">
  2173.                     <h3 class=\"text-lg font-semibold text-indigo-800 mb-5 flex items-center border-b pb-3\">
  2174.                         <div class=\"w-8 h-8 bg-indigo-200 rounded-lg flex items-center justify-center mr-3\">
  2175.                             <i class=\"fas fa-clipboard-check text-indigo-700\"></i>
  2176.                         </div>
  2177.                         Grille d'évaluation dynamique
  2178.                     </h3>
  2179.                     <!-- Évaluations existantes -->
  2180.                     {% if evaluations is defined and evaluations|length > 0 %}
  2181.                     <div class=\"mb-6 space-y-3\" id=\"existing-evaluations\">
  2182.                         <p class=\"text-sm font-medium text-slate-600 flex items-center mb-2\">
  2183.                             <i class=\"fas fa-history text-indigo-500 mr-2\"></i>
  2184.                             Évaluations précédentes
  2185.                         </p>
  2186.                         {% for eval in evaluations %}
  2187.                         <div class=\"bg-slate-50 rounded-xl p-4 border border-slate-200\">
  2188.                             <div class=\"flex items-center justify-between mb-2\">
  2189.                                 <div class=\"flex items-center gap-3\">
  2190.                                     <span class=\"font-medium text-slate-800\">{{ eval.grille.nom }}</span>
  2191.                                     <span class=\"text-xs text-slate-500\">{{ eval.createdAt|date('d/m/Y H:i') }}</span>
  2192.                                 </div>
  2193.                                 <div class=\"flex items-center gap-2\">
  2194.                                     {% set percentage = eval.noteMaxTotale > 0 ? (eval.scoreTotal / eval.noteMaxTotale * 100) : 0 %}
  2195.                                     <span class=\"inline-flex items-center px-3 py-1 rounded-full text-sm font-bold
  2196.                                         {% if percentage >= 70 %}bg-green-100 text-green-700
  2197.                                         {% elseif percentage >= 40 %}bg-yellow-100 text-yellow-700
  2198.                                         {% else %}bg-red-100 text-red-700{% endif %}\">
  2199.                                         {{ eval.scoreTotal }} / {{ eval.noteMaxTotale }}
  2200.                                     </span>
  2201.                                 </div>
  2202.                             </div>
  2203.                             <!-- Progress bar -->
  2204.                             <div class=\"w-full bg-slate-200 rounded-full h-2.5 mb-2\">
  2205.                                 <div class=\"h-2.5 rounded-full transition-all duration-500
  2206.                                     {% if percentage >= 70 %}bg-green-500
  2207.                                     {% elseif percentage >= 40 %}bg-yellow-500
  2208.                                     {% else %}bg-red-500{% endif %}\" 
  2209.                                     style=\"width: {{ percentage }}%\"></div>
  2210.                             </div>
  2211.                             {% if eval.commentaire %}
  2212.                             <p class=\"text-xs text-slate-500 mt-1\"><i class=\"fas fa-comment mr-1\"></i> {{ eval.commentaire }}</p>
  2213.                             {% endif %}
  2214.                         </div>
  2215.                         {% endfor %}
  2216.                     </div>
  2217.                     {% endif %}
  2218.                     {#
  2219.                     <!-- Sélection de la grille -->
  2220.                     <div class=\"bg-white rounded-xl border border-slate-200 p-5 mb-4\">
  2221.                         <label class=\"block text-sm font-medium text-slate-700 mb-2\">
  2222.                             <i class=\"fas fa-th-list text-indigo-500 mr-1\"></i>
  2223.                             Sélectionner une grille d'évaluation
  2224.                         </label>
  2225.                         <select id=\"grille-select\" class=\"{{ input_class }}\">
  2226.                             <option value=\"\">-- Choisir une grille --</option>
  2227.                             {% if grilles is defined %}
  2228.                                 {% for grille in grilles %}
  2229.                                     <option value=\"{{ grille.id }}\" data-note-max=\"{{ grille.noteMaxTotale }}\" data-nb-criteres=\"{{ grille.criteres|length }}\">
  2230.                                         {{ grille.nom }} ({{ grille.criteres|length }} critères — max {{ grille.noteMaxTotale }})
  2231.                                     </option>
  2232.                                 {% endfor %}
  2233.                             {% endif %}
  2234.                         </select>
  2235.                     </div>
  2236.                     #}
  2237.                     <!-- Zone dynamique des critères -->
  2238.                     <div id=\"criteres-container\" class=\"hidden\">
  2239.                         <div class=\"bg-white rounded-xl border border-slate-200 overflow-hidden mb-4\">
  2240.                             <div class=\"px-5 py-3 bg-slate-50 border-b border-slate-200 flex items-center justify-between\">
  2241.                                 <span class=\"text-sm font-semibold text-slate-700\">
  2242.                                     <i class=\"fas fa-star text-yellow-500 mr-1\"></i>
  2243.                                     Critères d'évaluation
  2244.                                 </span>
  2245.                                 <span id=\"grille-name\" class=\"text-xs text-indigo-600 font-medium\"></span>
  2246.                             </div>
  2247.                             <div class=\"overflow-x-auto\">
  2248.                                 <table class=\"w-full\">
  2249.                                     <thead class=\"bg-slate-50/50\">
  2250.                                         <tr>
  2251.                                             <th class=\"px-5 py-3 text-left text-xs font-semibold text-slate-600 uppercase tracking-wider\">Critère</th>
  2252.                                             <th class=\"px-5 py-3 text-center text-xs font-semibold text-slate-600 uppercase tracking-wider w-28\">Note max</th>
  2253.                                             <th class=\"px-5 py-3 text-center text-xs font-semibold text-slate-600 uppercase tracking-wider w-36\">Note attribuée</th>
  2254.                                         </tr>
  2255.                                     </thead>
  2256.                                     <tbody id=\"criteres-body\" class=\"divide-y divide-slate-100\">
  2257.                                         <!-- Rempli dynamiquement par JS -->
  2258.                                     </tbody>
  2259.                                 </table>
  2260.                             </div>
  2261.                         </div>
  2262.                         <!-- Score total + progress bar -->
  2263.                         <div class=\"bg-white rounded-xl border border-slate-200 p-5 mb-4\">
  2264.                             <div class=\"flex items-center justify-between mb-3\">
  2265.                                 <span class=\"text-sm font-semibold text-slate-700\">
  2266.                                     <i class=\"fas fa-calculator text-indigo-500 mr-1\"></i>
  2267.                                     Score total
  2268.                                 </span>
  2269.                                 <span id=\"score-display\" class=\"text-lg font-bold text-slate-800\">0 / 0</span>
  2270.                             </div>
  2271.                             <div class=\"w-full bg-slate-200 rounded-full h-3\">
  2272.                                 <div id=\"score-bar\" class=\"h-3 rounded-full transition-all duration-300 bg-slate-400\" style=\"width: 0%\"></div>
  2273.                             </div>
  2274.                             <p id=\"score-label\" class=\"text-xs text-slate-500 mt-2 text-center\"></p>
  2275.                         </div>
  2276.                         <!-- Commentaire -->
  2277.                         <div class=\"bg-white rounded-xl border border-slate-200 p-5 mb-4\">
  2278.                             <label class=\"block text-sm font-medium text-slate-700 mb-2\">
  2279.                                 <i class=\"fas fa-comment-alt text-indigo-500 mr-1\"></i>
  2280.                                 Observation du jury
  2281.                             </label>
  2282.                             <textarea id=\"evaluation-commentaire\" rows=\"3\" 
  2283.                                 class=\"{{ input_class }}\" 
  2284.                                 placeholder=\"Saisissez les observations du jury...\"></textarea>
  2285.                         </div>
  2286.                         <!-- Bouton enregistrer -->
  2287.                         <div class=\"flex justify-end\">
  2288.                             <button type=\"button\" id=\"save-evaluation-btn\" 
  2289.                                 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\">
  2290.                                 <i class=\"fas fa-save mr-2\"></i>
  2291.                                 Enregistrer l'évaluation
  2292.                             </button>
  2293.                         </div>
  2294.                         <!-- Message de succès -->
  2295.                         <div id=\"evaluation-success\" class=\"hidden mt-4 p-4 rounded-xl bg-green-50 text-green-800 border border-green-200\">
  2296.                             <div class=\"flex items-center\">
  2297.                                 <i class=\"fas fa-check-circle text-green-500 mr-3 text-lg\"></i>
  2298.                                 <span id=\"evaluation-success-msg\">Évaluation enregistrée avec succès.</span>
  2299.                             </div>
  2300.                         </div>
  2301.                         <!-- Message d'erreur -->
  2302.                         <div id=\"evaluation-error\" class=\"hidden mt-4 p-4 rounded-xl bg-red-50 text-red-800 border border-red-200\">
  2303.                             <div class=\"flex items-center\">
  2304.                                 <i class=\"fas fa-exclamation-circle text-red-500 mr-3 text-lg\"></i>
  2305.                                 <span id=\"evaluation-error-msg\">Erreur lors de l'enregistrement.</span>
  2306.                             </div>
  2307.                         </div>
  2308.                     </div>
  2309.                 </div>
  2310.             {% endif %}
  2311.             <!-- SECTION 5: Visite médicale et résultat final -->
  2312.             {% if is_granted('ROLE_ENT') or is_granted('ROLE_JURY') or is_granted('ROLE_ADMIN') %}
  2313.                 <div class=\"bg-emerald-50 rounded-2xl border border-emerald-200 p-6\">
  2314.                     <h3 class=\"text-lg font-semibold text-emerald-800 mb-5 flex items-center border-b border-emerald-200 pb-3\">
  2315.                         <div class=\"w-8 h-8 bg-emerald-200 rounded-lg flex items-center justify-center mr-3\">
  2316.                             <i class=\"fas fa-hospital text-emerald-700\"></i>
  2317.                         </div>
  2318.                         VISITE MÉDICALE & Résultat final
  2319.                     </h3>
  2320.                     
  2321.                     <div class=\"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4\">
  2322.                         <div>
  2323.                             <label class=\"block text-sm font-medium text-slate-700 mb-1\">Date visite</label>
  2324.                             {{ form_widget(form.visdate, {'attr': {'class': input_class}}) }}
  2325.                         </div>
  2326.                         <div>
  2327.                             <label class=\"block text-sm font-medium text-slate-700 mb-1\">Lieu visite</label>
  2328.                             {{ form_widget(form.vislieu, {'attr': {'class': input_class, 'placeholder': 'Ex: Centre médical'}}) }}
  2329.                         </div>
  2330.                     </div>
  2331.                     <div class=\"grid grid-cols-1 md:grid-cols-3 gap-4\">
  2332.                         <div>
  2333.                             <label class=\"block text-sm font-medium text-slate-700 mb-1\">Statut visite</label>
  2334.                             {{ form_widget(form.visstatut, {'attr': {'class': input_class}}) }}
  2335.                         </div>
  2336.                         <div>
  2337.                             <label class=\"block text-sm font-medium text-slate-700 mb-1\">Résultat final</label>
  2338.                             {{ form_widget(form.resultat, {'attr': {'class': input_class}}) }}
  2339.                         </div>
  2340.                         <div>
  2341.                             <label class=\"block text-sm font-medium text-slate-700 mb-1\">Commentaire</label>
  2342.                             {{ form_widget(form.viscom, {'attr': {'class': input_class, 'placeholder': 'Commentaire visite...'}}) }}
  2343.                         </div>
  2344.                     </div>
  2345.                 </div>
  2346.             {% endif %}
  2347.             <!-- Boutons d'action -->
  2348.             <div class=\"flex flex-col md:flex-row justify-between items-center gap-4 pt-6 border-t border-slate-200\">
  2349.                 <div class=\"text-sm text-slate-500\">
  2350.                     <i class=\"fas fa-info-circle mr-1\"></i>
  2351.                     Les champs marqués d'une <span class=\"text-red-500\">*</span> sont obligatoires
  2352.                 </div>
  2353.                 
  2354.                 <div class=\"flex gap-3\">
  2355.                     {% if app.user %}
  2356.                         {# Vérification de l'âge pour afficher/masquer le bouton de soumission #}
  2357.                         {% set age = app.user.datenaissance ? date().diff(date(app.user.datenaissance)).y : null %}
  2358.                         
  2359.                         {% if is_granted('ROLE_ADMIN') or is_granted('ROLE_ENT') or is_granted('ROLE_JURY') %}
  2360.                             {# Les rôles admin/ent/jury peuvent toujours soumettre #}
  2361.                             <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\">
  2362.                                 <i class=\"fas fa-paper-plane mr-2\"></i>
  2363.                                 Enregistrer l'évaluation
  2364.                             </button>
  2365.                         {% elseif age >= 16 and age <= 40 %}
  2366.                             {# Candidat avec âge valide #}
  2367.                             <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\">
  2368.                                 <i class=\"fas fa-paper-plane mr-2\"></i>
  2369.                                 Soumettre ma candidature
  2370.                             </button>
  2371.                         {% else %}
  2372.                             {# Candidat avec âge invalide - bouton désactivé #}
  2373.                             <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\">
  2374.                                 <i class=\"fas fa-ban mr-2\"></i>
  2375.                                 Soumission impossible
  2376.                             </button>
  2377.                         {% endif %}
  2378.                     {% else %}
  2379.                         {% set redirectUrl = path('app_candidature_new', {
  2380.                             'etablissement': app.request.get('etablissement'),
  2381.                             'metier': app.request.get('metier')
  2382.                         }) %}
  2383.                         
  2384.                         <a href=\"{{ path('app_login', {'redirect': redirectUrl}) }}\" 
  2385.                            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\">
  2386.                             <i class=\"fas fa-sign-in-alt mr-2\"></i>
  2387.                             Se connecter pour postuler
  2388.                         </a>
  2389.                     {% endif %}
  2390.                 </div>
  2391.             </div>
  2392.             {{ form_end(form) }}
  2393.         </div>
  2394.     </div>
  2395.     {% endif %}
  2396. </div>
  2397. <!-- JavaScript pour la gestion dynamique établissement/métier -->
  2398. <script>
  2399. document.addEventListener('DOMContentLoaded', function() {
  2400.     const etablissementSelect = document.getElementById('candidature_etablissement');
  2401.     const metierSelect = document.getElementById('candidature_metier');
  2402.     const metierInfo = document.getElementById('metier-info');
  2403.     const metierSecteur = document.getElementById('metier-secteur');
  2404.     const metierNiveau = document.getElementById('metier-niveau');
  2405.     const metierNbrPlace = document.getElementById('metier-nbrplace');
  2406.     const metierDuree = document.getElementById('metier-duree');
  2407.     const etablissementLoading = document.getElementById('etablissement-loading');
  2408.     const metierLoading = document.getElementById('metier-loading');
  2409.     
  2410.     const currentMetierValue = metierSelect.value;
  2411.     function loadMetiers(etablissementId, callback) {
  2412.         if (!etablissementId) {
  2413.             metierSelect.innerHTML = '<option value=\"\">-- Choisissez d\\'abord un établissement --</option>';
  2414.             metierSelect.disabled = true;
  2415.             metierInfo.classList.add('hidden');
  2416.             if (callback) callback();
  2417.             return;
  2418.         }
  2419.         metierLoading.classList.remove('hidden');
  2420.         metierSelect.disabled = true;
  2421.         fetch('/candidature/etablissement/' + etablissementId + '/metiers')
  2422.             .then(response => response.json())
  2423.             .then(data => {
  2424.                 metierSelect.innerHTML = '<option value=\"\">-- Sélectionnez un métier --</option>';
  2425.                 
  2426.                 const grouped = {};
  2427.                 data.forEach(metier => {
  2428.                     const secteur = metier.secteur_nom || 'Autres';
  2429.                     if (!grouped[secteur]) {
  2430.                         grouped[secteur] = [];
  2431.                     }
  2432.                     grouped[secteur].push(metier);
  2433.                 });
  2434.                 
  2435.                 for (const [secteur, metiers] of Object.entries(grouped)) {
  2436.                     const optgroup = document.createElement('optgroup');
  2437.                     optgroup.label = secteur;
  2438.                     
  2439.                     metiers.sort((a, b) => a.nom.localeCompare(b.nom));
  2440.                     metiers.forEach(metier => {
  2441.                         const option = document.createElement('option');
  2442.                         option.value = metier.id;
  2443.                         option.dataset.secteur = metier.secteur_nom || '';
  2444.                         option.dataset.niveau = metier.niveau || '';
  2445.                         option.dataset.duree = metier.duree || '';
  2446.                         option.dataset.nbrplace = metier.nbrplace || '';
  2447.                         let label = metier.nom;
  2448.                         if (metier.nbrplace) {
  2449.                             label += ' (' + metier.nbrplace + ' places)';
  2450.                         }
  2451.                         option.textContent = label;
  2452.                         optgroup.appendChild(option);
  2453.                     });
  2454.                     
  2455.                     metierSelect.appendChild(optgroup);
  2456.                 }
  2457.                 
  2458.                 const metierToSelect = currentMetierValue || '{{ app.request.get('metier')|default('') }}';
  2459.                 
  2460.                 if (metierToSelect) {
  2461.                     const options = metierSelect.options;
  2462.                     for (let i = 0; i < options.length; i++) {
  2463.                         if (options[i].value == metierToSelect) {
  2464.                             options[i].selected = true;
  2465.                             updateMetierInfo(options[i]);
  2466.                             break;
  2467.                         }
  2468.                     }
  2469.                 }
  2470.                 
  2471.                 metierSelect.disabled = false;
  2472.                 metierLoading.classList.add('hidden');
  2473.                 
  2474.                 if (callback) callback();
  2475.             })
  2476.             .catch(error => {
  2477.                 console.error('Erreur:', error);
  2478.                 metierSelect.disabled = false;
  2479.                 metierLoading.classList.add('hidden');
  2480.                 if (callback) callback();
  2481.             });
  2482.     }
  2483.     function updateMetierInfo(selectedOption) {
  2484.         if (!selectedOption || !selectedOption.value) {
  2485.             metierInfo.classList.add('hidden');
  2486.             return;
  2487.         }
  2488.         
  2489.         metierSecteur.textContent = selectedOption.dataset.secteur || 'Non spécifié';
  2490.         metierNiveau.textContent = selectedOption.dataset.niveau || 'Non spécifié';
  2491.         metierDuree.textContent = selectedOption.dataset.duree || 'Non spécifié';
  2492.         metierNbrPlace.textContent = selectedOption.dataset.nbrplace || 'Non spécifié';
  2493.         metierInfo.classList.remove('hidden');
  2494.     }
  2495.     {% if app.request.get('etablissement') %}
  2496.         const etablissementId = '{{ app.request.get('etablissement') }}';
  2497.         if (etablissementId) {
  2498.             setTimeout(function() {
  2499.                 const options = etablissementSelect.options;
  2500.                 for (let i = 0; i < options.length; i++) {
  2501.                     if (options[i].value == etablissementId) {
  2502.                         options[i].selected = true;
  2503.                         break;
  2504.                     }
  2505.                 }
  2506.                 loadMetiers(etablissementId);
  2507.             }, 100);
  2508.         }
  2509.     {% else %}
  2510.         if (etablissementSelect.value) {
  2511.             loadMetiers(etablissementSelect.value);
  2512.         } else {
  2513.             metierSelect.innerHTML = '<option value=\"\">-- Choisissez d\\'abord un établissement --</option>';
  2514.             metierSelect.disabled = true;
  2515.         }
  2516.     {% endif %}
  2517.     etablissementSelect.addEventListener('change', function() {
  2518.         loadMetiers(this.value);
  2519.         metierInfo.classList.add('hidden');
  2520.     });
  2521.     metierSelect.addEventListener('change', function() {
  2522.         const selectedOption = this.options[this.selectedIndex];
  2523.         updateMetierInfo(selectedOption);
  2524.     });
  2525.     const form = document.getElementById('candidature-form');
  2526.     form.addEventListener('submit', function(e) {
  2527.         {% if not app.user %}
  2528.         e.preventDefault();
  2529.         alert('Vous devez être connecté pour soumettre une candidature.');
  2530.         const redirectUrl = '/candidature/new?etablissement=' + etablissementSelect.value + '&metier=' + metierSelect.value;
  2531.         window.location.href = '/login?redirect=' + encodeURIComponent(redirectUrl);
  2532.         return false;
  2533.         {% endif %}
  2534.         {# Vérification supplémentaire en JavaScript #}
  2535.         {% if app.user and app.user.datenaissance %}
  2536.             {% set age = date().diff(date(app.user.datenaissance)).y %}
  2537.             {% if age < 16 or age > 40 %}
  2538.                 e.preventDefault();
  2539.                 alert('Vous ne remplissez pas les conditions d\\'âge pour candidater (16 à 40 ans).');
  2540.                 return false;
  2541.             {% endif %}
  2542.         {% endif %}
  2543.         if (!etablissementSelect.value) {
  2544.             e.preventDefault();
  2545.             alert('Veuillez sélectionner un établissement.');
  2546.             return false;
  2547.         }
  2548.         
  2549.         if (!metierSelect.value) {
  2550.             e.preventDefault();
  2551.             alert('Veuillez sélectionner un métier.');
  2552.             return false;
  2553.         }
  2554.     });
  2555. });
  2556. </script>
  2557. <!-- JavaScript pour la grille d'évaluation dynamique -->
  2558. {% if (is_granted('ROLE_ENT') or is_granted('ROLE_ADMIN') or is_granted('ROLE_JURY')) and candidature is defined and candidature.id %}
  2559. <script>
  2560. document.addEventListener('DOMContentLoaded', function() {
  2561.     const grilleSelect = document.getElementById('grille-select');
  2562.     const criteresContainer = document.getElementById('criteres-container');
  2563.     const criteresBody = document.getElementById('criteres-body');
  2564.     const grilleName = document.getElementById('grille-name');
  2565.     const scoreDisplay = document.getElementById('score-display');
  2566.     const scoreBar = document.getElementById('score-bar');
  2567.     const scoreLabel = document.getElementById('score-label');
  2568.     const saveBtn = document.getElementById('save-evaluation-btn');
  2569.     const commentaireField = document.getElementById('evaluation-commentaire');
  2570.     const successDiv = document.getElementById('evaluation-success');
  2571.     const errorDiv = document.getElementById('evaluation-error');
  2572.     const successMsg = document.getElementById('evaluation-success-msg');
  2573.     const errorMsg = document.getElementById('evaluation-error-msg');
  2574.     if (!grilleSelect) return;
  2575.     const candidatureId = {{ candidature.id }};
  2576.     let currentGrilleId = null;
  2577.     let noteMaxTotale = 0;
  2578.     // Charger les critères quand on sélectionne une grille
  2579.     grilleSelect.addEventListener('change', function() {
  2580.         const grilleId = this.value;
  2581.         if (!grilleId) {
  2582.             criteresContainer.classList.add('hidden');
  2583.             currentGrilleId = null;
  2584.             return;
  2585.         }
  2586.         currentGrilleId = grilleId;
  2587.         loadCriteres(grilleId);
  2588.     });
  2589.     function loadCriteres(grilleId) {
  2590.         fetch('/evaluation/grille/' + grilleId + '/criteres')
  2591.             .then(r => r.json())
  2592.             .then(data => {
  2593.                 criteresBody.innerHTML = '';
  2594.                 noteMaxTotale = data.grille.noteMaxTotale;
  2595.                 grilleName.textContent = data.grille.nom;
  2596.                 data.criteres.forEach(critere => {
  2597.                     const tr = document.createElement('tr');
  2598.                     tr.className = 'hover:bg-slate-50/50 transition';
  2599.                     tr.innerHTML = `
  2600.                         <td class=\"px-5 py-3\">
  2601.                             <div>
  2602.                                 <span class=\"font-medium text-slate-800 text-sm\">\${critere.nom}</span>
  2603.                                 \${critere.description ? '<p class=\"text-xs text-slate-500 mt-0.5\">' + critere.description + '</p>' : ''}
  2604.                             </div>
  2605.                         </td>
  2606.                         <td class=\"px-5 py-3 text-center\">
  2607.                             <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>
  2608.                         </td>
  2609.                         <td class=\"px-5 py-3 text-center\">
  2610.                             <input type=\"number\" 
  2611.                                 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\"
  2612.                                 data-critere-id=\"\${critere.id}\" 
  2613.                                 data-note-max=\"\${critere.noteMax}\"
  2614.                                 min=\"0\" 
  2615.                                 max=\"\${critere.noteMax}\" 
  2616.                                 step=\"0.5\" 
  2617.                                 placeholder=\"...\"
  2618.                             >
  2619.                         </td>
  2620.                     `;
  2621.                     criteresBody.appendChild(tr);
  2622.                 });
  2623.                 criteresContainer.classList.remove('hidden');
  2624.                 updateScore();
  2625.                 // Charger les notes existantes
  2626.                 loadExistingEvaluation(grilleId);
  2627.                 // Ajouter les écouteurs sur les champs de notes
  2628.                 document.querySelectorAll('.note-input').forEach(input => {
  2629.                     input.addEventListener('input', function() {
  2630.                         const max = parseFloat(this.dataset.noteMax);
  2631.                         let val = parseFloat(this.value);
  2632.                         if (val > max) { this.value = max; }
  2633.                         if (val < 0) { this.value = 0; }
  2634.                         updateScore();
  2635.                     });
  2636.                 });
  2637.             })
  2638.             .catch(err => {
  2639.                 console.error('Erreur chargement critères:', err);
  2640.             });
  2641.     }
  2642.     function loadExistingEvaluation(grilleId) {
  2643.         fetch('/evaluation/candidature/' + candidatureId + '/evaluation')
  2644.             .then(r => r.json())
  2645.             .then(evaluations => {
  2646.                 const existing = evaluations.find(e => e.grilleId == grilleId);
  2647.                 if (existing) {
  2648.                     existing.notations.forEach(n => {
  2649.                         const input = document.querySelector(`.note-input[data-critere-id=\"\${n.critereId}\"]`);
  2650.                         if (input && n.note !== null) {
  2651.                             input.value = n.note;
  2652.                         }
  2653.                     });
  2654.                     if (existing.commentaire) {
  2655.                         commentaireField.value = existing.commentaire;
  2656.                     }
  2657.                     updateScore();
  2658.                 }
  2659.             })
  2660.             .catch(err => console.error('Erreur chargement évaluation:', err));
  2661.     }
  2662.     function updateScore() {
  2663.         let total = 0;
  2664.         document.querySelectorAll('.note-input').forEach(input => {
  2665.             const val = parseFloat(input.value);
  2666.             if (!isNaN(val)) total += val;
  2667.         });
  2668.         scoreDisplay.textContent = total + ' / ' + noteMaxTotale;
  2669.         const percentage = noteMaxTotale > 0 ? (total / noteMaxTotale * 100) : 0;
  2670.         scoreBar.style.width = percentage + '%';
  2671.         // Couleur de la barre de progression
  2672.         scoreBar.classList.remove('bg-green-500', 'bg-yellow-500', 'bg-red-500', 'bg-slate-400');
  2673.         if (percentage >= 70) {
  2674.             scoreBar.classList.add('bg-green-500');
  2675.             scoreLabel.textContent = 'Excellent';
  2676.             scoreLabel.className = 'text-xs mt-2 text-center text-green-600 font-medium';
  2677.         } else if (percentage >= 40) {
  2678.             scoreBar.classList.add('bg-yellow-500');
  2679.             scoreLabel.textContent = 'Moyen';
  2680.             scoreLabel.className = 'text-xs mt-2 text-center text-yellow-600 font-medium';
  2681.         } else if (total > 0) {
  2682.             scoreBar.classList.add('bg-red-500');
  2683.             scoreLabel.textContent = 'Faible';
  2684.             scoreLabel.className = 'text-xs mt-2 text-center text-red-600 font-medium';
  2685.         } else {
  2686.             scoreBar.classList.add('bg-slate-400');
  2687.             scoreLabel.textContent = '';
  2688.         }
  2689.     }
  2690.     // Enregistrer l'évaluation
  2691.     saveBtn.addEventListener('click', function() {
  2692.         if (!currentGrilleId) return;
  2693.         successDiv.classList.add('hidden');
  2694.         errorDiv.classList.add('hidden');
  2695.         const notations = [];
  2696.         document.querySelectorAll('.note-input').forEach(input => {
  2697.             notations.push({
  2698.                 critereId: parseInt(input.dataset.critereId),
  2699.                 note: input.value !== '' ? parseFloat(input.value) : null,
  2700.             });
  2701.         });
  2702.         const payload = {
  2703.             grilleId: parseInt(currentGrilleId),
  2704.             notations: notations,
  2705.             commentaire: commentaireField.value || null,
  2706.         };
  2707.         saveBtn.disabled = true;
  2708.         saveBtn.innerHTML = '<i class=\"fas fa-spinner fa-spin mr-2\"></i> Enregistrement...';
  2709.         fetch('/evaluation/candidature/' + candidatureId + '/evaluer', {
  2710.             method: 'POST',
  2711.             headers: { 'Content-Type': 'application/json' },
  2712.             body: JSON.stringify(payload),
  2713.         })
  2714.         .then(r => r.json())
  2715.         .then(data => {
  2716.             if (data.success) {
  2717.                 successMsg.textContent = data.message;
  2718.                 successDiv.classList.remove('hidden');
  2719.                 errorDiv.classList.add('hidden');
  2720.                 // Mettre à jour l'affichage du score
  2721.                 scoreDisplay.textContent = data.scoreTotal + ' / ' + data.noteMaxTotale;
  2722.             } else {
  2723.                 errorMsg.textContent = data.error || 'Erreur inconnue.';
  2724.                 errorDiv.classList.remove('hidden');
  2725.                 successDiv.classList.add('hidden');
  2726.             }
  2727.         })
  2728.         .catch(err => {
  2729.             console.error('Erreur:', err);
  2730.             errorMsg.textContent = 'Erreur réseau lors de l\\'enregistrement.';
  2731.             errorDiv.classList.remove('hidden');
  2732.             successDiv.classList.add('hidden');
  2733.         })
  2734.         .finally(() => {
  2735.             saveBtn.disabled = false;
  2736.             saveBtn.innerHTML = '<i class=\"fas fa-save mr-2\"></i> Enregistrer l\\'évaluation';
  2737.         });
  2738.     });
  2739. });
  2740. </script>
  2741. {% endif %}
  2742. {% endblock %}""candidature/form.html.twig""/home/daip/temporaire/templates/candidature/form.html.twig");
  2743.     }
  2744. }