{% extends 'backfront.html.twig' %}
{% block title %}Formations E-learning SIP Academy - Apprenez en ligne à votre rythme{% endblock %}
{% block meta_description %}
Découvrez nos formations E-learning chez SIP Academy. Apprenez en ligne à votre rythme avec nos cours certifiants et formateurs experts.
{% endblock %}
{% block body %}
<style>
/* ===== COULEURS MODERNES ===== */
:root {
--gold: #FFAE27;
--gold-dark: #e09500;
--gold-light: #fff8e6;
--navy: #1F3971;
--navy-dark: #162d5a;
--navy-light: #e8edf8;
--text-dark: #1a2a3a;
--text-muted: #6c757d;
--border-light: #eef2f6;
}
/* ===== BREADCRUMB MODERNE ===== */
.breadcrumb-area {
background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
padding: 100px 0 120px;
position: relative;
text-align: center;
}
.breadcrumb-title h1 {
color: #fff;
font-size: 48px;
font-weight: 800;
margin-bottom: 10px;
letter-spacing: -1px;
}
.breadcrumb-list {
list-style: none;
padding: 0;
margin: 0;
display: flex;
justify-content: center;
gap: 15px;
align-items: center;
}
.breadcrumb-list li, .breadcrumb-list li a {
color: rgba(255,255,255,0.7);
font-size: 15px;
text-decoration: none;
transition: color 0.3s;
}
.breadcrumb-list li a:hover {
color: var(--gold);
}
.breadcrumb-list li.active {
color: var(--gold);
}
.breadcrumb-list li i {
font-size: 14px;
color: var(--gold);
}
/* ===== SECTION TITRES ===== */
.section-title-wrapper {
text-align: center;
margin-bottom: 50px;
}
.section-title h3 {
font-size: 36px;
font-weight: 800;
color: var(--text-dark);
margin-bottom: 12px;
position: relative;
display: inline-block;
}
.section-title h3::after {
content: '';
position: absolute;
bottom: -12px;
left: 50%;
transform: translateX(-50%);
width: 60px;
height: 4px;
background: linear-gradient(90deg, var(--gold), var(--gold-dark));
border-radius: 2px;
}
.section-title p {
font-size: 16px;
color: var(--text-muted);
margin-top: 20px;
}
/* ===== COURSE AREA ===== */
.course-area {
padding: 80px 0;
background: #fff;
}
/* CARTE FORMATION - HAUTEUR ÉGALE */
.single-item {
background: #fff;
border-radius: 20px;
overflow: hidden;
box-shadow: 0 5px 20px rgba(0,0,0,0.05);
transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
height: 100%;
display: flex;
flex-direction: column;
border: 1px solid var(--border-light);
}
.single-item:hover {
transform: translateY(-8px);
box-shadow: 0 20px 40px rgba(31,57,113,0.15);
border-color: var(--gold);
}
/* IMAGE */
.single-item-image {
position: relative;
overflow: hidden;
height: 220px;
background: linear-gradient(135deg, #f8faff 0%, #fff 100%);
display: flex;
align-items: center;
justify-content: center;
}
.single-item-image a {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
}
.single-item-image img {
width: auto;
height: auto;
max-width: 100%;
max-height: 100%;
object-fit: contain;
transition: transform 0.4s ease;
}
.single-item:hover .single-item-image img {
transform: scale(1.05);
}
/* OVERLAY HOVER */
.overlay-effect {
position: relative;
}
.courses-hover-info {
position: absolute;
bottom: -100%;
left: 0;
right: 0;
background: linear-gradient(135deg, rgba(31,57,113,0.95), rgba(22,45,90,0.95));
padding: 15px;
transition: bottom 0.3s ease;
backdrop-filter: blur(5px);
z-index: 10;
}
.single-item:hover .courses-hover-info {
bottom: 0;
}
.courses-hover-action {
display: flex;
align-items: center;
gap: 12px;
flex-wrap: wrap;
}
.courses-hover-thumb img {
width: 40px;
height: 40px;
border-radius: 50%;
object-fit: cover;
border: 2px solid var(--gold);
}
.courses-hover-action h4 a {
color: #fff;
font-size: 14px;
font-weight: 600;
text-decoration: none;
}
.courses-hover-action h4 a:hover {
color: var(--gold);
}
.crs-separator {
color: var(--gold);
}
.courses-hover-action p {
color: rgba(255,255,255,0.8);
font-size: 11px;
margin: 0;
}
/* CORPS DE LA CARTE */
.single-item-text {
padding: 20px;
flex: 1;
display: flex;
flex-direction: column;
}
.single-item-text h4 {
font-size: 18px;
font-weight: 700;
margin-bottom: 12px;
line-height: 1.4;
min-height: 50px;
}
.single-item-text h4 a {
color: var(--text-dark);
text-decoration: none;
transition: color 0.2s;
}
.single-item-text h4 a:hover {
color: var(--gold);
}
/* DESCRIPTION */
.single-item-text > p {
font-size: 13px;
color: var(--text-muted);
line-height: 1.6;
margin-bottom: 16px;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
/* INFOS CARTE (PRIX + PANIER) */
.single-item-content {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: auto;
padding-top: 15px;
border-top: 1px solid var(--border-light);
}
.single-item-comment-view {
display: flex;
gap: 15px;
align-items: center;
}
.single-item-comment-view span {
font-size: 18px;
font-weight: 700;
color: var(--gold);
display: flex;
align-items: center;
gap: 5px;
}
.single-item-comment-view span svg {
width: 24px;
height: 24px;
}
.single-item-comment-view span svg path {
fill: var(--gold);
}
/* BOUTON PANIER */
.btn-ajout-panier {
background: linear-gradient(135deg, var(--navy), var(--navy-dark));
border: none;
color: white;
padding: 10px 15px;
border-radius: 12px;
transition: all 0.3s ease;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
}
.btn-ajout-panier:hover {
background: linear-gradient(135deg, var(--gold), var(--gold-dark));
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(255,174,39,0.3);
}
.btn-ajout-panier svg {
width: 22px;
height: 22px;
}
.btn-ajout-panier svg path {
fill: #fff;
transition: fill 0.3s ease;
}
.btn-ajout-panier:hover svg path {
fill: var(--navy);
}
.btn-ajout-panier:disabled {
opacity: 0.5;
cursor: not-allowed;
transform: none;
}
/* MESSAGE AUCUNE FORMATION */
.no-formations-message {
text-align: center;
padding: 60px 40px;
background: #fff;
border-radius: 24px;
border: 1px solid var(--border-light);
box-shadow: 0 5px 20px rgba(0,0,0,0.05);
max-width: 500px;
margin: 0 auto;
}
.no-formations-icon {
font-size: 64px;
color: var(--gold);
margin-bottom: 20px;
}
.no-formations-message h3 {
font-size: 24px;
font-weight: 700;
color: var(--text-dark);
margin-bottom: 12px;
}
.no-formations-message p {
font-size: 15px;
color: var(--text-muted);
margin-bottom: 25px;
}
/* PAGINATION */
.pagination-wrapper {
margin-top: 40px;
text-align: center;
}
.pagination {
display: flex;
justify-content: center;
gap: 8px;
list-style: none;
padding: 0;
margin: 0;
}
.pagination .page-item {
list-style: none;
}
.pagination .page-link {
display: flex;
align-items: center;
justify-content: center;
width: 40px;
height: 40px;
border-radius: 12px;
background: #fff;
border: 1px solid var(--border-light);
color: var(--navy);
font-weight: 500;
text-decoration: none;
transition: all 0.3s ease;
}
.pagination .page-link:hover {
background: var(--gold);
border-color: var(--gold);
color: var(--navy);
}
.pagination .active .page-link {
background: linear-gradient(135deg, var(--navy), var(--navy-dark));
border-color: var(--navy);
color: #fff;
}
/* RESPONSIVE */
@media (max-width: 768px) {
.section-title h3 {
font-size: 28px;
}
.single-item-image {
height: 180px;
}
.single-item-text h4 {
font-size: 16px;
min-height: auto;
}
.pagination .page-link {
width: 36px;
height: 36px;
font-size: 13px;
}
.breadcrumb-title h1 {
font-size: 32px;
}
.single-item-comment-view span {
font-size: 16px;
}
}
@media (max-width: 576px) {
.single-item-comment-view span svg {
width: 20px;
height: 20px;
}
.btn-ajout-panier {
padding: 8px 12px;
}
.btn-ajout-panier svg {
width: 18px;
height: 18px;
}
}
/* Informations formateur dans la carte */
.formateur-info {
display: flex;
align-items: center;
gap: 12px;
margin-bottom: 15px;
padding: 10px;
background: var(--navy-light);
border-radius: 12px;
transition: all 0.3s ease;
}
.single-item:hover .formateur-info {
background: rgba(255,174,39,0.1);
transform: translateX(5px);
}
.formateur-avatar img {
width: 40px;
height: 40px;
border-radius: 50%;
object-fit: cover;
border: 2px solid var(--gold);
}
.formateur-details {
display: flex;
flex-direction: column;
}
.formateur-name {
font-size: 13px;
font-weight: 700;
color: var(--text-dark);
}
.formateur-poste {
font-size: 11px;
color: var(--text-muted);
}
/* ===== TOAST NOTIFICATIONS STYLE ===== */
.toast-notification {
position: fixed;
bottom: 30px;
right: 30px;
z-index: 9999;
min-width: 320px;
max-width: 400px;
background: white;
border-radius: 16px;
box-shadow: 0 10px 40px rgba(0,0,0,0.15);
padding: 0;
overflow: hidden;
animation: slideInRight 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
border-left: 4px solid;
}
@keyframes slideInRight {
from {
transform: translateX(100%);
opacity: 0;
}
to {
transform: translateX(0);
opacity: 1;
}
}
.toast-notification.toast-success {
border-left-color: #28a745;
}
.toast-notification.toast-success .toast-header {
background: linear-gradient(135deg, #28a745, #20c997);
}
.toast-notification.toast-success .toast-icon i {
color: #28a745;
}
.toast-notification.toast-info {
border-left-color: #17a2b8;
}
.toast-notification.toast-info .toast-header {
background: linear-gradient(135deg, #17a2b8, #6f42c1);
}
.toast-notification.toast-info .toast-icon i {
color: #17a2b8;
}
.toast-notification.toast-error {
border-left-color: #dc3545;
}
.toast-notification.toast-error .toast-header {
background: linear-gradient(135deg, #dc3545, #c82333);
}
.toast-notification.toast-error .toast-icon i {
color: #dc3545;
}
.toast-notification.toast-warning {
border-left-color: #ffc107;
}
.toast-notification.toast-warning .toast-header {
background: linear-gradient(135deg, #ffc107, #fd7e14);
}
.toast-content {
display: flex;
align-items: center;
padding: 16px;
gap: 12px;
}
.toast-icon {
flex-shrink: 0;
width: 40px;
height: 40px;
background: rgba(0,0,0,0.05);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
}
.toast-icon i {
font-size: 20px;
}
.toast-text {
flex: 1;
}
.toast-title {
font-weight: 700;
font-size: 14px;
color: #1a2a3a;
margin-bottom: 4px;
}
.toast-message {
font-size: 12px;
color: #6c757d;
line-height: 1.4;
}
.toast-close {
flex-shrink: 0;
width: 28px;
height: 28px;
border-radius: 50%;
background: rgba(0,0,0,0.05);
border: none;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.2s;
}
.toast-close:hover {
background: rgba(0,0,0,0.1);
}
.toast-close i {
font-size: 14px;
color: #6c757d;
}
.toast-progress {
height: 3px;
background: rgba(0,0,0,0.1);
width: 100%;
}
.toast-progress-bar {
height: 100%;
width: 100%;
background: linear-gradient(90deg, #FFAE27, #e09500);
animation: progress 3s linear forwards;
}
@keyframes progress {
from { width: 100%; }
to { width: 0%; }
}
/* Responsive */
@media (max-width: 576px) {
.toast-notification {
left: 15px;
right: 15px;
bottom: 15px;
min-width: auto;
max-width: none;
}
}
</style>
<!-- BREADCRUMB AREA -->
<div class="breadcrumb-area">
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="breadcrumb-title">
<h1>Formations E-learning</h1>
<ul class="breadcrumb-list">
<li><a href="{{ path('app_home') }}">Accueil</a></li>
<li><i class="zmdi zmdi-chevron-right"></i></li>
<li class="active">E-learning</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<!-- COURSE AREA -->
<div class="course-area">
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="section-title-wrapper">
<div class="section-title">
<h3>
{% if slug is not null %}
Formations : {{ categories|filter(cat => cat.slug == slug)|first.libelle }}
{% else %}
Toutes les formations E-learning
{% endif %}
</h3>
<p>Apprenez en ligne à votre rythme avec nos formations certifiantes</p>
</div>
</div>
</div>
</div>
<div class="row">
{% if formation_elearnings is empty %}
<div class="col-md-12">
<div class="no-formations-message">
<div class="no-formations-icon">
<i class="zmdi zmdi-info-outline"></i>
</div>
<h3>Aucune formation disponible</h3>
<p>De nouvelles formations seront bientôt ajoutées. Revenez prochainement !</p>
</div>
</div>
{% else %}
{% for formation in formation_elearnings %}
<div class="col-lg-4 col-md-6 col-12 mb-4 d-flex">
<div class="single-item w-100">
<div class="single-item-image overlay-effect">
<a href="{{ path('app_formation_detailsfrontElearning', {'slug': formation.slug}) }}">
<img src="{{ asset('uploads/formation/' ~ formation.affiche) }}" alt="{{ formation.titre }}">
</a>
</div>
<div class="single-item-text">
<h4><a href="{{ path('app_formation_detailsfrontElearning', {'slug': formation.slug}) }}">{{ formation.titre }}</a></h4>
{% if formation.formateur %}
<div class="formateur-info">
<div class="formateur-avatar">
<img src="{{ asset('uploads/coach/' ~ formation.formateur.logo) }}" alt="{{ formation.formateur.prenom }}">
</div>
<div class="formateur-details">
<span class="formateur-name">{{ formation.formateur.prenom }} {{ formation.formateur.nom }}</span>
<span class="formateur-poste">{{ formation.formateur.poste }}</span>
</div>
</div>
{% endif %}
<p>
{{ formation.description|striptags|slice(0, 200)|raw }}
{% if formation.description|striptags|length > 200 %}...{% endif %}
</p>
<div class="single-item-content">
<div class="single-item-comment-view">
<span>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path d="M4.616 19q-.691 0-1.153-.462T3 17.384V6.616q0-.691.463-1.153T4.615 5h14.77q.69 0 1.152.463T21 6.616v10.769q0 .69-.463 1.153T19.385 19zm5.884-4.5H7q-.213 0-.356.144t-.144.357t.144.356T7 15.5h1.5v.5q0 .213.144.356t.357.144t.356-.144T9.5 16v-.5h1.23q.328 0 .549-.221t.221-.548v-2.462q0-.327-.221-.548t-.548-.221H7.5v-2H11q.213 0 .356-.144t.144-.357t-.144-.356T11 8.5H9.5V8q0-.213-.145-.356q-.146-.144-.36-.144q-.203 0-.317.16q-.115.161-.178.34v.5H7.27q-.328 0-.549.221T6.5 9.27v2.462q0 .327.221.548t.548.221H10.5zm5.637 1.344l1.054-1.053q.105-.106.055-.227t-.192-.122h-2.112q-.132 0-.185.122q-.053.12.053.227l1.053 1.053q.056.056.135.056t.139-.056m-1.19-6.036h2.111q.133 0 .185-.121q.053-.121-.052-.227l-1.054-1.053q-.056-.057-.135-.057t-.138.056L14.81 9.46q-.106.106-.056.227q.05.12.192.12"/>
</svg>
{{ formation.prix }} DT
</span>
</div>
<button class="btn-ajout-panier" data-id="{{ formation.id }}">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024">
<path d="M1015.66 284a31.82 31.82 0 0 0-25.999-13.502h-99.744L684.78 95.666c-24.976-24.976-65.52-25.008-90.495 0L392.638 270.498h-82.096l-51.408-177.28c-20.16-69.808-68.065-77.344-87.713-77.344H34.333c-17.568 0-31.776 14.224-31.776 31.776S16.78 79.425 34.332 79.425h137.056c4.336 0 17.568 0 26.593 31.184l176.848 649.936c3.84 13.712 16.336 23.183 30.592 23.183h431.968c13.408 0 25.376-8.4 29.904-21.024l152.256-449.68c3.504-9.744 2.048-20.592-3.888-29.024zM639.537 140.93l152.032 129.584H487.457zm175.488 579.263H429.538L328.386 334.065h616.096zm-63.023 127.936c-44.192 0-80 35.808-80 80s35.808 80 80 80s80-35.808 80-80s-35.808-80-80-80m-288 0c-44.192 0-80 35.808-80 80s35.808 80 80 80s80-35.808 80-80s-35.808-80-80-80"/>
</svg>
</button>
</div>
</div>
</div>
</div>
{% endfor %}
{% endif %}
</div>
<!-- PAGINATION -->
{% if paginator is defined and paginator.pageCount > 1 %}
<div class="row">
<div class="col-12">
<div class="pagination-wrapper">
{{ knp_pagination_render(paginator, 'formation/custom_pagination.html.twig') }}
</div>
</div>
</div>
{% endif %}
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script>
// Fonction Toast personnalisée
function showToast(type, title, message, duration = 3000) {
const icons = {
success: '<i class="fa fa-check-circle"></i>',
info: '<i class="fa fa-info-circle"></i>',
error: '<i class="fa fa-exclamation-circle"></i>',
warning: '<i class="fa fa-exclamation-triangle"></i>'
};
const toast = document.createElement('div');
toast.className = `toast-notification toast-${type}`;
toast.innerHTML = `
<div class="toast-content">
<div class="toast-icon">
${icons[type]}
</div>
<div class="toast-text">
<div class="toast-title">${title}</div>
<div class="toast-message">${message}</div>
</div>
<button class="toast-close">
<i class="fa fa-times"></i>
</button>
</div>
<div class="toast-progress">
<div class="toast-progress-bar" style="animation-duration: ${duration}ms;"></div>
</div>
`;
document.body.appendChild(toast);
// Fermeture avec bouton
const closeBtn = toast.querySelector('.toast-close');
closeBtn.addEventListener('click', () => {
toast.remove();
});
// Auto-fermeture
setTimeout(() => {
if (toast.parentNode) toast.remove();
}, duration);
}
document.addEventListener('DOMContentLoaded', () => {
const cartCount = document.getElementById('cart-count');
document.querySelectorAll('.btn-ajout-panier').forEach(button => {
button.addEventListener('click', () => {
const formationId = button.dataset.id;
fetch(`/panier/ajouter/${formationId}`, {
method: 'POST',
headers: { 'X-Requested-With': 'XMLHttpRequest' }
})
.then(response => response.json())
.then(data => {
if (data.status === 'ok') {
if (cartCount) cartCount.textContent = data.total_items;
showToast('success', 'Ajouté au panier !', data.message, 2000);
button.disabled = true;
button.style.opacity = '0.6';
button.style.cursor = 'not-allowed';
} else if (data.status === 'already_in_cart') {
showToast('info', 'Déjà dans le panier', data.message, 2500);
button.disabled = true;
button.style.opacity = '0.6';
button.style.cursor = 'not-allowed';
showToast('error', 'Erreur', data.message ?? 'Erreur lors de l\'ajout au panier.', 3000);
}
})
.catch(() => {
showToast('error', 'Erreur réseau', 'Impossible d\'ajouter la formation.', 3000);
});
});
});
});
</script>
{% endblock %}