var/cache/dev/twig/0b/0b6a5b8b5ad19e9bbb1bce8a62e371c8.php line 54
<?phpuse Twig\Environment;use Twig\Error\LoaderError;use Twig\Error\RuntimeError;use Twig\Extension\SandboxExtension;use Twig\Markup;use Twig\Sandbox\SecurityError;use Twig\Sandbox\SecurityNotAllowedTagError;use Twig\Sandbox\SecurityNotAllowedFilterError;use Twig\Sandbox\SecurityNotAllowedFunctionError;use Twig\Source;use Twig\Template;/* candidature/form.html.twig */class __TwigTemplate_f7b42b4d030bca35650cd2579f3f26e8 extends \Twig\Template{private $source;private $macros = [];public function __construct(Environment $env){parent::__construct($env);$this->source = $this->getSourceContext();$this->blocks = ['title' => [$this, 'block_title'],'body' => [$this, 'block_body'],];}protected function doGetParent(array $context){// line 1return "base.html.twig";}protected function doDisplay(array $context, array $blocks = []){$macros = $this->macros;$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "candidature/form.html.twig"));$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "candidature/form.html.twig"));// line 6$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";// line 7$context["is_edit_page"] = (twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, 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.', 7, $this->source); })()), "request", [], "any", false, false, false, 7), "attributes", [], "any", false, false, false, 7), "get", [0 => "_route"], "method", false, false, false, 7) == "app_candidature_edit");// line 1$this->parent = $this->loadTemplate("base.html.twig", "candidature/form.html.twig", 1);$this->parent->display($context, array_merge($this->blocks, $blocks));$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);}// line 3public function block_title($context, array $blocks = []){$macros = $this->macros;$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "title"));$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "title"));echo "Nouvelle candidature | DAIP";$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);}// line 9public function block_body($context, array $blocks = []){$macros = $this->macros;$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "body"));$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "body"));// line 10echo "";// line 12$context['_parent'] = $context;$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", false, false, false, 12));foreach ($context['_seq'] as $context["label"] => $context["messages"]) {// line 13echo "";// line 14$context['_parent'] = $context;$context['_seq'] = twig_ensure_traversable($context["messages"]);foreach ($context['_seq'] as $context["_key"] => $context["message"]) {// line 15echo " <div class=\"mb-4 p-4 rounded-lg border";// line 16if (($context["label"] == "error")) {// line 17echo " bg-red-50 border-red-200 text-red-800";} elseif (( // line 18$context["label"] == "success")) {// line 19echo " bg-green-50 border-green-200 text-green-800";} else {// line 21echo " bg-blue-50 border-blue-200 text-blue-800";}// line 23echo " \">";// line 24echo $context["message"];echo "</div>";}$_parent = $context['_parent'];unset($context['_seq'], $context['_iterated'], $context['_key'], $context['message'], $context['_parent'], $context['loop']);$context = array_intersect_key($context, $_parent) + $_parent;}$_parent = $context['_parent'];unset($context['_seq'], $context['_iterated'], $context['label'], $context['messages'], $context['_parent'], $context['loop']);$context = array_intersect_key($context, $_parent) + $_parent;// line 28echo "<div class=\"bg-gradient-to-r from-indigo-600 to-purple-600 p-8 mb-8 text-white\"><div class=\"flex items-center gap-4 mb-4\"><div class=\"w-16 h-16 bg-white/20 rounded-full flex items-center justify-center\"><i class=\"fas fa-file-alt text-3xl\"></i></div><div><h1 class=\"text-2xl font-bold\">";// line 37if ((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); })())) {echo "Modification de candidature";} else {echo "Nouvelle candidature";}// line 38echo " </h1><p class=\"text-white/80\">";// line 40if ((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); })())) {echo "Mettez a jour les informations de la candidature de facon claire et complete.";} else {echo "Vous etes sur le point de postuler a une formation";}// line 41echo " </p></div></div><!-- Informations du candidat -->";// line 46if (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", false, false, false, 46)) {// line 47echo " ";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))) {// line 48echo " <div class=\"mt-4 grid grid-cols-1 lg:grid-cols-2 gap-4\"><div class=\"bg-white/10 backdrop-blur-sm rounded-xl p-4 border border-white/20\"><p class=\"text-sm font-semibold text-white/80 mb-3 flex items-center\"><i class=\"fas fa-user-graduate mr-2\"></i>Informations du candidat</p><div class=\"space-y-3\"><div class=\"bg-white/10 rounded-lg px-3 py-2\"><p class=\"text-xs uppercase tracking-wide text-white/70\">Nom du candidat</p><p class=\"text-sm font-semibold text-white mt-1\">";// line 57((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", false, false, false, 57)) ? (print (twig_escape_filter($this->env, twig_trim_filter(((twig_get_attribute($this->env, $this->source, 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", false, false, false, 57), "nom", [], "any", false, false, false, 57) . " ") . twig_get_attribute($this->env, $this->source, 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", false, false, false, 57), "prenoms", [], "any", false, false, false, 57))), "html", null, true))) : (print ("Non renseigne")));echo "</p></div><div class=\"bg-white/10 rounded-lg px-3 py-2\"><p class=\"text-xs uppercase tracking-wide text-white/70\">Numero de candidature</p><p class=\"text-sm font-semibold text-white mt-1\">";// line 61echo twig_escape_filter($this->env, ((twig_get_attribute($this->env, $this->source, ($context["candidature"] ?? null), "numero", [], "any", true, true, false, 61)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["candidature"] ?? null), "numero", [], "any", false, false, false, 61), "Non attribue")) : ("Non attribue")), "html", null, true);echo "</p></div></div></div><div class=\"bg-white/10 backdrop-blur-sm rounded-xl p-4 border border-white/20\"><p class=\"text-sm font-semibold text-white/80 mb-3 flex items-center\"><i class=\"fas fa-file-signature mr-2\"></i>Informations de la candidature</p><div class=\"space-y-3\"><div class=\"bg-white/10 rounded-lg px-3 py-2\"><p class=\"text-xs uppercase tracking-wide text-white/70\">Etablissement choisi</p><p class=\"text-sm font-semibold text-white mt-1\">";// line 74((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", false, false, false, 74)) ? (print (twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, 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", false, false, false, 74), "nom", [], "any", false, false, false, 74), "html", null, true))) : (print ("Non renseigne")));echo "</p></div><div class=\"bg-white/10 rounded-lg px-3 py-2\"><p class=\"text-xs uppercase tracking-wide text-white/70\">Metier choisi</p><p class=\"text-sm font-semibold text-white mt-1\">";// line 78((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", false, false, false, 78)) ? (print (twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, 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", false, false, false, 78), "nom", [], "any", false, false, false, 78), "html", null, true))) : (print ("Non renseigne")));echo "</p></div></div></div></div>";} else {// line 84echo " <div class=\"bg-white/10 backdrop-blur-sm rounded-xl p-4 mt-4\"><div class=\"flex items-center gap-3\"><div class=\"w-10 h-10 bg-white/20 rounded-full flex items-center justify-center\"><i class=\"fas fa-user\"></i></div><div><p class=\"text-sm text-white/80\">Candidat</p><p class=\"font-semibold\">";// line 91echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, 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.', 91, $this->source); })()), "user", [], "any", false, false, false, 91), "nom", [], "any", false, false, false, 91), "html", null, true);echo " ";echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, 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.', 91, $this->source); })()), "user", [], "any", false, false, false, 91), "prenoms", [], "any", false, false, false, 91), "html", null, true);echo "</p></div>";// line 95echo " ";if (twig_get_attribute($this->env, $this->source, 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.', 95, $this->source); })()), "user", [], "any", false, false, false, 95), "datenaissance", [], "any", false, false, false, 95)) {// line 96echo " ";$context["age"] = twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, twig_date_converter($this->env), "diff", [0 => twig_date_converter($this->env, twig_get_attribute($this->env, $this->source, 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.', 96, $this->source); })()), "user", [], "any", false, false, false, 96), "datenaissance", [], "any", false, false, false, 96))], "method", false, false, false, 96), "y", [], "any", false, false, false, 96);// line 97echo " <div class=\"ml-4 px-3 py-1 bg-white/20 rounded-full\"><span class=\"text-sm\"><i class=\"fas fa-birthday-cake mr-1\"></i>";// line 100echo 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", null, true);echo " ans</span></div>";}// line 104echo "<div class=\"ml-auto\"><span class=\"px-3 py-1 bg-white/20 rounded-full text-sm\">";// line 106echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, 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.', 106, $this->source); })()), "user", [], "any", false, false, false, 106), "email", [], "any", false, false, false, 106), "html", null, true);echo "</span><span class=\"ml-2 px-3 py-1 bg-indigo-500 rounded-full text-xs\">";// line 108if ($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_ADMIN")) {echo "ADMIN";} elseif ($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_ENT")) {// line 109echo "ENT";} elseif ($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_JURY")) {// line 110echo "JURY";} elseif ($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_CANDIDAT")) {// line 111echo "CANDIDAT";}// line 113echo " </span></div></div></div>";}// line 118echo " ";}// line 119echo "";// line 121echo " ";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", false, false, false, 121) && twig_get_attribute($this->env, $this->source, 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", false, false, false, 121), "datenaissance", [], "any", false, false, false, 121))) {// line 122echo " ";$context["age"] = twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, twig_date_converter($this->env), "diff", [0 => twig_date_converter($this->env, twig_get_attribute($this->env, $this->source, 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.', 122, $this->source); })()), "user", [], "any", false, false, false, 122), "datenaissance", [], "any", false, false, false, 122))], "method", false, false, false, 122), "y", [], "any", false, false, false, 122);// line 123echo " ";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))) {// line 124echo " <div class=\"mt-4 bg-red-500/20 backdrop-blur-sm border border-red-500/30 rounded-xl p-4\"><div class=\"flex items-center gap-3\"><div class=\"w-10 h-10 bg-red-500/30 rounded-full flex items-center justify-center\"><i class=\"fas fa-exclamation-triangle text-red-300\"></i></div><div><p class=\"font-semibold text-white\">Âge non conforme</p><p class=\"text-sm text-white/80\">";// line 132if (((isset($context["age"]) || array_key_exists("age", $context) ? $context["age"] : (function () { throw new RuntimeError('Variable "age" does not exist.', 132, $this->source); })()) < 16)) {// line 133echo " Vous avez ";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", null, true);echo " ans. L'âge minimum requis pour candidater est de 16 ans.";} elseif (( // line 134(isset($context["age"]) || array_key_exists("age", $context) ? $context["age"] : (function () { throw new RuntimeError('Variable "age" does not exist.', 134, $this->source); })()) > 40)) {// line 135echo " Vous avez ";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", null, true);echo " ans. L'âge maximum autorisé pour candidater est de 40 ans.";}// line 137echo " </p></div></div></div>";}// line 142echo " ";}// line 143echo "</div><div class=\"max-w-7xl mx-auto px-4 pb-16 ";// line 145echo (((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") : (""));echo "\">";// line 146$this->loadTemplate("partials/_flash_messages.html.twig", "candidature/form.html.twig", 146)->display($context);// line 147echo "";// line 148if ((((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", false, false, false, 148))) {// line 149echo "";// line 151echo " <div class=\"bg-white rounded-2xl shadow-xl border border-slate-200 overflow-hidden mb-8\"><div class=\"p-6 md:p-8\"><div class=\"rounded-xl border border-indigo-200 bg-indigo-50 p-4 md:p-5 mb-8\"><div class=\"flex flex-col md:flex-row md:items-center md:justify-between gap-2\"><div><p class=\"text-sm font-semibold text-indigo-800 flex items-center\"><i class=\"fas fa-edit mr-2\"></i> Partie 1 — Mise à jour des informations</p><p class=\"text-sm text-indigo-700 mt-1\">Modifiez les informations du candidat, le métier et les documents.</p></div><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\">N° ";// line 162echo twig_escape_filter($this->env, ((twig_get_attribute($this->env, $this->source, ($context["candidature"] ?? null), "numero", [], "any", true, true, false, 162)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["candidature"] ?? null), "numero", [], "any", false, false, false, 162), "Non attribué")) : ("Non attribué")), "html", null, true);echo "</span></div></div><form id=\"form-update-info\" action=\"";// line 167echo 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", false, false, false, 167)]), "html", null, true);echo "\" method=\"POST\" enctype=\"multipart/form-data\" class=\"space-y-10\"><input type=\"hidden\" name=\"_token\" value=\"";// line 168echo 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", false, false, false, 168))), "html", null, true);echo "\">";// line 171echo " ";if (($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_ENT") || $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_ADMIN"))) {// line 172echo " <div class=\"rounded-xl border border-orange-200 bg-orange-50 p-5\"><h3 class=\"text-base font-semibold text-orange-800 mb-4 flex items-center\"><div class=\"w-7 h-7 bg-orange-200 rounded-lg flex items-center justify-center mr-2\"><i class=\"fas fa-user-edit text-orange-700 text-sm\"></i></div>Identité du candidat</h3><div class=\"grid grid-cols-1 md:grid-cols-2 gap-4\"><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Nom <span class=\"text-red-500\">*</span></label><input type=\"text\" name=\"nom\" value=\"";// line 182((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", false, false, false, 182)) ? (print (twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, 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", false, false, false, 182), "nom", [], "any", false, false, false, 182), "html", null, true))) : (print ("")));echo "\" class=\"";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", null, true);echo "\" placeholder=\"Nom de famille\"></div><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Prénom(s) <span class=\"text-red-500\">*</span></label><input type=\"text\" name=\"prenoms\" value=\"";// line 186((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", false, false, false, 186)) ? (print (twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, 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", false, false, false, 186), "prenoms", [], "any", false, false, false, 186), "html", null, true))) : (print ("")));echo "\" class=\"";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", null, true);echo "\" placeholder=\"Prénom(s)\"></div><div class=\"md:col-span-2\"><label class=\"block text-sm font-medium text-slate-700 mb-1\">Contact (téléphone)</label><input type=\"text\" name=\"contact\" value=\"";// line 190((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", false, false, false, 190)) ? (print (twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, 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", false, false, false, 190), "contact", [], "any", false, false, false, 190), "html", null, true))) : (print ("")));echo "\" class=\"";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", null, true);echo "\" placeholder=\"Ex: 0102030405\"></div></div></div>";}// line 195echo "";// line 197echo " <h3 class=\"text-lg font-semibold text-indigo-800 flex items-center border-b pb-3 mb-5\"><div class=\"w-8 h-8 bg-indigo-200 rounded-lg flex items-center justify-center mr-3\"><i class=\"fas fa-graduation-cap text-indigo-700\"></i></div>Formation souhaitée</h3><div class=\"grid grid-cols-1 md:grid-cols-2 gap-6\"><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Établissement <span class=\"text-red-500\">*</span></label><div class=\"";// line 207echo 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", null, true);echo " bg-slate-100 text-slate-600 cursor-default flex items-center gap-2\"><i class=\"fas fa-lock text-slate-400 text-xs\"></i>";// line 209((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", false, false, false, 209)) ? (print (twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, 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", false, false, false, 209), "nom", [], "any", false, false, false, 209), "html", null, true))) : (print ("Non renseigné")));echo "</div><input type=\"hidden\" id=\"candidature_etablissement\" value=\"";// line 211((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", false, false, false, 211)) ? (print (twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, 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", false, false, false, 211), "id", [], "any", false, false, false, 211), "html", null, true))) : (print ("")));echo "\"></div><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Métier <span class=\"text-red-500\">*</span></label><select name=\"metier_id\" id=\"candidature_metier\" required class=\"";// line 215echo 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", null, true);echo "\">";// line 216if (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", false, false, false, 216)) {// line 217echo " <option value=\"";echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, 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.', 217, $this->source); })()), "metier", [], "any", false, false, false, 217), "id", [], "any", false, false, false, 217), "html", null, true);echo "\" selected>";echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, 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.', 217, $this->source); })()), "metier", [], "any", false, false, false, 217), "nom", [], "any", false, false, false, 217), "html", null, true);echo "</option>";} else {// line 219echo " <option value=\"\">-- Sélectionnez un métier --</option>";}// line 221echo " </select><div id=\"metier-loading\" class=\"hidden text-sm text-indigo-600 mt-1\"><i class=\"fas fa-spinner fa-spin mr-1\"></i> Chargement...</div></div></div>";// line 229echo " <div id=\"metier-info\" class=\"hidden mt-6\"><div class=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-3\"><div class=\"flex items-center gap-3 p-2 bg-indigo-100 rounded-lg\"><i class=\"fas fa-building text-indigo-600\"></i><div><p class=\"text-xs text-indigo-600\">Secteur</p><p id=\"metier-secteur\" class=\"text-sm font-medium\">-</p></div></div><div class=\"flex items-center gap-3 p-2 bg-purple-100 rounded-lg\"><i class=\"fas fa-users text-purple-600\"></i><div><p class=\"text-xs text-purple-600\">Places</p><p id=\"metier-nbrplace\" class=\"text-sm font-medium\">-</p></div></div><div class=\"flex items-center gap-3 p-2 bg-green-100 rounded-lg\"><i class=\"fas fa-graduation-cap text-green-600\"></i><div><p class=\"text-xs text-green-600\">Niveau</p><p id=\"metier-niveau\" class=\"text-sm font-medium\">-</p></div></div><div class=\"flex items-center gap-3 p-2 bg-amber-100 rounded-lg\"><i class=\"fas fa-clock text-amber-600\"></i><div><p class=\"text-xs text-amber-600\">Durée</p><p id=\"metier-duree\" class=\"text-sm font-medium\">-</p></div></div></div></div>";// line 263echo " <h3 class=\"text-lg font-semibold text-purple-800 mb-5 flex items-center border-b pb-3\"><div class=\"w-8 h-8 bg-purple-200 rounded-lg flex items-center justify-center mr-3\"><i class=\"fas fa-cloud-upload-alt text-purple-700\"></i></div>Documents à télécharger <span class=\"text-red-500\"> *</span></h3>";// line 270$this->loadTemplate("partials/_document_upload_plain.html.twig", "candidature/form.html.twig", 270)->display(twig_array_merge($context, ["candidature" => // line 271(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(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(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); })())]));// line 275echo "";// line 277echo " <div class=\"flex flex-col md:flex-row justify-between items-center gap-4 pt-6 border-t border-slate-200\"><div class=\"text-sm text-slate-500\"><i class=\"fas fa-info-circle mr-1\"></i>Les champs marqués d'une <span class=\"text-red-500\">*</span> sont obligatoires</div><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\"><i class=\"fas fa-save mr-2\"></i>Mise à jour</button></div></form></div></div>";// line 292echo " <div class=\"bg-white rounded-2xl shadow-xl border border-slate-200 overflow-hidden\"><div class=\"p-6 md:p-8\">";// line 294echo $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"]]);echo "<div class=\"rounded-xl border border-amber-200 bg-amber-50 p-4 md:p-5 mb-4\"><p class=\"text-sm font-semibold text-amber-800 flex items-center\"><i class=\"fas fa-clipboard-list mr-2\"></i>Partie 2 — Analyse du dossier</p><p class=\"text-sm text-amber-700 mt-1\">Étudiez le dossier, évaluez le candidat et enregistrez le résultat.</p></div>";// line 304$this->loadTemplate("partials/_candidature_evaluation_sections.html.twig", "candidature/form.html.twig", 304)->display($context);// line 305echo "<div class=\"flex flex-col md:flex-row justify-between items-center gap-4 pt-6 border-t border-slate-200\"><div class=\"text-sm text-slate-500\"><i class=\"fas fa-info-circle mr-1\"></i>Les champs marqués d'une <span class=\"text-red-500\">*</span> sont obligatoires</div><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\"><i class=\"fas fa-paper-plane mr-2\"></i>Enregistrer l'évaluation</button></div>";// line 317echo $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');echo "</div></div>";} else {// line 322echo "<div class=\"bg-white rounded-2xl shadow-xl border border-slate-200 overflow-hidden\"><div class=\"p-6 md:p-8\">";// line 325echo $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"]]);echo "";// line 327if (((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))) {// line 328echo " <div class=\"rounded-xl border border-indigo-200 bg-indigo-50 p-4 md:p-5\"><div class=\"flex flex-col md:flex-row md:items-center md:justify-between gap-2\"><div><p class=\"text-sm font-semibold text-indigo-800\">Edition de candidature</p><p class=\"text-sm text-indigo-700 mt-1\">Verifiez les informations puis mettez a jour les documents si necessaire.</p></div><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\">N° ";// line 335echo twig_escape_filter($this->env, ((twig_get_attribute($this->env, $this->source, ($context["candidature"] ?? null), "numero", [], "any", true, true, false, 335)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["candidature"] ?? null), "numero", [], "any", false, false, false, 335), "Non attribue")) : ("Non attribue")), "html", null, true);echo "</span></div></div>";}// line 340echo "";// line 342echo " ";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", true, true, false, 342))) {// line 343echo " <div class=\"rounded-xl border border-orange-200 bg-orange-50 p-5\"><h3 class=\"text-base font-semibold text-orange-800 mb-4 flex items-center\"><div class=\"w-7 h-7 bg-orange-200 rounded-lg flex items-center justify-center mr-2\"><i class=\"fas fa-user-edit text-orange-700 text-sm\"></i></div>Identité du candidat</h3><div class=\"grid grid-cols-1 md:grid-cols-2 gap-4\"><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Nom <span class=\"text-red-500\">*</span></label>";// line 355echo $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", false, false, false, 355), '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"]]);echo "</div><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Prénom(s) <span class=\"text-red-500\">*</span></label>";// line 361echo $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", false, false, false, 361), '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)"]]);echo "</div></div></div>";}// line 366echo "<!-- SECTION 1: TOUS LES UTILISATEURS - Formation souhaitée --><h3 class=\"text-lg font-semibold text-indigo-800 flex items-center border-b pb-3 mb-5\"><div class=\"w-8 h-8 bg-indigo-200 rounded-lg flex items-center justify-center mr-3\"><i class=\"fas fa-graduation-cap text-indigo-700\"></i></div>Formation souhaitée</h3><div class=\"grid grid-cols-1 md:grid-cols-2 gap-6\"><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Établissement <span class=\"text-red-500\">*</span></label>";// line 380if ((((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", false, false, false, 380))) {// line 381echo " ";// line 382echo " <div class=\"";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", null, true);echo " bg-slate-100 text-slate-600 cursor-default flex items-center gap-2\"><i class=\"fas fa-lock text-slate-400 text-xs\"></i>";// line 384echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, 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.', 384, $this->source); })()), "etablissement", [], "any", false, false, false, 384), "nom", [], "any", false, false, false, 384), "html", null, true);echo "</div>";// line 387echo " ";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", false, false, false, 387), 'widget', ["attr" => ["class" => "hidden", "id" => "candidature_etablissement"]]);echo "";} else {// line 389echo " ";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", false, false, false, 389), '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"]]);echo "";}// line 391echo " <div id=\"etablissement-loading\" class=\"hidden text-sm text-indigo-600 mt-1\"><i class=\"fas fa-spinner fa-spin mr-1\"></i> Chargement...</div></div><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Métier <span class=\"text-red-500\">*</span></label>";// line 400echo $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", false, false, false, 400), '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"]]);echo "<div id=\"metier-loading\" class=\"hidden text-sm text-indigo-600 mt-1\"><i class=\"fas fa-spinner fa-spin mr-1\"></i> Chargement...</div></div></div><!-- Informations détaillées du métier --><div id=\"metier-info\" class=\"hidden mt-6\"><div class=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-3\"><div class=\"flex items-center gap-3 p-2 bg-indigo-100 rounded-lg\"><i class=\"fas fa-building text-indigo-600\"></i><div><p class=\"text-xs text-indigo-600\">Secteur</p><p id=\"metier-secteur\" class=\"text-sm font-medium\">-</p></div></div><div class=\"flex items-center gap-3 p-2 bg-purple-100 rounded-lg\"><i class=\"fas fa-users text-purple-600\"></i><div><p class=\"text-xs text-purple-600\">Places</p><p id=\"metier-nbrplace\" class=\"text-sm font-medium\">-</p></div></div><div class=\"flex items-center gap-3 p-2 bg-green-100 rounded-lg\"><i class=\"fas fa-graduation-cap text-green-600\"></i><div><p class=\"text-xs text-green-600\">Niveau</p><p id=\"metier-niveau\" class=\"text-sm font-medium\">-</p></div></div><div class=\"flex items-center gap-3 p-2 bg-amber-100 rounded-lg\"><i class=\"fas fa-clock text-amber-600\"></i><div><p class=\"text-xs text-amber-600\">Durée</p><p id=\"metier-duree\" class=\"text-sm font-medium\">-</p></div></div></div></div><!-- SECTION 2: DOCUMENTS --><h3 class=\"text-lg font-semibold text-purple-800 mb-5 flex items-center border-b pb-3\"><div class=\"w-8 h-8 bg-purple-200 rounded-lg flex items-center justify-center mr-3\"><i class=\"fas fa-cloud-upload-alt text-purple-700\"></i></div>Documents à télécharger <span class=\"text-red-500\"> *</span></h3>";// line 449$this->loadTemplate("partials/_document_upload.html.twig", "candidature/form.html.twig", 449)->display(twig_array_merge($context, ["form" => // line 450(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(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(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); })())]));// line 454echo "<!-- SECTION 3: POUR ENT ET ADMIN - Étude de dossier -->";// line 456if (($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_ENT") || $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_ADMIN"))) {// line 457echo " <h3 class=\"text-lg font-semibold text-amber-800 mb-5 flex items-center border-b pb-3\"><div class=\"w-8 h-8 bg-amber-200 rounded-lg flex items-center justify-center mr-3\"><i class=\"fas fa-clipboard-check text-amber-700\"></i></div>Étude de dossier (ENT)</h3><div class=\"grid grid-cols-1 md:grid-cols-2 gap-4\"><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Statut dossier</label>";// line 467echo $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", false, false, false, 467), '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); })())]]);echo "</div><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Commentaire</label>";// line 471echo $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", false, false, false, 471), '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..."]]);echo "</div></div>";}// line 475echo "<!-- SECTION 4: POUR JURY ET ADMIN - Évaluation entretien -->";// line 477if (($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_JURY") || $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_ADMIN"))) {// line 478echo " <h3 class=\"text-lg font-semibold text-blue-800 mb-5 flex items-center border-b pb-3\"><div class=\"w-8 h-8 bg-blue-200 rounded-lg flex items-center justify-center mr-3\"><i class=\"fas fa-microphone-alt text-blue-700\"></i></div>Évaluation entretien (Jury)</h3><div class=\"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4\"><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Date entretien</label>";// line 488echo $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", false, false, false, 488), '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); })())]]);echo "</div><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Lieu entretien</label>";// line 492echo $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", false, false, false, 492), '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"]]);echo "</div></div><div class=\"grid grid-cols-1 md:grid-cols-3 gap-4 mb-4\"><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Jury n°</label>";// line 499echo $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", false, false, false, 499), '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]]);echo "</div><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Vague</label>";// line 503echo $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", false, false, false, 503), '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]]);echo "</div><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Décision jury</label>";// line 507echo $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", false, false, false, 507), '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); })())]]);echo "</div></div><div class=\"mt-4\"><label class=\"block text-sm font-medium text-slate-700 mb-1\">Commentaire entretien</label>";// line 513echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 513, $this->source); })()), "entcom", [], "any", false, false, false, 513), 'widget', ["attr" => ["class" => (isset($context["input_class"]) || array_key_exists("input_class", $context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.', 513, $this->source); })()), "rows" => 3, "placeholder" => "Observations sur l'entretien..."]]);echo "</div>";}// line 516echo "<!-- SECTION 4bis: GRILLE D'ÉVALUATION DYNAMIQUE -->";// line 518if ((((($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_ENT") || $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_ADMIN")) || $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_JURY")) && array_key_exists("candidature", $context)) && twig_get_attribute($this->env, $this->source, (isset($context["candidature"]) || array_key_exists("candidature", $context) ? $context["candidature"] : (function () { throw new RuntimeError('Variable "candidature" does not exist.', 518, $this->source); })()), "id", [], "any", false, false, false, 518))) {// line 519echo " <div id=\"evaluation-section\"><h3 class=\"text-lg font-semibold text-indigo-800 mb-5 flex items-center border-b pb-3\"><div class=\"w-8 h-8 bg-indigo-200 rounded-lg flex items-center justify-center mr-3\"><i class=\"fas fa-clipboard-check text-indigo-700\"></i></div>Évaluation de l'entretien</h3>";// line 527if ($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_ENT")) {// line 528echo " <div class=\"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4\"><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Date entretien</label>";// line 531echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 531, $this->source); })()), "entdate", [], "any", false, false, false, 531), '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); })())]]);echo "</div><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Lieu entretien</label>";// line 535echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 535, $this->source); })()), "entlieu", [], "any", false, false, false, 535), 'widget', ["attr" => ["class" => (isset($context["input_class"]) || array_key_exists("input_class", $context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.', 535, $this->source); })()), "placeholder" => "Ex: Salle 101"]]);echo "</div></div><div class=\"grid grid-cols-1 md:grid-cols-3 gap-4 mb-4\"><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Numéro du jury</label>";// line 542echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 542, $this->source); })()), "jury", [], "any", false, false, false, 542), 'widget', ["attr" => ["class" => (isset($context["input_class"]) || array_key_exists("input_class", $context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.', 542, $this->source); })()), "min" => 1, "max" => 20]]);echo "</div><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Vague</label>";// line 546echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 546, $this->source); })()), "vague", [], "any", false, false, false, 546), 'widget', ["attr" => ["class" => (isset($context["input_class"]) || array_key_exists("input_class", $context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.', 546, $this->source); })()), "min" => 1]]);echo "</div><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Décision du jury</label>";// line 550echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 550, $this->source); })()), "entstatut", [], "any", false, false, false, 550), 'widget', ["attr" => ["class" => (isset($context["input_class"]) || array_key_exists("input_class", $context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.', 550, $this->source); })())]]);echo "</div></div><div class=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 mb-4\"><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Note 1</label>";// line 557echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 557, $this->source); })()), "note1", [], "any", false, false, false, 557), 'widget', ["attr" => ["class" => (isset($context["input_class"]) || array_key_exists("input_class", $context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.', 557, $this->source); })()), "min" => 0, "max" => 20, "step" => 0.5]]);echo "</div><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Note 2</label>";// line 561echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 561, $this->source); })()), "note2", [], "any", false, false, false, 561), 'widget', ["attr" => ["class" => (isset($context["input_class"]) || array_key_exists("input_class", $context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.', 561, $this->source); })()), "min" => 0, "max" => 20, "step" => 0.5]]);echo "</div><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Note 3</label>";// line 565echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 565, $this->source); })()), "note3", [], "any", false, false, false, 565), 'widget', ["attr" => ["class" => (isset($context["input_class"]) || array_key_exists("input_class", $context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.', 565, $this->source); })()), "min" => 0, "max" => 20, "step" => 0.5]]);echo "</div><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Note 4</label>";// line 569echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 569, $this->source); })()), "note4", [], "any", false, false, false, 569), 'widget', ["attr" => ["class" => (isset($context["input_class"]) || array_key_exists("input_class", $context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.', 569, $this->source); })()), "min" => 0, "max" => 20, "step" => 0.5]]);echo "</div><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Note 5</label>";// line 573echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 573, $this->source); })()), "note5", [], "any", false, false, false, 573), 'widget', ["attr" => ["class" => (isset($context["input_class"]) || array_key_exists("input_class", $context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.', 573, $this->source); })()), "min" => 0, "max" => 20, "step" => 0.5]]);echo "</div><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Note 6</label>";// line 577echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 577, $this->source); })()), "note6", [], "any", false, false, false, 577), 'widget', ["attr" => ["class" => (isset($context["input_class"]) || array_key_exists("input_class", $context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.', 577, $this->source); })()), "min" => 0, "max" => 20, "step" => 0.5]]);echo "</div><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Note 7</label>";// line 581echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 581, $this->source); })()), "note7", [], "any", false, false, false, 581), 'widget', ["attr" => ["class" => (isset($context["input_class"]) || array_key_exists("input_class", $context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.', 581, $this->source); })()), "min" => 0, "max" => 20, "step" => 0.5]]);echo "</div><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Note 8</label>";// line 585echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 585, $this->source); })()), "note8", [], "any", false, false, false, 585), 'widget', ["attr" => ["class" => (isset($context["input_class"]) || array_key_exists("input_class", $context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.', 585, $this->source); })()), "min" => 0, "max" => 20, "step" => 0.5]]);echo "</div><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Note 9</label>";// line 589echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 589, $this->source); })()), "note9", [], "any", false, false, false, 589), 'widget', ["attr" => ["class" => (isset($context["input_class"]) || array_key_exists("input_class", $context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.', 589, $this->source); })()), "min" => 0, "max" => 20, "step" => 0.5]]);echo "</div></div><div class=\"mt-4 mb-6\"><label class=\"block text-sm font-medium text-slate-700 mb-1\">Commentaire entretien</label>";// line 595echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 595, $this->source); })()), "entcom", [], "any", false, false, false, 595), 'widget', ["attr" => ["class" => (isset($context["input_class"]) || array_key_exists("input_class", $context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.', 595, $this->source); })()), "rows" => 3, "placeholder" => "Observations sur l'entretien..."]]);echo "</div>";}// line 598echo "<!-- Évaluations existantes -->";// line 600if ((array_key_exists("evaluations", $context) && (twig_length_filter($this->env, (isset($context["evaluations"]) || array_key_exists("evaluations", $context) ? $context["evaluations"] : (function () { throw new RuntimeError('Variable "evaluations" does not exist.', 600, $this->source); })())) > 0))) {// line 601echo " <div class=\"mb-6 space-y-3\" id=\"existing-evaluations\"><p class=\"text-sm font-medium text-slate-600 flex items-center mb-2\"><i class=\"fas fa-history text-indigo-500 mr-2\"></i>Évaluations précédentes</p>";// line 606$context['_parent'] = $context;$context['_seq'] = twig_ensure_traversable((isset($context["evaluations"]) || array_key_exists("evaluations", $context) ? $context["evaluations"] : (function () { throw new RuntimeError('Variable "evaluations" does not exist.', 606, $this->source); })()));foreach ($context['_seq'] as $context["_key"] => $context["eval"]) {// line 607echo " <div class=\"bg-slate-50 rounded-xl p-4 border border-slate-200\"><div class=\"flex items-center justify-between mb-2\"><div class=\"flex items-center gap-3\"><span class=\"font-medium text-slate-800\">";// line 610echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["eval"], "grille", [], "any", false, false, false, 610), "nom", [], "any", false, false, false, 610), "html", null, true);echo "</span><span class=\"text-xs text-slate-500\">";// line 611echo twig_escape_filter($this->env, twig_date_format_filter($this->env, twig_get_attribute($this->env, $this->source, $context["eval"], "createdAt", [], "any", false, false, false, 611), "d/m/Y H:i"), "html", null, true);echo "</span></div><div class=\"flex items-center gap-2\">";// line 614$context["percentage"] = (((twig_get_attribute($this->env, $this->source, $context["eval"], "noteMaxTotale", [], "any", false, false, false, 614) > 0)) ? (((twig_get_attribute($this->env, $this->source, $context["eval"], "scoreTotal", [], "any", false, false, false, 614) / twig_get_attribute($this->env, $this->source, $context["eval"], "noteMaxTotale", [], "any", false, false, false, 614)) * 100)) : (0));// line 615echo " <span class=\"inline-flex items-center px-3 py-1 rounded-full text-sm font-bold";// line 616if (((isset($context["percentage"]) || array_key_exists("percentage", $context) ? $context["percentage"] : (function () { throw new RuntimeError('Variable "percentage" does not exist.', 616, $this->source); })()) >= 70)) {echo "bg-green-100 text-green-700";} elseif (( // line 617(isset($context["percentage"]) || array_key_exists("percentage", $context) ? $context["percentage"] : (function () { throw new RuntimeError('Variable "percentage" does not exist.', 617, $this->source); })()) >= 40)) {echo "bg-yellow-100 text-yellow-700";} else {// line 618echo "bg-red-100 text-red-700";}echo "\">";// line 619echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["eval"], "scoreTotal", [], "any", false, false, false, 619), "html", null, true);echo " / ";echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["eval"], "noteMaxTotale", [], "any", false, false, false, 619), "html", null, true);echo "</span></div></div><!-- Progress bar --><div class=\"w-full bg-slate-200 rounded-full h-2.5 mb-2\"><div class=\"h-2.5 rounded-full transition-all duration-500";// line 626if (((isset($context["percentage"]) || array_key_exists("percentage", $context) ? $context["percentage"] : (function () { throw new RuntimeError('Variable "percentage" does not exist.', 626, $this->source); })()) >= 70)) {echo "bg-green-500";} elseif (( // line 627(isset($context["percentage"]) || array_key_exists("percentage", $context) ? $context["percentage"] : (function () { throw new RuntimeError('Variable "percentage" does not exist.', 627, $this->source); })()) >= 40)) {echo "bg-yellow-500";} else {// line 628echo "bg-red-500";}echo "\"style=\"width: ";// line 629echo twig_escape_filter($this->env, (isset($context["percentage"]) || array_key_exists("percentage", $context) ? $context["percentage"] : (function () { throw new RuntimeError('Variable "percentage" does not exist.', 629, $this->source); })()), "html", null, true);echo "%\"></div></div>";// line 631if (twig_get_attribute($this->env, $this->source, $context["eval"], "commentaire", [], "any", false, false, false, 631)) {// line 632echo " <p class=\"text-xs text-slate-500 mt-1\"><i class=\"fas fa-comment mr-1\"></i> ";echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["eval"], "commentaire", [], "any", false, false, false, 632), "html", null, true);echo "</p>";}// line 634echo " </div>";}$_parent = $context['_parent'];unset($context['_seq'], $context['_iterated'], $context['_key'], $context['eval'], $context['_parent'], $context['loop']);$context = array_intersect_key($context, $_parent) + $_parent;// line 636echo " </div>";}// line 638echo "";// line 658echo "<!-- Zone dynamique des critères --><div id=\"criteres-container\" class=\"hidden\"><div class=\"bg-white rounded-xl border border-slate-200 overflow-hidden mb-4\"><div class=\"px-5 py-3 bg-slate-50 border-b border-slate-200 flex items-center justify-between\"><span class=\"text-sm font-semibold text-slate-700\"><i class=\"fas fa-star text-yellow-500 mr-1\"></i>Critères d'évaluation</span><span id=\"grille-name\" class=\"text-xs text-indigo-600 font-medium\"></span></div><div class=\"overflow-x-auto\"><table class=\"w-full\"><thead class=\"bg-slate-50/50\"><tr><th class=\"px-5 py-3 text-left text-xs font-semibold text-slate-600 uppercase tracking-wider\">Critère</th><th class=\"px-5 py-3 text-center text-xs font-semibold text-slate-600 uppercase tracking-wider w-28\">Note max</th><th class=\"px-5 py-3 text-center text-xs font-semibold text-slate-600 uppercase tracking-wider w-36\">Note attribuée</th></tr></thead><tbody id=\"criteres-body\" class=\"divide-y divide-slate-100\"><!-- Rempli dynamiquement par JS --></tbody></table></div></div><!-- Score total + progress bar --><div class=\"bg-white rounded-xl border border-slate-200 p-5 mb-4\"><div class=\"flex items-center justify-between mb-3\"><span class=\"text-sm font-semibold text-slate-700\"><i class=\"fas fa-calculator text-indigo-500 mr-1\"></i>Score total</span><span id=\"score-display\" class=\"text-lg font-bold text-slate-800\">0 / 0</span></div><div class=\"w-full bg-slate-200 rounded-full h-3\"><div id=\"score-bar\" class=\"h-3 rounded-full transition-all duration-300 bg-slate-400\" style=\"width: 0%\"></div></div><p id=\"score-label\" class=\"text-xs text-slate-500 mt-2 text-center\"></p></div><!-- Commentaire --><div class=\"bg-white rounded-xl border border-slate-200 p-5 mb-4\"><label class=\"block text-sm font-medium text-slate-700 mb-2\"><i class=\"fas fa-comment-alt text-indigo-500 mr-1\"></i>Observation du jury</label><textarea id=\"evaluation-commentaire\" rows=\"3\"class=\"";// line 707echo twig_escape_filter($this->env, (isset($context["input_class"]) || array_key_exists("input_class", $context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.', 707, $this->source); })()), "html", null, true);echo "\"placeholder=\"Saisissez les observations du jury...\"></textarea></div><!-- Bouton enregistrer --><div class=\"flex justify-end\"><button type=\"button\" id=\"save-evaluation-btn\"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\"><i class=\"fas fa-save mr-2\"></i>Enregistrer l'évaluation</button></div><!-- Message de succès --><div id=\"evaluation-success\" class=\"hidden mt-4 p-4 rounded-xl bg-green-50 text-green-800 border border-green-200\"><div class=\"flex items-center\"><i class=\"fas fa-check-circle text-green-500 mr-3 text-lg\"></i><span id=\"evaluation-success-msg\">Évaluation enregistrée avec succès.</span></div></div><!-- Message d'erreur --><div id=\"evaluation-error\" class=\"hidden mt-4 p-4 rounded-xl bg-red-50 text-red-800 border border-red-200\"><div class=\"flex items-center\"><i class=\"fas fa-exclamation-circle text-red-500 mr-3 text-lg\"></i><span id=\"evaluation-error-msg\">Erreur lors de l'enregistrement.</span></div></div></div></div>";}// line 738echo "<!-- SECTION 5: Visite médicale et résultat final -->";// line 740if ((($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"))) {// line 741echo " <div class=\"bg-emerald-50 rounded-2xl border border-emerald-200 p-6\"><h3 class=\"text-lg font-semibold text-emerald-800 mb-5 flex items-center border-b border-emerald-200 pb-3\"><div class=\"w-8 h-8 bg-emerald-200 rounded-lg flex items-center justify-center mr-3\"><i class=\"fas fa-hospital text-emerald-700\"></i></div>VISITE MÉDICALE & Résultat final</h3><div class=\"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4\"><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Date visite</label>";// line 752echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 752, $this->source); })()), "visdate", [], "any", false, false, false, 752), 'widget', ["attr" => ["class" => (isset($context["input_class"]) || array_key_exists("input_class", $context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.', 752, $this->source); })())]]);echo "</div><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Lieu visite</label>";// line 756echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 756, $this->source); })()), "vislieu", [], "any", false, false, false, 756), 'widget', ["attr" => ["class" => (isset($context["input_class"]) || array_key_exists("input_class", $context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.', 756, $this->source); })()), "placeholder" => "Ex: Centre médical"]]);echo "</div></div><div class=\"grid grid-cols-1 md:grid-cols-3 gap-4\"><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Statut visite</label>";// line 763echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 763, $this->source); })()), "visstatut", [], "any", false, false, false, 763), 'widget', ["attr" => ["class" => (isset($context["input_class"]) || array_key_exists("input_class", $context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.', 763, $this->source); })())]]);echo "</div><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Résultat final</label>";// line 767echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 767, $this->source); })()), "resultat", [], "any", false, false, false, 767), 'widget', ["attr" => ["class" => (isset($context["input_class"]) || array_key_exists("input_class", $context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.', 767, $this->source); })())]]);echo "</div><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Commentaire</label>";// line 771echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 771, $this->source); })()), "viscom", [], "any", false, false, false, 771), 'widget', ["attr" => ["class" => (isset($context["input_class"]) || array_key_exists("input_class", $context) ? $context["input_class"] : (function () { throw new RuntimeError('Variable "input_class" does not exist.', 771, $this->source); })()), "placeholder" => "Commentaire visite..."]]);echo "</div></div></div>";}// line 776echo "<!-- Boutons d'action --><div class=\"flex flex-col md:flex-row justify-between items-center gap-4 pt-6 border-t border-slate-200\"><div class=\"text-sm text-slate-500\"><i class=\"fas fa-info-circle mr-1\"></i>Les champs marqués d'une <span class=\"text-red-500\">*</span> sont obligatoires</div><div class=\"flex gap-3\">";// line 785if (twig_get_attribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 785, $this->source); })()), "user", [], "any", false, false, false, 785)) {// line 786echo " ";// line 787echo " ";$context["age"] = ((twig_get_attribute($this->env, $this->source, 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.', 787, $this->source); })()), "user", [], "any", false, false, false, 787), "datenaissance", [], "any", false, false, false, 787)) ? (twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, twig_date_converter($this->env), "diff", [0 => twig_date_converter($this->env, twig_get_attribute($this->env, $this->source, 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.', 787, $this->source); })()), "user", [], "any", false, false, false, 787), "datenaissance", [], "any", false, false, false, 787))], "method", false, false, false, 787), "y", [], "any", false, false, false, 787)) : (null));// line 788echo "";// line 789if ((($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"))) {// line 790echo " ";// line 791echo " <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\"><i class=\"fas fa-paper-plane mr-2\"></i>Enregistrer l'évaluation</button>";} elseif ((( // line 795(isset($context["age"]) || array_key_exists("age", $context) ? $context["age"] : (function () { throw new RuntimeError('Variable "age" does not exist.', 795, $this->source); })()) >= 16) && ((isset($context["age"]) || array_key_exists("age", $context) ? $context["age"] : (function () { throw new RuntimeError('Variable "age" does not exist.', 795, $this->source); })()) <= 40))) {// line 796echo " ";// line 797echo " <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\"><i class=\"fas fa-paper-plane mr-2\"></i>Soumettre ma candidature</button>";} else {// line 802echo " ";// line 803echo " <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\"><i class=\"fas fa-ban mr-2\"></i>Soumission impossible</button>";}// line 808echo " ";} else {// line 809echo " ";$context["redirectUrl"] = $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("app_candidature_new", ["etablissement" => twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, // line 810(isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 810, $this->source); })()), "request", [], "any", false, false, false, 810), "get", [0 => "etablissement"], "method", false, false, false, 810), "metier" => twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, // line 811(isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 811, $this->source); })()), "request", [], "any", false, false, false, 811), "get", [0 => "metier"], "method", false, false, false, 811)]);// line 813echo "<a href=\"";// line 814echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("app_login", ["redirect" => (isset($context["redirectUrl"]) || array_key_exists("redirectUrl", $context) ? $context["redirectUrl"] : (function () { throw new RuntimeError('Variable "redirectUrl" does not exist.', 814, $this->source); })())]), "html", null, true);echo "\"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\"><i class=\"fas fa-sign-in-alt mr-2\"></i>Se connecter pour postuler</a>";}// line 820echo " </div></div>";// line 823echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->renderBlock((isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 823, $this->source); })()), 'form_end');echo "</div></div>";}// line 828echo "</div><!-- JavaScript pour la gestion dynamique établissement/métier --><script>document.addEventListener('DOMContentLoaded', function() {const etablissementSelect = document.getElementById('candidature_etablissement');const metierSelect = document.getElementById('candidature_metier');const metierInfo = document.getElementById('metier-info');const metierSecteur = document.getElementById('metier-secteur');const metierNiveau = document.getElementById('metier-niveau');const metierNbrPlace = document.getElementById('metier-nbrplace');const metierDuree = document.getElementById('metier-duree');const etablissementLoading = document.getElementById('etablissement-loading');const metierLoading = document.getElementById('metier-loading');const currentMetierValue = metierSelect.value;function loadMetiers(etablissementId, callback) {if (!etablissementId) {metierSelect.innerHTML = '<option value=\"\">-- Choisissez d\\'abord un établissement --</option>';metierSelect.disabled = true;metierInfo.classList.add('hidden');if (callback) callback();return;}metierLoading.classList.remove('hidden');metierSelect.disabled = true;fetch('/candidature/etablissement/' + etablissementId + '/metiers').then(response => response.json()).then(data => {metierSelect.innerHTML = '<option value=\"\">-- Sélectionnez un métier --</option>';const grouped = {};data.forEach(metier => {const secteur = metier.secteur_nom || 'Autres';if (!grouped[secteur]) {grouped[secteur] = [];}grouped[secteur].push(metier);});for (const [secteur, metiers] of Object.entries(grouped)) {const optgroup = document.createElement('optgroup');optgroup.label = secteur;metiers.sort((a, b) => a.nom.localeCompare(b.nom));metiers.forEach(metier => {const option = document.createElement('option');option.value = metier.id;option.dataset.secteur = metier.secteur_nom || '';option.dataset.niveau = metier.niveau || '';option.dataset.duree = metier.duree || '';option.dataset.nbrplace = metier.nbrplace || '';let label = metier.nom;if (metier.nbrplace) {label += ' (' + metier.nbrplace + ' places)';}option.textContent = label;optgroup.appendChild(option);});metierSelect.appendChild(optgroup);}const metierToSelect = currentMetierValue || '";// line 894echo twig_escape_filter($this->env, ((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["app"] ?? null), "request", [], "any", false, true, false, 894), "get", [0 => "metier"], "method", true, true, false, 894)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["app"] ?? null), "request", [], "any", false, true, false, 894), "get", [0 => "metier"], "method", false, false, false, 894), "")) : ("")), "html", null, true);echo "';if (metierToSelect) {const options = metierSelect.options;for (let i = 0; i < options.length; i++) {if (options[i].value == metierToSelect) {options[i].selected = true;updateMetierInfo(options[i]);break;}}}metierSelect.disabled = false;metierLoading.classList.add('hidden');if (callback) callback();}).catch(error => {console.error('Erreur:', error);metierSelect.disabled = false;metierLoading.classList.add('hidden');if (callback) callback();});}function updateMetierInfo(selectedOption) {if (!selectedOption || !selectedOption.value) {metierInfo.classList.add('hidden');return;}metierSecteur.textContent = selectedOption.dataset.secteur || 'Non spécifié';metierNiveau.textContent = selectedOption.dataset.niveau || 'Non spécifié';metierDuree.textContent = selectedOption.dataset.duree || 'Non spécifié';metierNbrPlace.textContent = selectedOption.dataset.nbrplace || 'Non spécifié';metierInfo.classList.remove('hidden');}";// line 933if (twig_get_attribute($this->env, $this->source, 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.', 933, $this->source); })()), "request", [], "any", false, false, false, 933), "get", [0 => "etablissement"], "method", false, false, false, 933)) {// line 934echo " const etablissementId = '";echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, 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.', 934, $this->source); })()), "request", [], "any", false, false, false, 934), "get", [0 => "etablissement"], "method", false, false, false, 934), "html", null, true);echo "';if (etablissementId) {setTimeout(function() {const options = etablissementSelect.options;for (let i = 0; i < options.length; i++) {if (options[i].value == etablissementId) {options[i].selected = true;break;}}loadMetiers(etablissementId);}, 100);}";} else {// line 948echo " if (etablissementSelect.value) {loadMetiers(etablissementSelect.value);} else {metierSelect.innerHTML = '<option value=\"\">-- Choisissez d\\'abord un établissement --</option>';metierSelect.disabled = true;}";}// line 955echo "etablissementSelect.addEventListener('change', function() {loadMetiers(this.value);metierInfo.classList.add('hidden');});metierSelect.addEventListener('change', function() {const selectedOption = this.options[this.selectedIndex];updateMetierInfo(selectedOption);});const form = document.getElementById('candidature-form');form.addEventListener('submit', function(e) {";// line 968if ( !twig_get_attribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 968, $this->source); })()), "user", [], "any", false, false, false, 968)) {// line 969echo " e.preventDefault();alert('Vous devez être connecté pour soumettre une candidature.');const redirectUrl = '/candidature/new?etablissement=' + etablissementSelect.value + '&metier=' + metierSelect.value;window.location.href = '/login?redirect=' + encodeURIComponent(redirectUrl);return false;";}// line 975echo "";// line 977echo " ";if ((twig_get_attribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 977, $this->source); })()), "user", [], "any", false, false, false, 977) && twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 977, $this->source); })()), "user", [], "any", false, false, false, 977), "datenaissance", [], "any", false, false, false, 977))) {// line 978echo " ";$context["age"] = twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, twig_date_converter($this->env), "diff", [0 => twig_date_converter($this->env, twig_get_attribute($this->env, $this->source, 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.', 978, $this->source); })()), "user", [], "any", false, false, false, 978), "datenaissance", [], "any", false, false, false, 978))], "method", false, false, false, 978), "y", [], "any", false, false, false, 978);// line 979echo " ";if ((((isset($context["age"]) || array_key_exists("age", $context) ? $context["age"] : (function () { throw new RuntimeError('Variable "age" does not exist.', 979, $this->source); })()) < 16) || ((isset($context["age"]) || array_key_exists("age", $context) ? $context["age"] : (function () { throw new RuntimeError('Variable "age" does not exist.', 979, $this->source); })()) > 40))) {// line 980echo " e.preventDefault();alert('Vous ne remplissez pas les conditions d\\'âge pour candidater (16 à 40 ans).');return false;";}// line 984echo " ";}// line 985echo "if (!etablissementSelect.value) {e.preventDefault();alert('Veuillez sélectionner un établissement.');return false;}if (!metierSelect.value) {e.preventDefault();alert('Veuillez sélectionner un métier.');return false;}});});</script><!-- JavaScript pour la grille d'évaluation dynamique -->";// line 1002if ((((($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_ENT") || $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_ADMIN")) || $this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_JURY")) && array_key_exists("candidature", $context)) && twig_get_attribute($this->env, $this->source, (isset($context["candidature"]) || array_key_exists("candidature", $context) ? $context["candidature"] : (function () { throw new RuntimeError('Variable "candidature" does not exist.', 1002, $this->source); })()), "id", [], "any", false, false, false, 1002))) {// line 1003echo "<script>document.addEventListener('DOMContentLoaded', function() {const grilleSelect = document.getElementById('grille-select');const criteresContainer = document.getElementById('criteres-container');const criteresBody = document.getElementById('criteres-body');const grilleName = document.getElementById('grille-name');const scoreDisplay = document.getElementById('score-display');const scoreBar = document.getElementById('score-bar');const scoreLabel = document.getElementById('score-label');const saveBtn = document.getElementById('save-evaluation-btn');const commentaireField = document.getElementById('evaluation-commentaire');const successDiv = document.getElementById('evaluation-success');const errorDiv = document.getElementById('evaluation-error');const successMsg = document.getElementById('evaluation-success-msg');const errorMsg = document.getElementById('evaluation-error-msg');if (!grilleSelect) return;const candidatureId = ";// line 1021echo twig_escape_filter($this->env, 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.', 1021, $this->source); })()), "id", [], "any", false, false, false, 1021), "html", null, true);echo ";let currentGrilleId = null;let noteMaxTotale = 0;// Charger les critères quand on sélectionne une grillegrilleSelect.addEventListener('change', function() {const grilleId = this.value;if (!grilleId) {criteresContainer.classList.add('hidden');currentGrilleId = null;return;}currentGrilleId = grilleId;loadCriteres(grilleId);});function loadCriteres(grilleId) {fetch('/evaluation/grille/' + grilleId + '/criteres').then(r => r.json()).then(data => {criteresBody.innerHTML = '';noteMaxTotale = data.grille.noteMaxTotale;grilleName.textContent = data.grille.nom;data.criteres.forEach(critere => {const tr = document.createElement('tr');tr.className = 'hover:bg-slate-50/50 transition';tr.innerHTML = `<td class=\"px-5 py-3\"><div><span class=\"font-medium text-slate-800 text-sm\">\${critere.nom}</span>\${critere.description ? '<p class=\"text-xs text-slate-500 mt-0.5\">' + critere.description + '</p>' : ''}</div></td><td class=\"px-5 py-3 text-center\"><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></td><td class=\"px-5 py-3 text-center\"><input type=\"number\"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\"data-critere-id=\"\${critere.id}\"data-note-max=\"\${critere.noteMax}\"min=\"0\"max=\"\${critere.noteMax}\"step=\"0.5\"placeholder=\"...\"></td>`;criteresBody.appendChild(tr);});criteresContainer.classList.remove('hidden');updateScore();// Charger les notes existantesloadExistingEvaluation(grilleId);// Ajouter les écouteurs sur les champs de notesdocument.querySelectorAll('.note-input').forEach(input => {input.addEventListener('input', function() {const max = parseFloat(this.dataset.noteMax);let val = parseFloat(this.value);if (val > max) { this.value = max; }if (val < 0) { this.value = 0; }updateScore();});});}).catch(err => {console.error('Erreur chargement critères:', err);});}function loadExistingEvaluation(grilleId) {fetch('/evaluation/candidature/' + candidatureId + '/evaluation').then(r => r.json()).then(evaluations => {const existing = evaluations.find(e => e.grilleId == grilleId);if (existing) {existing.notations.forEach(n => {const input = document.querySelector(`.note-input[data-critere-id=\"\${n.critereId}\"]`);if (input && n.note !== null) {input.value = n.note;}});if (existing.commentaire) {commentaireField.value = existing.commentaire;}updateScore();}}).catch(err => console.error('Erreur chargement évaluation:', err));}function updateScore() {let total = 0;document.querySelectorAll('.note-input').forEach(input => {const val = parseFloat(input.value);if (!isNaN(val)) total += val;});scoreDisplay.textContent = total + ' / ' + noteMaxTotale;const percentage = noteMaxTotale > 0 ? (total / noteMaxTotale * 100) : 0;scoreBar.style.width = percentage + '%';// Couleur de la barre de progressionscoreBar.classList.remove('bg-green-500', 'bg-yellow-500', 'bg-red-500', 'bg-slate-400');if (percentage >= 70) {scoreBar.classList.add('bg-green-500');scoreLabel.textContent = 'Excellent';scoreLabel.className = 'text-xs mt-2 text-center text-green-600 font-medium';} else if (percentage >= 40) {scoreBar.classList.add('bg-yellow-500');scoreLabel.textContent = 'Moyen';scoreLabel.className = 'text-xs mt-2 text-center text-yellow-600 font-medium';} else if (total > 0) {scoreBar.classList.add('bg-red-500');scoreLabel.textContent = 'Faible';scoreLabel.className = 'text-xs mt-2 text-center text-red-600 font-medium';} else {scoreBar.classList.add('bg-slate-400');scoreLabel.textContent = '';}}// Enregistrer l'évaluationsaveBtn.addEventListener('click', function() {if (!currentGrilleId) return;successDiv.classList.add('hidden');errorDiv.classList.add('hidden');const notations = [];document.querySelectorAll('.note-input').forEach(input => {notations.push({critereId: parseInt(input.dataset.critereId),note: input.value !== '' ? parseFloat(input.value) : null,});});const payload = {grilleId: parseInt(currentGrilleId),notations: notations,commentaire: commentaireField.value || null,};saveBtn.disabled = true;saveBtn.innerHTML = '<i class=\"fas fa-spinner fa-spin mr-2\"></i> Enregistrement...';fetch('/evaluation/candidature/' + candidatureId + '/evaluer', {method: 'POST',headers: { 'Content-Type': 'application/json' },body: JSON.stringify(payload),}).then(r => r.json()).then(data => {if (data.success) {successMsg.textContent = data.message;successDiv.classList.remove('hidden');errorDiv.classList.add('hidden');// Mettre à jour l'affichage du scorescoreDisplay.textContent = data.scoreTotal + ' / ' + data.noteMaxTotale;} else {errorMsg.textContent = data.error || 'Erreur inconnue.';errorDiv.classList.remove('hidden');successDiv.classList.add('hidden');}}).catch(err => {console.error('Erreur:', err);errorMsg.textContent = 'Erreur réseau lors de l\\'enregistrement.';errorDiv.classList.remove('hidden');successDiv.classList.add('hidden');}).finally(() => {saveBtn.disabled = false;saveBtn.innerHTML = '<i class=\"fas fa-save mr-2\"></i> Enregistrer l\\'évaluation';});});});</script>";}$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);}public function getTemplateName(){return "candidature/form.html.twig";}public function isTraitable(){return false;}public function getDebugInfo(){return array ( 1572 => 1021, 1552 => 1003, 1550 => 1002, 1531 => 985, 1528 => 984, 1522 => 980, 1519 => 979, 1516 => 978, 1513 => 977, 1510 => 975, 1502 => 969, 1500 => 968, 1485 => 955, 1476 => 948, 1458 => 934, 1456 => 933, 1414 => 894, 1346 => 828, 1338 => 823, 1333 => 820, 1324 => 814, 1321 => 813, 1319 => 811, 1318 => 810, 1316 => 809, 1313 => 808, 1306 => 803, 1304 => 802, 1297 => 797, 1295 => 796, 1293 => 795, 1287 => 791, 1285 => 790, 1283 => 789, 1280 => 788, 1277 => 787, 1275 => 786, 1273 => 785, 1262 => 776, 1254 => 771, 1247 => 767, 1240 => 763, 1230 => 756, 1223 => 752, 1210 => 741, 1208 => 740, 1204 => 738, 1170 => 707, 1119 => 658, 1116 => 638, 1112 => 636, 1105 => 634, 1099 => 632, 1097 => 631, 1092 => 629, 1087 => 628, 1082 => 627, 1078 => 626, 1066 => 619, 1061 => 618, 1056 => 617, 1052 => 616, 1049 => 615, 1047 => 614, 1041 => 611, 1037 => 610, 1032 => 607, 1028 => 606, 1021 => 601, 1019 => 600, 1015 => 598, 1009 => 595, 1000 => 589, 993 => 585, 986 => 581, 979 => 577, 972 => 573, 965 => 569, 958 => 565, 951 => 561, 944 => 557, 934 => 550, 927 => 546, 920 => 542, 910 => 535, 903 => 531, 898 => 528, 896 => 527, 886 => 519, 884 => 518, 880 => 516, 874 => 513, 865 => 507, 858 => 503, 851 => 499, 841 => 492, 834 => 488, 822 => 478, 820 => 477, 816 => 475, 809 => 471, 802 => 467, 790 => 457, 788 => 456, 784 => 454, 782 => 452, 781 => 451, 780 => 450, 779 => 449, 727 => 400, 716 => 391, 710 => 389, 704 => 387, 699 => 384, 693 => 382, 691 => 381, 689 => 380, 673 => 366, 665 => 361, 656 => 355, 642 => 343, 639 => 342, 636 => 340, 628 => 335, 619 => 328, 617 => 327, 612 => 325, 607 => 322, 599 => 317, 585 => 305, 583 => 304, 570 => 294, 566 => 292, 550 => 277, 547 => 275, 545 => 273, 544 => 272, 543 => 271, 542 => 270, 533 => 263, 498 => 229, 489 => 221, 485 => 219, 477 => 217, 475 => 216, 471 => 215, 464 => 211, 459 => 209, 454 => 207, 442 => 197, 439 => 195, 429 => 190, 420 => 186, 411 => 182, 399 => 172, 396 => 171, 391 => 168, 387 => 167, 379 => 162, 366 => 151, 363 => 149, 361 => 148, 358 => 147, 356 => 146, 352 => 145, 348 => 143, 345 => 142, 338 => 137, 332 => 135, 330 => 134, 325 => 133, 323 => 132, 313 => 124, 310 => 123, 307 => 122, 304 => 121, 301 => 119, 298 => 118, 291 => 113, 287 => 111, 283 => 110, 279 => 109, 274 => 108, 269 => 106, 265 => 104, 258 => 100, 253 => 97, 250 => 96, 247 => 95, 239 => 91, 230 => 84, 221 => 78, 214 => 74, 198 => 61, 191 => 57, 180 => 48, 177 => 47, 175 => 46, 168 => 41, 162 => 40, 158 => 38, 152 => 37, 141 => 28, 128 => 24, 125 => 23, 121 => 21, 117 => 19, 115 => 18, 112 => 17, 110 => 16, 107 => 15, 103 => 14, 100 => 13, 96 => 12, 93 => 10, 83 => 9, 64 => 3, 53 => 1, 51 => 7, 49 => 6, 36 => 1,);}public function getSourceContext(){return new Source("{% extends 'base.html.twig' %}{% block title %}Nouvelle candidature | DAIP{% endblock %}{# Définition de la classe CSS réutilisable #}{% 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' %}{% set is_edit_page = app.request.attributes.get('_route') == 'app_candidature_edit' %}{% block body %}{# Flash messages #}{% for label, messages in app.flashes %}{% for message in messages %}<div class=\"mb-4 p-4 rounded-lg border{% if label == 'error' %}bg-red-50 border-red-200 text-red-800{% elseif label == 'success' %}bg-green-50 border-green-200 text-green-800{% else %}bg-blue-50 border-blue-200 text-blue-800{% endif %}\">{{ message|raw }}</div>{% endfor %}{% endfor %}<div class=\"bg-gradient-to-r from-indigo-600 to-purple-600 p-8 mb-8 text-white\"><div class=\"flex items-center gap-4 mb-4\"><div class=\"w-16 h-16 bg-white/20 rounded-full flex items-center justify-center\"><i class=\"fas fa-file-alt text-3xl\"></i></div><div><h1 class=\"text-2xl font-bold\">{% if is_edit_page %}Modification de candidature{% else %}Nouvelle candidature{% endif %}</h1><p class=\"text-white/80\">{% 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 %}</p></div></div><!-- Informations du candidat -->{% if app.user %}{% if is_granted('ROLE_ENT') and is_edit_page and candidature is defined %}<div class=\"mt-4 grid grid-cols-1 lg:grid-cols-2 gap-4\"><div class=\"bg-white/10 backdrop-blur-sm rounded-xl p-4 border border-white/20\"><p class=\"text-sm font-semibold text-white/80 mb-3 flex items-center\"><i class=\"fas fa-user-graduate mr-2\"></i>Informations du candidat</p><div class=\"space-y-3\"><div class=\"bg-white/10 rounded-lg px-3 py-2\"><p class=\"text-xs uppercase tracking-wide text-white/70\">Nom du candidat</p><p class=\"text-sm font-semibold text-white mt-1\">{{ candidature.user ? (candidature.user.nom ~ ' ' ~ candidature.user.prenoms)|trim : 'Non renseigne' }}</p></div><div class=\"bg-white/10 rounded-lg px-3 py-2\"><p class=\"text-xs uppercase tracking-wide text-white/70\">Numero de candidature</p><p class=\"text-sm font-semibold text-white mt-1\">{{ candidature.numero|default('Non attribue') }}</p></div></div></div><div class=\"bg-white/10 backdrop-blur-sm rounded-xl p-4 border border-white/20\"><p class=\"text-sm font-semibold text-white/80 mb-3 flex items-center\"><i class=\"fas fa-file-signature mr-2\"></i>Informations de la candidature</p><div class=\"space-y-3\"><div class=\"bg-white/10 rounded-lg px-3 py-2\"><p class=\"text-xs uppercase tracking-wide text-white/70\">Etablissement choisi</p><p class=\"text-sm font-semibold text-white mt-1\">{{ candidature.etablissement ? candidature.etablissement.nom : 'Non renseigne' }}</p></div><div class=\"bg-white/10 rounded-lg px-3 py-2\"><p class=\"text-xs uppercase tracking-wide text-white/70\">Metier choisi</p><p class=\"text-sm font-semibold text-white mt-1\">{{ candidature.metier ? candidature.metier.nom : 'Non renseigne' }}</p></div></div></div></div>{% else %}<div class=\"bg-white/10 backdrop-blur-sm rounded-xl p-4 mt-4\"><div class=\"flex items-center gap-3\"><div class=\"w-10 h-10 bg-white/20 rounded-full flex items-center justify-center\"><i class=\"fas fa-user\"></i></div><div><p class=\"text-sm text-white/80\">Candidat</p><p class=\"font-semibold\">{{ app.user.nom }} {{ app.user.prenoms }}</p></div>{# Calcul et affichage de l'âge #}{% if app.user.datenaissance %}{% set age = date().diff(date(app.user.datenaissance)).y %}<div class=\"ml-4 px-3 py-1 bg-white/20 rounded-full\"><span class=\"text-sm\"><i class=\"fas fa-birthday-cake mr-1\"></i>{{ age }} ans</span></div>{% endif %}<div class=\"ml-auto\"><span class=\"px-3 py-1 bg-white/20 rounded-full text-sm\">{{ app.user.email }}</span><span class=\"ml-2 px-3 py-1 bg-indigo-500 rounded-full text-xs\">{% if is_granted('ROLE_ADMIN') %}ADMIN{% elseif is_granted('ROLE_ENT') %}ENT{% elseif is_granted('ROLE_JURY') %}JURY{% elseif is_granted('ROLE_CANDIDAT') %}CANDIDAT{% endif %}</span></div></div></div>{% endif %}{% endif %}{# Vérification d'âge #}{% if app.user and app.user.datenaissance %}{% set age = date().diff(date(app.user.datenaissance)).y %}{% if age < 16 or age > 40 %}<div class=\"mt-4 bg-red-500/20 backdrop-blur-sm border border-red-500/30 rounded-xl p-4\"><div class=\"flex items-center gap-3\"><div class=\"w-10 h-10 bg-red-500/30 rounded-full flex items-center justify-center\"><i class=\"fas fa-exclamation-triangle text-red-300\"></i></div><div><p class=\"font-semibold text-white\">Âge non conforme</p><p class=\"text-sm text-white/80\">{% if age < 16 %}Vous avez {{ age }} ans. L'âge minimum requis pour candidater est de 16 ans.{% elseif age > 40 %}Vous avez {{ age }} ans. L'âge maximum autorisé pour candidater est de 40 ans.{% endif %}</p></div></div></div>{% endif %}{% endif %}</div><div class=\"max-w-7xl mx-auto px-4 pb-16 {{ is_edit_page ? 'pt-2' : '' }}\">{% include 'partials/_flash_messages.html.twig' %}{% if is_edit_page and candidature is defined and candidature.id %}{# ===== PARTIE 1 : MISE À JOUR DES INFORMATIONS ===== #}<div class=\"bg-white rounded-2xl shadow-xl border border-slate-200 overflow-hidden mb-8\"><div class=\"p-6 md:p-8\"><div class=\"rounded-xl border border-indigo-200 bg-indigo-50 p-4 md:p-5 mb-8\"><div class=\"flex flex-col md:flex-row md:items-center md:justify-between gap-2\"><div><p class=\"text-sm font-semibold text-indigo-800 flex items-center\"><i class=\"fas fa-edit mr-2\"></i> Partie 1 — Mise à jour des informations</p><p class=\"text-sm text-indigo-700 mt-1\">Modifiez les informations du candidat, le métier et les documents.</p></div><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\">N° {{ candidature.numero|default('Non attribué') }}</span></div></div><form id=\"form-update-info\" action=\"{{ path('app_candidature_update_info', {id: candidature.id}) }}\" method=\"POST\" enctype=\"multipart/form-data\" class=\"space-y-10\"><input type=\"hidden\" name=\"_token\" value=\"{{ csrf_token('candidature_update_info_' ~ candidature.id) }}\">{# Identité du candidat (ENT/ADMIN) #}{% if is_granted('ROLE_ENT') or is_granted('ROLE_ADMIN') %}<div class=\"rounded-xl border border-orange-200 bg-orange-50 p-5\"><h3 class=\"text-base font-semibold text-orange-800 mb-4 flex items-center\"><div class=\"w-7 h-7 bg-orange-200 rounded-lg flex items-center justify-center mr-2\"><i class=\"fas fa-user-edit text-orange-700 text-sm\"></i></div>Identité du candidat</h3><div class=\"grid grid-cols-1 md:grid-cols-2 gap-4\"><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Nom <span class=\"text-red-500\">*</span></label><input type=\"text\" name=\"nom\" value=\"{{ candidature.user ? candidature.user.nom : '' }}\" class=\"{{ input_class }}\" placeholder=\"Nom de famille\"></div><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Prénom(s) <span class=\"text-red-500\">*</span></label><input type=\"text\" name=\"prenoms\" value=\"{{ candidature.user ? candidature.user.prenoms : '' }}\" class=\"{{ input_class }}\" placeholder=\"Prénom(s)\"></div><div class=\"md:col-span-2\"><label class=\"block text-sm font-medium text-slate-700 mb-1\">Contact (téléphone)</label><input type=\"text\" name=\"contact\" value=\"{{ candidature.user ? candidature.user.contact : '' }}\" class=\"{{ input_class }}\" placeholder=\"Ex: 0102030405\"></div></div></div>{% endif %}{# Formation souhaitée #}<h3 class=\"text-lg font-semibold text-indigo-800 flex items-center border-b pb-3 mb-5\"><div class=\"w-8 h-8 bg-indigo-200 rounded-lg flex items-center justify-center mr-3\"><i class=\"fas fa-graduation-cap text-indigo-700\"></i></div>Formation souhaitée</h3><div class=\"grid grid-cols-1 md:grid-cols-2 gap-6\"><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Établissement <span class=\"text-red-500\">*</span></label><div class=\"{{ input_class }} bg-slate-100 text-slate-600 cursor-default flex items-center gap-2\"><i class=\"fas fa-lock text-slate-400 text-xs\"></i>{{ candidature.etablissement ? candidature.etablissement.nom : 'Non renseigné' }}</div><input type=\"hidden\" id=\"candidature_etablissement\" value=\"{{ candidature.etablissement ? candidature.etablissement.id : '' }}\"></div><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Métier <span class=\"text-red-500\">*</span></label><select name=\"metier_id\" id=\"candidature_metier\" required class=\"{{ input_class }}\">{% if candidature.metier %}<option value=\"{{ candidature.metier.id }}\" selected>{{ candidature.metier.nom }}</option>{% else %}<option value=\"\">-- Sélectionnez un métier --</option>{% endif %}</select><div id=\"metier-loading\" class=\"hidden text-sm text-indigo-600 mt-1\"><i class=\"fas fa-spinner fa-spin mr-1\"></i> Chargement...</div></div></div>{# Informations détaillées du métier #}<div id=\"metier-info\" class=\"hidden mt-6\"><div class=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-3\"><div class=\"flex items-center gap-3 p-2 bg-indigo-100 rounded-lg\"><i class=\"fas fa-building text-indigo-600\"></i><div><p class=\"text-xs text-indigo-600\">Secteur</p><p id=\"metier-secteur\" class=\"text-sm font-medium\">-</p></div></div><div class=\"flex items-center gap-3 p-2 bg-purple-100 rounded-lg\"><i class=\"fas fa-users text-purple-600\"></i><div><p class=\"text-xs text-purple-600\">Places</p><p id=\"metier-nbrplace\" class=\"text-sm font-medium\">-</p></div></div><div class=\"flex items-center gap-3 p-2 bg-green-100 rounded-lg\"><i class=\"fas fa-graduation-cap text-green-600\"></i><div><p class=\"text-xs text-green-600\">Niveau</p><p id=\"metier-niveau\" class=\"text-sm font-medium\">-</p></div></div><div class=\"flex items-center gap-3 p-2 bg-amber-100 rounded-lg\"><i class=\"fas fa-clock text-amber-600\"></i><div><p class=\"text-xs text-amber-600\">Durée</p><p id=\"metier-duree\" class=\"text-sm font-medium\">-</p></div></div></div></div>{# Documents #}<h3 class=\"text-lg font-semibold text-purple-800 mb-5 flex items-center border-b pb-3\"><div class=\"w-8 h-8 bg-purple-200 rounded-lg flex items-center justify-center mr-3\"><i class=\"fas fa-cloud-upload-alt text-purple-700\"></i></div>Documents à télécharger <span class=\"text-red-500\"> *</span></h3>{% include 'partials/_document_upload_plain.html.twig' with {'candidature': candidature,'document_labels': document_labels,'input_class': input_class} %}{# Bouton Mise à jour #}<div class=\"flex flex-col md:flex-row justify-between items-center gap-4 pt-6 border-t border-slate-200\"><div class=\"text-sm text-slate-500\"><i class=\"fas fa-info-circle mr-1\"></i>Les champs marqués d'une <span class=\"text-red-500\">*</span> sont obligatoires</div><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\"><i class=\"fas fa-save mr-2\"></i>Mise à jour</button></div></form></div></div>{# ===== PARTIE 2 : ANALYSE DU DOSSIER ===== #}<div class=\"bg-white rounded-2xl shadow-xl border border-slate-200 overflow-hidden\"><div class=\"p-6 md:p-8\">{{ form_start(form, {'attr': {'class': 'space-y-10', 'id': 'candidature-form'}}) }}<div class=\"rounded-xl border border-amber-200 bg-amber-50 p-4 md:p-5 mb-4\"><p class=\"text-sm font-semibold text-amber-800 flex items-center\"><i class=\"fas fa-clipboard-list mr-2\"></i>Partie 2 — Analyse du dossier</p><p class=\"text-sm text-amber-700 mt-1\">Étudiez le dossier, évaluez le candidat et enregistrez le résultat.</p></div>{% include 'partials/_candidature_evaluation_sections.html.twig' %}<div class=\"flex flex-col md:flex-row justify-between items-center gap-4 pt-6 border-t border-slate-200\"><div class=\"text-sm text-slate-500\"><i class=\"fas fa-info-circle mr-1\"></i>Les champs marqués d'une <span class=\"text-red-500\">*</span> sont obligatoires</div><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\"><i class=\"fas fa-paper-plane mr-2\"></i>Enregistrer l'évaluation</button></div>{{ form_end(form) }}</div></div>{% else %}<div class=\"bg-white rounded-2xl shadow-xl border border-slate-200 overflow-hidden\"><div class=\"p-6 md:p-8\">{{ form_start(form, {'attr': {'class': 'space-y-10', 'enctype': 'multipart/form-data', 'id': 'candidature-form'}}) }}{% if is_edit_page and candidature is defined %}<div class=\"rounded-xl border border-indigo-200 bg-indigo-50 p-4 md:p-5\"><div class=\"flex flex-col md:flex-row md:items-center md:justify-between gap-2\"><div><p class=\"text-sm font-semibold text-indigo-800\">Edition de candidature</p><p class=\"text-sm text-indigo-700 mt-1\">Verifiez les informations puis mettez a jour les documents si necessaire.</p></div><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\">N° {{ candidature.numero|default('Non attribue') }}</span></div></div>{% endif %}{# Section : Identité du candidat (visible ENT / ADMIN en mode édition) #}{% if is_edit_page and (is_granted('ROLE_ENT') or is_granted('ROLE_ADMIN')) and form.nom is defined %}<div class=\"rounded-xl border border-orange-200 bg-orange-50 p-5\"><h3 class=\"text-base font-semibold text-orange-800 mb-4 flex items-center\"><div class=\"w-7 h-7 bg-orange-200 rounded-lg flex items-center justify-center mr-2\"><i class=\"fas fa-user-edit text-orange-700 text-sm\"></i></div>Identité du candidat</h3><div class=\"grid grid-cols-1 md:grid-cols-2 gap-4\"><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Nom <span class=\"text-red-500\">*</span></label>{{ form_widget(form.nom, {'attr': {'class': input_class, 'placeholder': 'Nom de famille'}}) }}</div><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Prénom(s) <span class=\"text-red-500\">*</span></label>{{ form_widget(form.prenoms, {'attr': {'class': input_class, 'placeholder': 'Prénom(s)'}}) }}</div></div></div>{% endif %}<!-- SECTION 1: TOUS LES UTILISATEURS - Formation souhaitée --><h3 class=\"text-lg font-semibold text-indigo-800 flex items-center border-b pb-3 mb-5\"><div class=\"w-8 h-8 bg-indigo-200 rounded-lg flex items-center justify-center mr-3\"><i class=\"fas fa-graduation-cap text-indigo-700\"></i></div>Formation souhaitée</h3><div class=\"grid grid-cols-1 md:grid-cols-2 gap-6\"><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Établissement <span class=\"text-red-500\">*</span></label>{% if is_edit_page and candidature is defined and candidature.etablissement %}{# En mode édition : établissement fixe (lecture seule) #}<div class=\"{{ input_class }} bg-slate-100 text-slate-600 cursor-default flex items-center gap-2\"><i class=\"fas fa-lock text-slate-400 text-xs\"></i>{{ candidature.etablissement.nom }}</div>{# Champ caché pour maintenir la valeur lors de la soumission #}{{ form_widget(form.etablissement, {'attr': {'class': 'hidden', 'id': 'candidature_etablissement'}}) }}{% else %}{{ form_widget(form.etablissement, {'attr': {'class': input_class, 'id': 'candidature_etablissement'}}) }}{% endif %}<div id=\"etablissement-loading\" class=\"hidden text-sm text-indigo-600 mt-1\"><i class=\"fas fa-spinner fa-spin mr-1\"></i> Chargement...</div></div><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Métier <span class=\"text-red-500\">*</span></label>{{ form_widget(form.metier, {'attr': {'class': input_class, 'id': 'candidature_metier'}}) }}<div id=\"metier-loading\" class=\"hidden text-sm text-indigo-600 mt-1\"><i class=\"fas fa-spinner fa-spin mr-1\"></i> Chargement...</div></div></div><!-- Informations détaillées du métier --><div id=\"metier-info\" class=\"hidden mt-6\"><div class=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-3\"><div class=\"flex items-center gap-3 p-2 bg-indigo-100 rounded-lg\"><i class=\"fas fa-building text-indigo-600\"></i><div><p class=\"text-xs text-indigo-600\">Secteur</p><p id=\"metier-secteur\" class=\"text-sm font-medium\">-</p></div></div><div class=\"flex items-center gap-3 p-2 bg-purple-100 rounded-lg\"><i class=\"fas fa-users text-purple-600\"></i><div><p class=\"text-xs text-purple-600\">Places</p><p id=\"metier-nbrplace\" class=\"text-sm font-medium\">-</p></div></div><div class=\"flex items-center gap-3 p-2 bg-green-100 rounded-lg\"><i class=\"fas fa-graduation-cap text-green-600\"></i><div><p class=\"text-xs text-green-600\">Niveau</p><p id=\"metier-niveau\" class=\"text-sm font-medium\">-</p></div></div><div class=\"flex items-center gap-3 p-2 bg-amber-100 rounded-lg\"><i class=\"fas fa-clock text-amber-600\"></i><div><p class=\"text-xs text-amber-600\">Durée</p><p id=\"metier-duree\" class=\"text-sm font-medium\">-</p></div></div></div></div><!-- SECTION 2: DOCUMENTS --><h3 class=\"text-lg font-semibold text-purple-800 mb-5 flex items-center border-b pb-3\"><div class=\"w-8 h-8 bg-purple-200 rounded-lg flex items-center justify-center mr-3\"><i class=\"fas fa-cloud-upload-alt text-purple-700\"></i></div>Documents à télécharger <span class=\"text-red-500\"> *</span></h3>{% include 'partials/_document_upload.html.twig' with {'form': form,'document_labels': document_labels,'input_class': input_class} %}<!-- SECTION 3: POUR ENT ET ADMIN - Étude de dossier -->{% if is_granted('ROLE_ENT') or is_granted('ROLE_ADMIN') %}<h3 class=\"text-lg font-semibold text-amber-800 mb-5 flex items-center border-b pb-3\"><div class=\"w-8 h-8 bg-amber-200 rounded-lg flex items-center justify-center mr-3\"><i class=\"fas fa-clipboard-check text-amber-700\"></i></div>Étude de dossier (ENT)</h3><div class=\"grid grid-cols-1 md:grid-cols-2 gap-4\"><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Statut dossier</label>{{ form_widget(form.etustatut, {'attr': {'class': input_class}}) }}</div><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Commentaire</label>{{ form_widget(form.etucom, {'attr': {'class': input_class, 'placeholder': 'Commentaire sur le dossier...'}}) }}</div></div>{% endif %}<!-- SECTION 4: POUR JURY ET ADMIN - Évaluation entretien -->{% if is_granted('ROLE_JURY') or is_granted('ROLE_ADMIN') %}<h3 class=\"text-lg font-semibold text-blue-800 mb-5 flex items-center border-b pb-3\"><div class=\"w-8 h-8 bg-blue-200 rounded-lg flex items-center justify-center mr-3\"><i class=\"fas fa-microphone-alt text-blue-700\"></i></div>Évaluation entretien (Jury)</h3><div class=\"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4\"><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Date entretien</label>{{ form_widget(form.entdate, {'attr': {'class': input_class}}) }}</div><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Lieu entretien</label>{{ form_widget(form.entlieu, {'attr': {'class': input_class, 'placeholder': 'Ex: Salle 101'}}) }}</div></div><div class=\"grid grid-cols-1 md:grid-cols-3 gap-4 mb-4\"><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Jury n°</label>{{ form_widget(form.jury, {'attr': {'class': input_class, 'min': 1, 'max': 20}}) }}</div><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Vague</label>{{ form_widget(form.vague, {'attr': {'class': input_class, 'min': 1}}) }}</div><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Décision jury</label>{{ form_widget(form.entstatut, {'attr': {'class': input_class}}) }}</div></div><div class=\"mt-4\"><label class=\"block text-sm font-medium text-slate-700 mb-1\">Commentaire entretien</label>{{ form_widget(form.entcom, {'attr': {'class': input_class, 'rows': 3, 'placeholder': \"Observations sur l'entretien...\"}}) }}</div>{% endif %}<!-- SECTION 4bis: GRILLE D'ÉVALUATION DYNAMIQUE -->{% if (is_granted('ROLE_ENT') or is_granted('ROLE_ADMIN') or is_granted('ROLE_JURY')) and candidature is defined and candidature.id %}<div id=\"evaluation-section\"><h3 class=\"text-lg font-semibold text-indigo-800 mb-5 flex items-center border-b pb-3\"><div class=\"w-8 h-8 bg-indigo-200 rounded-lg flex items-center justify-center mr-3\"><i class=\"fas fa-clipboard-check text-indigo-700\"></i></div>Évaluation de l'entretien</h3>{% if is_granted('ROLE_ENT') %}<div class=\"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4\"><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Date entretien</label>{{ form_widget(form.entdate, {'attr': {'class': input_class}}) }}</div><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Lieu entretien</label>{{ form_widget(form.entlieu, {'attr': {'class': input_class, 'placeholder': 'Ex: Salle 101'}}) }}</div></div><div class=\"grid grid-cols-1 md:grid-cols-3 gap-4 mb-4\"><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Numéro du jury</label>{{ form_widget(form.jury, {'attr': {'class': input_class, 'min': 1, 'max': 20}}) }}</div><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Vague</label>{{ form_widget(form.vague, {'attr': {'class': input_class, 'min': 1}}) }}</div><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Décision du jury</label>{{ form_widget(form.entstatut, {'attr': {'class': input_class}}) }}</div></div><div class=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 mb-4\"><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Note 1</label>{{ form_widget(form.note1, {'attr': {'class': input_class, 'min': 0, 'max': 20, 'step': 0.5}}) }}</div><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Note 2</label>{{ form_widget(form.note2, {'attr': {'class': input_class, 'min': 0, 'max': 20, 'step': 0.5}}) }}</div><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Note 3</label>{{ form_widget(form.note3, {'attr': {'class': input_class, 'min': 0, 'max': 20, 'step': 0.5}}) }}</div><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Note 4</label>{{ form_widget(form.note4, {'attr': {'class': input_class, 'min': 0, 'max': 20, 'step': 0.5}}) }}</div><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Note 5</label>{{ form_widget(form.note5, {'attr': {'class': input_class, 'min': 0, 'max': 20, 'step': 0.5}}) }}</div><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Note 6</label>{{ form_widget(form.note6, {'attr': {'class': input_class, 'min': 0, 'max': 20, 'step': 0.5}}) }}</div><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Note 7</label>{{ form_widget(form.note7, {'attr': {'class': input_class, 'min': 0, 'max': 20, 'step': 0.5}}) }}</div><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Note 8</label>{{ form_widget(form.note8, {'attr': {'class': input_class, 'min': 0, 'max': 20, 'step': 0.5}}) }}</div><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Note 9</label>{{ form_widget(form.note9, {'attr': {'class': input_class, 'min': 0, 'max': 20, 'step': 0.5}}) }}</div></div><div class=\"mt-4 mb-6\"><label class=\"block text-sm font-medium text-slate-700 mb-1\">Commentaire entretien</label>{{ form_widget(form.entcom, {'attr': {'class': input_class, 'rows': 3, 'placeholder': \"Observations sur l'entretien...\"}}) }}</div>{% endif %}<!-- Évaluations existantes -->{% if evaluations is defined and evaluations|length > 0 %}<div class=\"mb-6 space-y-3\" id=\"existing-evaluations\"><p class=\"text-sm font-medium text-slate-600 flex items-center mb-2\"><i class=\"fas fa-history text-indigo-500 mr-2\"></i>Évaluations précédentes</p>{% for eval in evaluations %}<div class=\"bg-slate-50 rounded-xl p-4 border border-slate-200\"><div class=\"flex items-center justify-between mb-2\"><div class=\"flex items-center gap-3\"><span class=\"font-medium text-slate-800\">{{ eval.grille.nom }}</span><span class=\"text-xs text-slate-500\">{{ eval.createdAt|date('d/m/Y H:i') }}</span></div><div class=\"flex items-center gap-2\">{% set percentage = eval.noteMaxTotale > 0 ? (eval.scoreTotal / eval.noteMaxTotale * 100) : 0 %}<span class=\"inline-flex items-center px-3 py-1 rounded-full text-sm font-bold{% if percentage >= 70 %}bg-green-100 text-green-700{% elseif percentage >= 40 %}bg-yellow-100 text-yellow-700{% else %}bg-red-100 text-red-700{% endif %}\">{{ eval.scoreTotal }} / {{ eval.noteMaxTotale }}</span></div></div><!-- Progress bar --><div class=\"w-full bg-slate-200 rounded-full h-2.5 mb-2\"><div class=\"h-2.5 rounded-full transition-all duration-500{% if percentage >= 70 %}bg-green-500{% elseif percentage >= 40 %}bg-yellow-500{% else %}bg-red-500{% endif %}\"style=\"width: {{ percentage }}%\"></div></div>{% if eval.commentaire %}<p class=\"text-xs text-slate-500 mt-1\"><i class=\"fas fa-comment mr-1\"></i> {{ eval.commentaire }}</p>{% endif %}</div>{% endfor %}</div>{% endif %}{#<!-- Sélection de la grille --><div class=\"bg-white rounded-xl border border-slate-200 p-5 mb-4\"><label class=\"block text-sm font-medium text-slate-700 mb-2\"><i class=\"fas fa-th-list text-indigo-500 mr-1\"></i>Sélectionner une grille d'évaluation</label><select id=\"grille-select\" class=\"{{ input_class }}\"><option value=\"\">-- Choisir une grille --</option>{% if grilles is defined %}{% for grille in grilles %}<option value=\"{{ grille.id }}\" data-note-max=\"{{ grille.noteMaxTotale }}\" data-nb-criteres=\"{{ grille.criteres|length }}\">{{ grille.nom }} ({{ grille.criteres|length }} critères — max {{ grille.noteMaxTotale }})</option>{% endfor %}{% endif %}</select></div>#}<!-- Zone dynamique des critères --><div id=\"criteres-container\" class=\"hidden\"><div class=\"bg-white rounded-xl border border-slate-200 overflow-hidden mb-4\"><div class=\"px-5 py-3 bg-slate-50 border-b border-slate-200 flex items-center justify-between\"><span class=\"text-sm font-semibold text-slate-700\"><i class=\"fas fa-star text-yellow-500 mr-1\"></i>Critères d'évaluation</span><span id=\"grille-name\" class=\"text-xs text-indigo-600 font-medium\"></span></div><div class=\"overflow-x-auto\"><table class=\"w-full\"><thead class=\"bg-slate-50/50\"><tr><th class=\"px-5 py-3 text-left text-xs font-semibold text-slate-600 uppercase tracking-wider\">Critère</th><th class=\"px-5 py-3 text-center text-xs font-semibold text-slate-600 uppercase tracking-wider w-28\">Note max</th><th class=\"px-5 py-3 text-center text-xs font-semibold text-slate-600 uppercase tracking-wider w-36\">Note attribuée</th></tr></thead><tbody id=\"criteres-body\" class=\"divide-y divide-slate-100\"><!-- Rempli dynamiquement par JS --></tbody></table></div></div><!-- Score total + progress bar --><div class=\"bg-white rounded-xl border border-slate-200 p-5 mb-4\"><div class=\"flex items-center justify-between mb-3\"><span class=\"text-sm font-semibold text-slate-700\"><i class=\"fas fa-calculator text-indigo-500 mr-1\"></i>Score total</span><span id=\"score-display\" class=\"text-lg font-bold text-slate-800\">0 / 0</span></div><div class=\"w-full bg-slate-200 rounded-full h-3\"><div id=\"score-bar\" class=\"h-3 rounded-full transition-all duration-300 bg-slate-400\" style=\"width: 0%\"></div></div><p id=\"score-label\" class=\"text-xs text-slate-500 mt-2 text-center\"></p></div><!-- Commentaire --><div class=\"bg-white rounded-xl border border-slate-200 p-5 mb-4\"><label class=\"block text-sm font-medium text-slate-700 mb-2\"><i class=\"fas fa-comment-alt text-indigo-500 mr-1\"></i>Observation du jury</label><textarea id=\"evaluation-commentaire\" rows=\"3\"class=\"{{ input_class }}\"placeholder=\"Saisissez les observations du jury...\"></textarea></div><!-- Bouton enregistrer --><div class=\"flex justify-end\"><button type=\"button\" id=\"save-evaluation-btn\"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\"><i class=\"fas fa-save mr-2\"></i>Enregistrer l'évaluation</button></div><!-- Message de succès --><div id=\"evaluation-success\" class=\"hidden mt-4 p-4 rounded-xl bg-green-50 text-green-800 border border-green-200\"><div class=\"flex items-center\"><i class=\"fas fa-check-circle text-green-500 mr-3 text-lg\"></i><span id=\"evaluation-success-msg\">Évaluation enregistrée avec succès.</span></div></div><!-- Message d'erreur --><div id=\"evaluation-error\" class=\"hidden mt-4 p-4 rounded-xl bg-red-50 text-red-800 border border-red-200\"><div class=\"flex items-center\"><i class=\"fas fa-exclamation-circle text-red-500 mr-3 text-lg\"></i><span id=\"evaluation-error-msg\">Erreur lors de l'enregistrement.</span></div></div></div></div>{% endif %}<!-- SECTION 5: Visite médicale et résultat final -->{% if is_granted('ROLE_ENT') or is_granted('ROLE_JURY') or is_granted('ROLE_ADMIN') %}<div class=\"bg-emerald-50 rounded-2xl border border-emerald-200 p-6\"><h3 class=\"text-lg font-semibold text-emerald-800 mb-5 flex items-center border-b border-emerald-200 pb-3\"><div class=\"w-8 h-8 bg-emerald-200 rounded-lg flex items-center justify-center mr-3\"><i class=\"fas fa-hospital text-emerald-700\"></i></div>VISITE MÉDICALE & Résultat final</h3><div class=\"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4\"><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Date visite</label>{{ form_widget(form.visdate, {'attr': {'class': input_class}}) }}</div><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Lieu visite</label>{{ form_widget(form.vislieu, {'attr': {'class': input_class, 'placeholder': 'Ex: Centre médical'}}) }}</div></div><div class=\"grid grid-cols-1 md:grid-cols-3 gap-4\"><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Statut visite</label>{{ form_widget(form.visstatut, {'attr': {'class': input_class}}) }}</div><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Résultat final</label>{{ form_widget(form.resultat, {'attr': {'class': input_class}}) }}</div><div><label class=\"block text-sm font-medium text-slate-700 mb-1\">Commentaire</label>{{ form_widget(form.viscom, {'attr': {'class': input_class, 'placeholder': 'Commentaire visite...'}}) }}</div></div></div>{% endif %}<!-- Boutons d'action --><div class=\"flex flex-col md:flex-row justify-between items-center gap-4 pt-6 border-t border-slate-200\"><div class=\"text-sm text-slate-500\"><i class=\"fas fa-info-circle mr-1\"></i>Les champs marqués d'une <span class=\"text-red-500\">*</span> sont obligatoires</div><div class=\"flex gap-3\">{% if app.user %}{# Vérification de l'âge pour afficher/masquer le bouton de soumission #}{% set age = app.user.datenaissance ? date().diff(date(app.user.datenaissance)).y : null %}{% if is_granted('ROLE_ADMIN') or is_granted('ROLE_ENT') or is_granted('ROLE_JURY') %}{# Les rôles admin/ent/jury peuvent toujours soumettre #}<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\"><i class=\"fas fa-paper-plane mr-2\"></i>Enregistrer l'évaluation</button>{% elseif age >= 16 and age <= 40 %}{# Candidat avec âge valide #}<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\"><i class=\"fas fa-paper-plane mr-2\"></i>Soumettre ma candidature</button>{% else %}{# Candidat avec âge invalide - bouton désactivé #}<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\"><i class=\"fas fa-ban mr-2\"></i>Soumission impossible</button>{% endif %}{% else %}{% set redirectUrl = path('app_candidature_new', {'etablissement': app.request.get('etablissement'),'metier': app.request.get('metier')}) %}<a href=\"{{ path('app_login', {'redirect': redirectUrl}) }}\"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\"><i class=\"fas fa-sign-in-alt mr-2\"></i>Se connecter pour postuler</a>{% endif %}</div></div>{{ form_end(form) }}</div></div>{% endif %}</div><!-- JavaScript pour la gestion dynamique établissement/métier --><script>document.addEventListener('DOMContentLoaded', function() {const etablissementSelect = document.getElementById('candidature_etablissement');const metierSelect = document.getElementById('candidature_metier');const metierInfo = document.getElementById('metier-info');const metierSecteur = document.getElementById('metier-secteur');const metierNiveau = document.getElementById('metier-niveau');const metierNbrPlace = document.getElementById('metier-nbrplace');const metierDuree = document.getElementById('metier-duree');const etablissementLoading = document.getElementById('etablissement-loading');const metierLoading = document.getElementById('metier-loading');const currentMetierValue = metierSelect.value;function loadMetiers(etablissementId, callback) {if (!etablissementId) {metierSelect.innerHTML = '<option value=\"\">-- Choisissez d\\'abord un établissement --</option>';metierSelect.disabled = true;metierInfo.classList.add('hidden');if (callback) callback();return;}metierLoading.classList.remove('hidden');metierSelect.disabled = true;fetch('/candidature/etablissement/' + etablissementId + '/metiers').then(response => response.json()).then(data => {metierSelect.innerHTML = '<option value=\"\">-- Sélectionnez un métier --</option>';const grouped = {};data.forEach(metier => {const secteur = metier.secteur_nom || 'Autres';if (!grouped[secteur]) {grouped[secteur] = [];}grouped[secteur].push(metier);});for (const [secteur, metiers] of Object.entries(grouped)) {const optgroup = document.createElement('optgroup');optgroup.label = secteur;metiers.sort((a, b) => a.nom.localeCompare(b.nom));metiers.forEach(metier => {const option = document.createElement('option');option.value = metier.id;option.dataset.secteur = metier.secteur_nom || '';option.dataset.niveau = metier.niveau || '';option.dataset.duree = metier.duree || '';option.dataset.nbrplace = metier.nbrplace || '';let label = metier.nom;if (metier.nbrplace) {label += ' (' + metier.nbrplace + ' places)';}option.textContent = label;optgroup.appendChild(option);});metierSelect.appendChild(optgroup);}const metierToSelect = currentMetierValue || '{{ app.request.get('metier')|default('') }}';if (metierToSelect) {const options = metierSelect.options;for (let i = 0; i < options.length; i++) {if (options[i].value == metierToSelect) {options[i].selected = true;updateMetierInfo(options[i]);break;}}}metierSelect.disabled = false;metierLoading.classList.add('hidden');if (callback) callback();}).catch(error => {console.error('Erreur:', error);metierSelect.disabled = false;metierLoading.classList.add('hidden');if (callback) callback();});}function updateMetierInfo(selectedOption) {if (!selectedOption || !selectedOption.value) {metierInfo.classList.add('hidden');return;}metierSecteur.textContent = selectedOption.dataset.secteur || 'Non spécifié';metierNiveau.textContent = selectedOption.dataset.niveau || 'Non spécifié';metierDuree.textContent = selectedOption.dataset.duree || 'Non spécifié';metierNbrPlace.textContent = selectedOption.dataset.nbrplace || 'Non spécifié';metierInfo.classList.remove('hidden');}{% if app.request.get('etablissement') %}const etablissementId = '{{ app.request.get('etablissement') }}';if (etablissementId) {setTimeout(function() {const options = etablissementSelect.options;for (let i = 0; i < options.length; i++) {if (options[i].value == etablissementId) {options[i].selected = true;break;}}loadMetiers(etablissementId);}, 100);}{% else %}if (etablissementSelect.value) {loadMetiers(etablissementSelect.value);} else {metierSelect.innerHTML = '<option value=\"\">-- Choisissez d\\'abord un établissement --</option>';metierSelect.disabled = true;}{% endif %}etablissementSelect.addEventListener('change', function() {loadMetiers(this.value);metierInfo.classList.add('hidden');});metierSelect.addEventListener('change', function() {const selectedOption = this.options[this.selectedIndex];updateMetierInfo(selectedOption);});const form = document.getElementById('candidature-form');form.addEventListener('submit', function(e) {{% if not app.user %}e.preventDefault();alert('Vous devez être connecté pour soumettre une candidature.');const redirectUrl = '/candidature/new?etablissement=' + etablissementSelect.value + '&metier=' + metierSelect.value;window.location.href = '/login?redirect=' + encodeURIComponent(redirectUrl);return false;{% endif %}{# Vérification supplémentaire en JavaScript #}{% if app.user and app.user.datenaissance %}{% set age = date().diff(date(app.user.datenaissance)).y %}{% if age < 16 or age > 40 %}e.preventDefault();alert('Vous ne remplissez pas les conditions d\\'âge pour candidater (16 à 40 ans).');return false;{% endif %}{% endif %}if (!etablissementSelect.value) {e.preventDefault();alert('Veuillez sélectionner un établissement.');return false;}if (!metierSelect.value) {e.preventDefault();alert('Veuillez sélectionner un métier.');return false;}});});</script><!-- JavaScript pour la grille d'évaluation dynamique -->{% if (is_granted('ROLE_ENT') or is_granted('ROLE_ADMIN') or is_granted('ROLE_JURY')) and candidature is defined and candidature.id %}<script>document.addEventListener('DOMContentLoaded', function() {const grilleSelect = document.getElementById('grille-select');const criteresContainer = document.getElementById('criteres-container');const criteresBody = document.getElementById('criteres-body');const grilleName = document.getElementById('grille-name');const scoreDisplay = document.getElementById('score-display');const scoreBar = document.getElementById('score-bar');const scoreLabel = document.getElementById('score-label');const saveBtn = document.getElementById('save-evaluation-btn');const commentaireField = document.getElementById('evaluation-commentaire');const successDiv = document.getElementById('evaluation-success');const errorDiv = document.getElementById('evaluation-error');const successMsg = document.getElementById('evaluation-success-msg');const errorMsg = document.getElementById('evaluation-error-msg');if (!grilleSelect) return;const candidatureId = {{ candidature.id }};let currentGrilleId = null;let noteMaxTotale = 0;// Charger les critères quand on sélectionne une grillegrilleSelect.addEventListener('change', function() {const grilleId = this.value;if (!grilleId) {criteresContainer.classList.add('hidden');currentGrilleId = null;return;}currentGrilleId = grilleId;loadCriteres(grilleId);});function loadCriteres(grilleId) {fetch('/evaluation/grille/' + grilleId + '/criteres').then(r => r.json()).then(data => {criteresBody.innerHTML = '';noteMaxTotale = data.grille.noteMaxTotale;grilleName.textContent = data.grille.nom;data.criteres.forEach(critere => {const tr = document.createElement('tr');tr.className = 'hover:bg-slate-50/50 transition';tr.innerHTML = `<td class=\"px-5 py-3\"><div><span class=\"font-medium text-slate-800 text-sm\">\${critere.nom}</span>\${critere.description ? '<p class=\"text-xs text-slate-500 mt-0.5\">' + critere.description + '</p>' : ''}</div></td><td class=\"px-5 py-3 text-center\"><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></td><td class=\"px-5 py-3 text-center\"><input type=\"number\"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\"data-critere-id=\"\${critere.id}\"data-note-max=\"\${critere.noteMax}\"min=\"0\"max=\"\${critere.noteMax}\"step=\"0.5\"placeholder=\"...\"></td>`;criteresBody.appendChild(tr);});criteresContainer.classList.remove('hidden');updateScore();// Charger les notes existantesloadExistingEvaluation(grilleId);// Ajouter les écouteurs sur les champs de notesdocument.querySelectorAll('.note-input').forEach(input => {input.addEventListener('input', function() {const max = parseFloat(this.dataset.noteMax);let val = parseFloat(this.value);if (val > max) { this.value = max; }if (val < 0) { this.value = 0; }updateScore();});});}).catch(err => {console.error('Erreur chargement critères:', err);});}function loadExistingEvaluation(grilleId) {fetch('/evaluation/candidature/' + candidatureId + '/evaluation').then(r => r.json()).then(evaluations => {const existing = evaluations.find(e => e.grilleId == grilleId);if (existing) {existing.notations.forEach(n => {const input = document.querySelector(`.note-input[data-critere-id=\"\${n.critereId}\"]`);if (input && n.note !== null) {input.value = n.note;}});if (existing.commentaire) {commentaireField.value = existing.commentaire;}updateScore();}}).catch(err => console.error('Erreur chargement évaluation:', err));}function updateScore() {let total = 0;document.querySelectorAll('.note-input').forEach(input => {const val = parseFloat(input.value);if (!isNaN(val)) total += val;});scoreDisplay.textContent = total + ' / ' + noteMaxTotale;const percentage = noteMaxTotale > 0 ? (total / noteMaxTotale * 100) : 0;scoreBar.style.width = percentage + '%';// Couleur de la barre de progressionscoreBar.classList.remove('bg-green-500', 'bg-yellow-500', 'bg-red-500', 'bg-slate-400');if (percentage >= 70) {scoreBar.classList.add('bg-green-500');scoreLabel.textContent = 'Excellent';scoreLabel.className = 'text-xs mt-2 text-center text-green-600 font-medium';} else if (percentage >= 40) {scoreBar.classList.add('bg-yellow-500');scoreLabel.textContent = 'Moyen';scoreLabel.className = 'text-xs mt-2 text-center text-yellow-600 font-medium';} else if (total > 0) {scoreBar.classList.add('bg-red-500');scoreLabel.textContent = 'Faible';scoreLabel.className = 'text-xs mt-2 text-center text-red-600 font-medium';} else {scoreBar.classList.add('bg-slate-400');scoreLabel.textContent = '';}}// Enregistrer l'évaluationsaveBtn.addEventListener('click', function() {if (!currentGrilleId) return;successDiv.classList.add('hidden');errorDiv.classList.add('hidden');const notations = [];document.querySelectorAll('.note-input').forEach(input => {notations.push({critereId: parseInt(input.dataset.critereId),note: input.value !== '' ? parseFloat(input.value) : null,});});const payload = {grilleId: parseInt(currentGrilleId),notations: notations,commentaire: commentaireField.value || null,};saveBtn.disabled = true;saveBtn.innerHTML = '<i class=\"fas fa-spinner fa-spin mr-2\"></i> Enregistrement...';fetch('/evaluation/candidature/' + candidatureId + '/evaluer', {method: 'POST',headers: { 'Content-Type': 'application/json' },body: JSON.stringify(payload),}).then(r => r.json()).then(data => {if (data.success) {successMsg.textContent = data.message;successDiv.classList.remove('hidden');errorDiv.classList.add('hidden');// Mettre à jour l'affichage du scorescoreDisplay.textContent = data.scoreTotal + ' / ' + data.noteMaxTotale;} else {errorMsg.textContent = data.error || 'Erreur inconnue.';errorDiv.classList.remove('hidden');successDiv.classList.add('hidden');}}).catch(err => {console.error('Erreur:', err);errorMsg.textContent = 'Erreur réseau lors de l\\'enregistrement.';errorDiv.classList.remove('hidden');successDiv.classList.add('hidden');}).finally(() => {saveBtn.disabled = false;saveBtn.innerHTML = '<i class=\"fas fa-save mr-2\"></i> Enregistrer l\\'évaluation';});});});</script>{% endif %}{% endblock %}", "candidature/form.html.twig", "/home/daip/temporaire/templates/candidature/form.html.twig");}}