{% extends 'base.html.twig' %}
{% block page_contents %}
<section class="section section-page-title bg-gradient pt-xl-5 py-4" data-aos='fade-down'>
<div class="container">
<div class="row">
<div class="col-12 text-center text-white">
<h1 class="page-name font-weight-bold my-2">
{% trans %}DÉPOSER VOTRE CANDIDATURE{% endtrans %}
</h1>
</div>
</div>
</div>
</section>
<section class="section section-form section-form-2 mb-5 mt-4">
<div class="container">
<div class="row">
<div class="col-12 text-center mb-4">
<div class="offre-logo mb-3">
{% if job.logoUrl %}
<img src="{{ job.logoUrl }}" alt />
{% endif %}
</div>
<div class="font-weight-bold font-30 text-dark-purple mb-3">{{ job.offerTitle }}</div>
<div class="font-italic text-dark-purple">{% trans %}Référence de l'offre{% endtrans %} : {{ job.code }}</div>
</div>
<div class="col-12">
<form id="apply-job">
<input type="hidden" name="offer" value="{{ job.id }}">
<div class="section-title text-left mb-2"><span>/</span> {% trans %}Mon statut ÉSTIAM{% endtrans %}</div>
<div class="form-group">
{% for status in statusCandidate %}
<div class="form-check mx-0 px-0 mb-2">
<div class="custom-control custom-radio">
<input type="radio" class="custom-control-input" id="status-{{ status.id }}" name="status" value="{{ status.id }}">
<label class="custom-control-label text-dark-purple font-weight-normal" for="status-{{ status.id }}">{{ status.name }}</label>
</div>
</div>
{% endfor %}
</div>
<div class="section-title text-left mb-2"><span>/</span> {% trans %}Mon dossier ÉSTIAM{% endtrans %}</div>
<div class="row">
<div class="col-lg-4">
<div class="form-group row row-gender align-items-center mt-2">
<label class="col-form-label font-weight-normal col-4 pt-0 pb-0">{% trans %}Civilité{% endtrans %}<span class="text-orange">*</span> :</label>
<div class="col-8 pl-0">
<div class="form-check form-check-inline mr-0">
<div class="custom-control custom-radio">
<input type="radio" class="custom-control-input" id="mr" name="gender" value="1" required>
<label class="custom-control-label text-dark-purple" for="mr">{% trans %}Madame{% endtrans %}</label>
</div>
</div>
<div class="form-check form-check-inline ml-3 mr-0">
<div class="custom-control custom-radio">
<input type="radio" class="custom-control-input" id="mrs" name="gender" value="0" required>
<label class="custom-control-label text-dark-purple" for="mrs">{% trans %}Monsieur{% endtrans %}</label>
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-4">
<div class="form-group">
<input type="text" class="form-control" name="firstName" placeholder="{% trans %}Nom de famille*{% endtrans %}">
</div>
</div>
<div class="col-lg-4">
<div class="form-group">
<input type="text" class="form-control" name="lastName" placeholder="{% trans %}Prénom*{% endtrans %}" required>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-4">
<div class="form-group">
<input type="text" class="form-control" name="phone" placeholder="{% trans %}Téléphone*{% endtrans %}" required>
</div>
</div>
<div class="col-lg-4">
<div class="form-group">
<input type="text" class="form-control" name="email" placeholder="{% trans %}Adresse e-mail*{% endtrans %}" required>
</div>
</div>
<div class="col-lg-4">
<div class="form-group">
<select class="form-control" name="studyLevel">
<option value>{% trans %}Niveau d'étude{% endtrans %}</option>
{% for studyLevel in studyLevels %}
<option value="{{ studyLevel.id }}">{{ studyLevel.name }}</option>
{% endfor %}
</select>
</div>
</div>
</div>
<div class="form-group">
<textarea class="form-control" name="message" placeholder="{% trans %}Message au recruteur*{% endtrans %}" required></textarea>
</div>
<div class="section-title text-left mb-2"><span>/</span> {% trans %}Pièces complémentaires{% endtrans %}</div>
<p class="font-italic font-weight-300">{% trans %}2 Mo maximum par pièces jointes.{% endtrans %}<br/>
{% trans %}Formats autorisés : JPG, PDF, PNG (les CV et lettre de motivation peuvent aussi être au format Word).{% endtrans %}</p>
<div class="row field-upload">
<div class="col-12 form-group curriculumVitae">
<div>
<div class="group-item mb-1">
<input id="file_cv" type="file" class="form-control" name="file_cv" value accept=".pdf,.docx,.doc,.png,.jpg"/>
<label class="d-flex flex-column" for="file_cv">
<div class="d-flex align-items-center">
<span class="upload-btn cursor cloud-btn px-3">
<i class="fas fa-cloud-arrow-up"></i>
</span>
<span class="text-dark-purple ml-3 font-weight-normal">{% trans %}Votre cv <span class="text-orange">*</{% endtrans %}</span>
</div>
<span class="file-desc flex-1 d-flex align-items-center mt-2">
<i class="fa-solid fa-paperclip-vertical text-orange mr-2"></i>
<span class="upload-file-name"></span>
<i class="far fa-xmark ml-3 cursor"></i>
</span>
</label>
</div>
<div class="group-item mb-1">
<input id="file_cover" type="file" class="form-control" name="file_cover" value accept=".pdf,.docx,.doc,.png,.jpg"/>
<label class="d-flex flex-column" for="file_cover">
<div class="d-flex align-items-center">
<span class="upload-btn cursor cloud-btn px-3">
<i class="fas fa-cloud-arrow-up"></i>
</span>
<span class="text-dark-purple ml-3 font-weight-normal">{% trans %}Votre lettre de motivation <span class="text-orange">*</{% endtrans %}</span>
</div>
<span class="file-desc flex-1 d-flex align-items-center mt-2">
<i class="fa-solid fa-paperclip-vertical text-orange mr-2"></i>
<span class="upload-file-name"></span>
<i class="far fa-xmark ml-3 cursor"></i>
</span>
</label>
</div>
</div>
</div>
</div>
{% if captcha_enabled %}
<div class="captcha-row mb-4 d-flex justify-content-center">
<div class="g-recaptcha animate__animated" data-sitekey="{{captcha_key}}"></div>
</div>
{% endif %}
<div class="notification-error mb-4 text-center text-danger font-weight-bold" style="display: none;"></div>
<div class="text-center form-submit">
<button type="submit" id="btn-submit" class="link-gradient"><span>{% trans %}Envoyer votre candidature{% endtrans %}</span><i class="far fa-arrow-right"></i></button>
</div>
</form>
</div>
</div>
</div>
</section>
<div class="modal fade" id="thankYouModal" tabindex="-1" role="dialog" aria-labelledby="thankYouModalTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<a href="{{ path('home') }}">
<img src="{{ asset('assets/images/logo.svg') }}" alt="Estiam">
</a>
</div>
<div class="modal-body">
<div class="text-center mb-4">
{% trans with {'%name%': job.offerTitle} from 'app' %}Nous vous confirmons la bonne réception de votre candidature au poste de <b>%name%</b>. Nous allons l'étudier rapidement afin de vous donner une réponse dans les plus brefs délais. Merci ! %name%{% endtrans %}
</div>
<div class="text-center">
<button type="button" class="common-btn" data-dismiss="modal">{% trans %}Fermer{% endtrans %}</button>
</div>
</div>
</div>
</div>
</div>
{% endblock %}
{% block custom_javascripts %}
<script type="text/javascript">
$(document).ready(function($){
var input = $('input[type=file]');
input.each(function(event){
$('.curriculumVitae .fa-xmark').click(function (event) {
event.preventDefault();
event.stopPropagation();
$(this).val('')
$(this).removeClass('selected')
$(this).next('label .upload-file-name').html('')
})
$(this).change(function(event) {
let result = checkFile($(this));
if(result){
$(this).val('');
showMessage(result);
return false;
}
$(this).addClass('selected');
$(this).next('label').find('.upload-file-name').html(event.target.files[0].name)
});
});
var current_input;
$('.fa-xmark').click(function (event) {
current_input = $(this).closest('.group-item').find('input[type=file]');
event.preventDefault();
event.stopPropagation();
current_input.val('');
current_input.removeClass('selected');
});
$('#apply-job').on('submit', function (e) {
event.preventDefault();
let $button = $(this).find('#btn-submit');
loadButton($button);
{% if captcha_enabled %}
if (grecaptcha.getResponse().length == 0) {
showMessage('{% trans %}Veuillez vérifier le recaptcha{% endtrans %}');
return false;
}
{% endif %}
if(!$("#file_cv").val()){
showMessage('{% trans %}Merci de choisir votre CV{% endtrans %}');
return false;
}
if(!$("#file_cover").val()){
showMessage('{% trans %}Merci de choisir votre lettre de motivation{% endtrans %}');
return false;
}
let formData = new FormData(this);
$.ajax({
url: "{{ path('job.save_apply') }}",
type: "POST",
dataType: 'json',
data : formData,
contentType: false,
processData: false,
success: function(result) {
if(result.status == 'success'){
resetForm();
$('#thankYouModal').modal();
removeLoadButton($button);
}else{
showMessage(result.errors.errorMessage);
}
grecaptcha.reset();
}
}).always(function () {
removeLoadButton($button)
});
});
});
function resetForm(){
$('#apply-job').each(function(){
this.reset();
$('.fa-xmark').trigger('click');
$('#skill-selected').text(0);
});
}
</script>
{% endblock %}