Qforgeot's picture
Voici le **cahier des charges complet** pour la refonte du formulaire de préinscription du **Pôle Formation UIMM Poitou-Charentes**, compilé à partir de toutes nos discussions 👇
e24128f verified
Raw History Blame Contribute Delete
33.1 kB
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Préinscription - Pôle Formation UIMM</title>
<link rel="icon" type="image/x-icon" href="https://fi-pc.fr/wp-content/uploads/2021/03/cropped-favicon-32x32.png">
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://unpkg.com/feather-icons"></script>
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
<script>
tailwind.config = {
theme: {
extend: {
colors: {
'uimm-blue': '#005B9F',
'uimm-red': '#E30613',
'uimm-gray': '#6A6A6A',
'uimm-light': '#F5F5F5'
},
fontFamily: {
sans: ['Roboto', 'sans-serif']
}
}
}
}
</script>
<style>
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');
.form-step {
display: none;
animation: fadeIn 0.5s ease-in-out;
}
.form-step.active {
display: block;
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(20px); }
to { opacity: 1; transform: translateY(0); }
}
.progress-step {
width: 40px;
height: 40px;
border: 3px solid #E5E7EB;
}
.progress-step.active {
border-color: #005B9F;
background-color: #005B9F;
color: white;
}
.progress-step.completed {
border-color: #005B9F;
background-color: #005B9F;
color: white;
}
.progress-bar {
height: 3px;
background-color: #E5E7EB;
}
.progress-bar.active {
background-color: #005B9F;
}
</style>
</head>
<body class="font-sans bg-uimm-light min-h-screen">
<div class="container mx-auto px-4 py-8 max-w-4xl">
<!-- Header -->
<header class="mb-8 text-center">
<div class="flex justify-center mb-4">
<img src="https://fi-pc.fr/wp-content/uploads/2021/03/logo-uimm-poitou-charentes.png" alt="UIMM Poitou-Charentes" class="h-16">
</div>
<h1 class="text-3xl font-bold text-uimm-blue mb-2">Préinscription en ligne</h1>
<p class="text-uimm-gray">Remplissez ce formulaire pour faire une demande de préinscription</p>
</header>
<!-- Progress Bar -->
<div class="mb-12">
<div class="flex items-center justify-between relative">
<div class="absolute top-1/2 left-0 right-0 h-1 bg-gray-200 -z-10"></div>
<div class="progress-step rounded-full flex items-center justify-center font-bold bg-white active">
1
</div>
<div class="progress-bar flex-1 mx-2 active"></div>
<div class="progress-step rounded-full flex items-center justify-center font-bold bg-white">
2
</div>
<div class="progress-bar flex-1 mx-2"></div>
<div class="progress-step rounded-full flex items-center justify-center font-bold bg-white">
3
</div>
<div class="progress-bar flex-1 mx-2"></div>
<div class="progress-step rounded-full flex items-center justify-center font-bold bg-white">
4
</div>
</div>
<div class="flex justify-between mt-2 text-sm text-uimm-gray">
<span class="w-10 text-center">Informations</span>
<span class="w-10 text-center">Formation</span>
<span class="w-10 text-center">Parcours</span>
<span class="w-10 text-center">Validation</span>
</div>
</div>
<!-- Form Steps -->
<form id="preinscriptionForm" class="bg-white rounded-lg shadow-md p-6 md:p-8">
<!-- Step 1: Personal Information -->
<div class="form-step active" id="step1">
<h2 class="text-2xl font-bold text-uimm-blue mb-6 flex items-center">
<i data-feather="user" class="mr-2"></i> Informations personnelles
</h2>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div>
<label for="lastname" class="block text-sm font-medium text-uimm-gray mb-1">Nom *</label>
<input type="text" id="lastname" name="lastname" required
class="w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-uimm-blue focus:border-uimm-blue outline-none">
</div>
<div>
<label for="firstname" class="block text-sm font-medium text-uimm-gray mb-1">Prénom *</label>
<input type="text" id="firstname" name="firstname" required
class="w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-uimm-blue focus:border-uimm-blue outline-none">
</div>
<div>
<label for="birthdate" class="block text-sm font-medium text-uimm-gray mb-1">Date de naissance *</label>
<input type="date" id="birthdate" name="birthdate" required
class="w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-uimm-blue focus:border-uimm-blue outline-none">
</div>
<div>
<label for="email" class="block text-sm font-medium text-uimm-gray mb-1">Adresse email *</label>
<input type="email" id="email" name="email" required
class="w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-uimm-blue focus:border-uimm-blue outline-none">
</div>
<div>
<label for="phone" class="block text-sm font-medium text-uimm-gray mb-1">Téléphone *</label>
<input type="tel" id="phone" name="phone" required
class="w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-uimm-blue focus:border-uimm-blue outline-none">
</div>
<div>
<label for="address" class="block text-sm font-medium text-uimm-gray mb-1">Adresse complète *</label>
<input type="text" id="address" name="address" required
class="w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-uimm-blue focus:border-uimm-blue outline-none">
</div>
</div>
<div class="mt-8 flex justify-between">
<div></div> <!-- Empty div for spacing -->
<button type="button" class="next-step bg-uimm-blue text-white px-6 py-2 rounded-lg hover:bg-blue-700 transition duration-200 flex items-center">
Suivant <i data-feather="arrow-right" class="ml-2"></i>
</button>
</div>
</div>
<!-- Step 2: Formation Choice -->
<div class="form-step" id="step2">
<h2 class="text-2xl font-bold text-uimm-blue mb-6 flex items-center">
<i data-feather="book" class="mr-2"></i> Formation souhaitée
</h2>
<div class="space-y-6">
<div>
<label for="domain" class="block text-sm font-medium text-uimm-gray mb-1">Domaine de formation *</label>
<select id="domain" name="domain" required
class="w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-uimm-blue focus:border-uimm-blue outline-none">
<option value="" disabled selected>Sélectionnez un domaine</option>
<option value="industrie">Industrie</option>
<option value="bâtiment">Bâtiment</option>
<option value="numérique">Numérique</option>
<option value="transport">Transport</option>
</select>
</div>
<div>
<label for="formation" class="block text-sm font-medium text-uimm-gray mb-1">Formation *</label>
<select id="formation" name="formation" required
class="w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-uimm-blue focus:border-uimm-blue outline-none" disabled>
<option value="" disabled selected>Veuillez d'abord sélectionner un domaine</option>
</select>
</div>
<div>
<label for="level" class="block text-sm font-medium text-uimm-gray mb-1">Niveau d'entrée souhaité *</label>
<select id="level" name="level" required
class="w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-uimm-blue focus:border-uimm-blue outline-none">
<option value="" disabled selected>Sélectionnez un niveau</option>
<option value="cap">CAP</option>
<option value="bac">Bac Pro</option>
<option value="bts">BTS</option>
<option value="licence">Licence Pro</option>
</select>
</div>
<div>
<label for="site" class="block text-sm font-medium text-uimm-gray mb-1">Site de formation *</label>
<select id="site" name="site" required
class="w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-uimm-blue focus:border-uimm-blue outline-none">
<option value="" disabled selected>Sélectionnez un site</option>
<option value="poitiers">Poitiers</option>
<option value="niort">Niort</option>
<option value="rochefort">Rochefort</option>
<option value="angouleme">Angoulême</option>
</select>
</div>
<div>
<label class="block text-sm font-medium text-uimm-gray mb-1">Comment avez-vous connu le centre ? *</label>
<div class="space-y-2 mt-2">
<label class="flex items-center">
<input type="radio" name="discovery" value="reseaux" class="mr-2" required>
<span>Réseaux sociaux</span>
</label>
<label class="flex items-center">
<input type="radio" name="discovery" value="site" class="mr-2">
<span>Site web</span>
</label>
<label class="flex items-center">
<input type="radio" name="discovery" value="bouche">
<span class="ml-2">Bouche-à-oreille</span>
</label>
<label class="flex items-center">
<input type="radio" name="discovery" value="enseignant" class="mr-2">
<span>Enseignant</span>
</label>
<label class="flex items-center">
<input type="radio" name="discovery" value="salon" class="mr-2">
<span>Salon</span>
</label>
<label class="flex items-center">
<input type="radio" name="discovery" value="autre" class="mr-2">
<span>Autre</span>
<input type="text" name="discovery_other" class="ml-2 px-2 py-1 border rounded hidden" placeholder="Précisez">
</label>
</div>
</div>
</div>
<div class="mt-8 flex justify-between">
<button type="button" class="prev-step text-uimm-blue px-6 py-2 rounded-lg border border-uimm-blue hover:bg-blue-50 transition duration-200 flex items-center">
<i data-feather="arrow-left" class="mr-2"></i> Précédent
</button>
<button type="button" class="next-step bg-uimm-blue text-white px-6 py-2 rounded-lg hover:bg-blue-700 transition duration-200 flex items-center">
Suivant <i data-feather="arrow-right" class="ml-2"></i>
</button>
</div>
</div>
<!-- Step 3: School Path -->
<div class="form-step" id="step3">
<h2 class="text-2xl font-bold text-uimm-blue mb-6 flex items-center">
<i data-feather="award" class="mr-2"></i> Parcours scolaire
</h2>
<div class="space-y-6">
<div>
<label for="diploma" class="block text-sm font-medium text-uimm-gray mb-1">Dernier diplôme obtenu *</label>
<select id="diploma" name="diploma" required
class="w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-uimm-blue focus:border-uimm-blue outline-none">
<option value="" disabled selected>Sélectionnez un diplôme</option>
<option value="aucun">Aucun diplôme</option>
<option value="brevet">Brevet des collèges</option>
<option value="cap">CAP</option>
<option value="bac">Baccalauréat</option>
<option value="bts">BTS</option>
<option value="licence">Licence</option>
<option value="master">Master</option>
</select>
</div>
<div>
<label for="diploma_year" class="block text-sm font-medium text-uimm-gray mb-1">Année d'obtention *</label>
<input type="number" id="diploma_year" name="diploma_year" min="1900" max="2023" required
class="w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-uimm-blue focus:border-uimm-blue outline-none">
</div>
<div>
<label for="school" class="block text-sm font-medium text-uimm-gray mb-1">Établissement fréquenté *</label>
<input type="text" id="school" name="school" required
class="w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-uimm-blue focus:border-uimm-blue outline-none">
</div>
<div>
<label for="status" class="block text-sm font-medium text-uimm-gray mb-1">Statut actuel *</label>
<select id="status" name="status" required
class="w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-uimm-blue focus:border-uimm-blue outline-none">
<option value="" disabled selected>Sélectionnez votre statut</option>
<option value="scolaire">Scolaire</option>
<option value="salarie">Salarié</option>
<option value="demandeur">Demandeur d'emploi</option>
<option value="apprenti">Apprenti</option>
<option value="autre">Autre situation</option>
</select>
</div>
<div id="status_details" class="hidden">
<label for="status_info" class="block text-sm font-medium text-uimm-gray mb-1">Précisions sur votre statut *</label>
<input type="text" id="status_info" name="status_info"
class="w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-uimm-blue focus:border-uimm-blue outline-none">
</div>
<div id="company_field" class="hidden">
<label for="company" class="block text-sm font-medium text-uimm-gray mb-1">Entreprise actuelle</label>
<input type="text" id="company" name="company"
class="w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-uimm-blue focus:border-uimm-blue outline-none">
</div>
</div>
<div class="mt-8 flex justify-between">
<button type="button" class="prev-step text-uimm-blue px-6 py-2 rounded-lg border border-uimm-blue hover:bg-blue-50 transition duration-200 flex items-center">
<i data-feather="arrow-left" class="mr-2"></i> Précédent
</button>
<button type="button" class="next-step bg-uimm-blue text-white px-6 py-2 rounded-lg hover:bg-blue-700 transition duration-200 flex items-center">
Suivant <i data-feather="arrow-right" class="ml-2"></i>
</button>
</div>
</div>
<!-- Step 4: Validation -->
<div class="form-step" id="step4">
<h2 class="text-2xl font-bold text-uimm-blue mb-6 flex items-center">
<i data-feather="check-circle" class="mr-2"></i> Validation finale
</h2>
<div class="bg-uimm-light rounded-lg p-6 mb-6">
<h3 class="text-lg font-semibold text-uimm-blue mb-4">Récapitulatif de votre préinscription</h3>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
<h4 class="font-medium text-uimm-gray">Informations personnelles</h4>
<div id="recap-personal" class="text-sm mt-2 space-y-1"></div>
</div>
<div>
<h4 class="font-medium text-uimm-gray">Formation souhaitée</h4>
<div id="recap-formation" class="text-sm mt-2 space-y-1"></div>
</div>
<div>
<h4 class="font-medium text-uimm-gray">Parcours scolaire</h4>
<div id="recap-school" class="text-sm mt-2 space-y-1"></div>
</div>
</div>
</div>
<div class="mb-6">
<label class="flex items-start">
<input type="checkbox" id="rgpd" name="rgpd" required class="mt-1 mr-2">
<span class="text-sm">J'accepte le traitement de mes données conformément à la <a href="#" class="text-uimm-blue underline">politique de confidentialité</a>. *</span>
</label>
</div>
<div class="flex flex-col md:flex-row justify-between items-center gap-4">
<button type="button" class="prev-step text-uimm-blue px-6 py-2 rounded-lg border border-uimm-blue hover:bg-blue-50 transition duration-200 flex items-center w-full md:w-auto justify-center">
<i data-feather="arrow-left" class="mr-2"></i> Modifier mes réponses
</button>
<button type="submit" class="bg-uimm-red text-white px-6 py-2 rounded-lg hover:bg-red-700 transition duration-200 flex items-center w-full md:w-auto justify-center">
<i data-feather="send" class="mr-2"></i> Envoyer ma préinscription
</button>
</div>
</div>
</form>
<!-- Help Section -->
<div class="mt-12 bg-white rounded-lg shadow-md p-6">
<div class="flex items-center mb-4">
<i data-feather="help-circle" class="text-uimm-red mr-2"></i>
<h3 class="text-lg font-bold text-uimm-blue">Besoin d'aide ?</h3>
</div>
<p class="text-uimm-gray mb-4">Notre équipe est à votre disposition pour répondre à vos questions :</p>
<div class="space-y-2">
<div class="flex items-center">
<i data-feather="mail" class="text-uimm-gray mr-2"></i>
<a href="mailto:contact@fi-pc.fr" class="text-uimm-blue hover:underline">contact@fi-pc.fr</a>
</div>
<div class="flex items-center">
<i data-feather="phone" class="text-uimm-gray mr-2"></i>
<a href="tel:+33000000000" class="text-uimm-blue hover:underline">05 00 00 00 00</a>
</div>
</div>
</div>
</div>
<script>
feather.replace();
document.addEventListener('DOMContentLoaded', function() {
// Form navigation
const steps = document.querySelectorAll('.form-step');
const progressSteps = document.querySelectorAll('.progress-step');
const progressBars = document.querySelectorAll('.progress-bar');
let currentStep = 0;
function showStep(stepIndex) {
steps.forEach((step, index) => {
if (index === stepIndex) {
step.classList.add('active');
progressSteps[index].classList.add('active');
if (index > 0) progressBars[index-1].classList.add('active');
} else {
step.classList.remove('active');
progressSteps[index].classList.remove('active');
if (index > 0) progressBars[index-1].classList.remove('active');
}
// Mark previous steps as completed
if (index < stepIndex) {
progressSteps[index].classList.add('completed');
if (index > 0) progressBars[index-1].classList.add('active');
} else if (index > stepIndex) {
progressSteps[index].classList.remove('completed');
if (index > 0) progressBars[index-1].classList.remove('active');
}
});
currentStep = stepIndex;
}
document.querySelectorAll('.next-step').forEach(button => {
button.addEventListener('click', function() {
// Simple validation - in a real app you would validate each field
const currentStepForm = steps[currentStep];
const requiredFields = currentStepForm.querySelectorAll('[required]');
let isValid = true;
requiredFields.forEach(field => {
if (!field.value) {
field.classList.add('border-red-500');
isValid = false;
} else {
field.classList.remove('border-red-500');
}
});
if (isValid) {
showStep(currentStep + 1);
if (currentStep === steps.length - 1) {
updateRecap(); // Update the summary on the last step
}
}
});
});
document.querySelectorAll('.prev-step').forEach(button => {
button.addEventListener('click', function() {
showStep(currentStep - 1);
});
});
// Dynamic fields
document.querySelectorAll('input[name="discovery"]').forEach(radio => {
radio.addEventListener('change', function() {
const otherInput = document.querySelector('input[name="discovery_other"]');
if (this.value === 'autre') {
otherInput.classList.remove('hidden');
otherInput.required = true;
} else {
otherInput.classList.add('hidden');
otherInput.required = false;
}
});
});
document.getElementById('status').addEventListener('change', function() {
const statusDetails = document.getElementById('status_details');
const companyField = document.getElementById('company_field');
if (this.value === 'salarie') {
companyField.classList.remove('hidden');
document.getElementById('company').required = true;
} else {
companyField.classList.add('hidden');
document.getElementById('company').required = false;
}
if (this.value === 'autre') {
statusDetails.classList.remove('hidden');
document.getElementById('status_info').required = true;
} else {
statusDetails.classList.add('hidden');
document.getElementById('status_info').required = false;
}
});
// Fake dynamic loading of formations based on domain
document.getElementById('domain').addEventListener('change', function() {
const formationSelect = document.getElementById('formation');
formationSelect.innerHTML = '<option value="" disabled selected>Chargement...</option>';
formationSelect.disabled = true;
// Simulate API call
setTimeout(() => {
formationSelect.innerHTML = '<option value="" disabled selected>Sélectionnez une formation</option>';
const formations = {
'industrie': ['Technicien d\'usinage', 'Maintenance industrielle', 'Chaudronnerie'],
'bâtiment': ['Électricien', 'Plomberie', 'Peinture en bâtiment'],
'numérique': ['Développeur web', 'Infographiste', 'Administrateur réseau'],
'transport': ['Conduite routière', 'Logistique', 'Maintenance véhicules']
};
formations[this.value].forEach(formation => {
const option = document.createElement('option');
option.value = formation.toLowerCase().replace(/\s+/g, '-');
option.textContent = formation;
formationSelect.appendChild(option);
});
formationSelect.disabled = false;
}, 800);
});
// Update the summary
function updateRecap() {
// Personal info
const personalData = {
'Nom': document.getElementById('lastname').value,
'Prénom': document.getElementById('firstname').value,
'Date de naissance': document.getElementById('birthdate').value,
'Email': document.getElementById('email').value,
'Téléphone': document.getElementById('phone').value,
'Adresse': document.getElementById('address').value
};
let personalHtml = '';
for (const [key, value] of Object.entries(personalData)) {
personalHtml += `<div><span class="font-medium">${key}:</span> ${value || 'Non renseigné'}</div>`;
}
document.getElementById('recap-personal').innerHTML = personalHtml;
// Formation info
const formationData = {
'Domaine': document.getElementById('domain').options[document.getElementById('domain').selectedIndex].text,
'Formation': document.getElementById('formation').options[document.getElementById('formation').selectedIndex].text,
'Niveau': document.getElementById('level').options[document.getElementById('level').selectedIndex].text,
'Site': document.getElementById('site').options[document.getElementById('site').selectedIndex].text,
'Découverte': document.querySelector('input[name="discovery"]:checked') ?
(document.querySelector('input[name="discovery"]:checked').value === 'autre' ?
document.querySelector('input[name="discovery_other"]').value :
document.querySelector('input[name="discovery"]:checked').nextElementSibling.textContent) : 'Non renseigné'
};
let formationHtml = '';
for (const [key, value] of Object.entries(formationData)) {
formationHtml += `<div><span class="font-medium">${key}:</span> ${value || 'Non renseigné'}</div>`;
}
document.getElementById('recap-formation').innerHTML = formationHtml;
// School info
const schoolData = {
'Dernier diplôme': document.getElementById('diploma').options[document.getElementById('diploma').selectedIndex].text,
'Année d\'obtention': document.getElementById('diploma_year').value,
'Établissement': document.getElementById('school').value,
'Statut actuel': document.getElementById('status').options[document.getElementById('status').selectedIndex].text,
'Précisions': document.getElementById('status').value === 'autre' ? document.getElementById('status_info').value :
document.getElementById('status').value === 'salarie' ? document.getElementById('company').value : 'Non applicable'
};
let schoolHtml = '';
for (const [key, value] of Object.entries(schoolData)) {
schoolHtml += `<div><span class="font-medium">${key}:</span> ${value || 'Non renseigné'}</div>`;
}
document.getElementById('recap-school').innerHTML = schoolHtml;
}
// Form submission
document.getElementById('preinscriptionForm').addEventListener('submit', function(e) {
e.preventDefault();
// In a real app, you would send the data to the server here
alert('Formulaire soumis avec succès ! Un email de confirmation vous a été envoyé.');
showStep(0); // Reset to first step
this.reset();
// Reset progress indicators
progressSteps.forEach(step => step.classList.remove('completed', 'active'));
progressBars.forEach(bar => bar.classList.remove('active'));
progressSteps[0].classList.add('active');
});
});
</script>
</body>
</html>