feat(Formules): Ajoute options incluses, améliore affichage et PWA

Ajoute la gestion des options incluses dans les formules,
améliore l'affichage des packs et corrige le start_url de la PWA.
This commit is contained in:
Serreau Jovann
2026-01-28 12:31:05 +01:00
parent 0e6cb9a700
commit b375b90d58
10 changed files with 479 additions and 36 deletions

View File

@@ -8,7 +8,7 @@ import { CrmEditor } from "./libs/CrmEditor.js";
import { initTomSelect } from "./libs/initTomSelect.js"; import { initTomSelect } from "./libs/initTomSelect.js";
import { SearchProduct,SearchOptions } from "./libs/SearchProduct.js"; import { SearchProduct,SearchOptions } from "./libs/SearchProduct.js";
import { SearchProductDevis,SearchOptionsDevis } from "./libs/SearchProductDevis.js"; import { SearchProductDevis,SearchOptionsDevis } from "./libs/SearchProductDevis.js";
import { SearchProductFormule } from "./libs/SearchProductFormule.js"; import { SearchProductFormule,SearchOptionsFormule } from "./libs/SearchProductFormule.js";
// --- INITIALISATION SENTRY --- // --- INITIALISATION SENTRY ---
Sentry.init({ Sentry.init({
dsn: "https://803814be6540031b1c37bf92ba9c0f79@sentry.esy-web.dev/24", dsn: "https://803814be6540031b1c37bf92ba9c0f79@sentry.esy-web.dev/24",
@@ -95,6 +95,9 @@ function initAdminLayout() {
if (!customElements.get('search-productformule')) { if (!customElements.get('search-productformule')) {
customElements.define('search-productformule', SearchProductFormule, { extends: 'button' }); customElements.define('search-productformule', SearchProductFormule, { extends: 'button' });
} }
if (!customElements.get('search-optionsformule')) {
customElements.define('search-optionsformule', SearchOptionsFormule, { extends: 'button' });
}
if (!customElements.get('search-options')) { if (!customElements.get('search-options')) {
customElements.define('search-options', SearchOptions, { extends: 'button' }); customElements.define('search-options', SearchOptions, { extends: 'button' });
} }

View File

@@ -1,5 +1,147 @@
export class SearchOptionsFormule extends HTMLButtonElement {
constructor() {
super();
this.allOptions = [];
}
connectedCallback() {
this.addEventListener('click', () => this.openModal());
}
async openModal() {
let modal = document.getElementById('modal-search-options');
if (!modal) {
modal = this.createModalStructure();
document.body.appendChild(modal);
this.setupSearchEvent(modal);
}
modal.classList.remove('hidden');
const container = modal.querySelector('#results-container-options');
const searchInput = modal.querySelector('#modal-search-input-options');
searchInput.value = '';
container.innerHTML = '<div class="text-white p-8 text-center animate-pulse tracking-widest text-[10px] uppercase font-black">Chargement des options...</div>';
try {
const response = await fetch('/crm/options/json');
this.allOptions = await response.json();
this.renderOptions(this.allOptions, container, modal);
searchInput.focus();
} catch (error) {
container.innerHTML = '<div class="text-red-400 p-8 text-center">Erreur catalogue options.</div>';
}
}
createModalStructure() {
const div = document.createElement('div');
div.id = 'modal-search-options';
div.className = 'fixed inset-0 z-[100] flex items-center justify-center p-4 bg-slate-950/90 backdrop-blur-md hidden animate-in fade-in duration-300';
div.innerHTML = `
<div class="bg-slate-900 border border-white/10 w-full max-w-2xl max-h-[85vh] rounded-[3rem] shadow-2xl overflow-hidden flex flex-col scale-in-center">
<div class="p-8 border-b border-white/5 bg-white/5 space-y-6">
<div class="flex justify-between items-center">
<h3 class="text-white font-black uppercase tracking-[0.3em] text-[11px] flex items-center">
<span class="w-2 h-2 bg-blue-500 rounded-full mr-3 animate-pulse"></span>
Sélection Option
</h3>
<button type="button" onclick="this.closest('#modal-search-options').classList.add('hidden')" class="p-2 text-slate-400 hover:text-white transition-colors">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/></svg>
</button>
</div>
<div class="relative">
<input type="text" id="modal-search-input-options" placeholder="RECHERCHER UNE OPTION..."
class="w-full bg-slate-950/50 border border-white/10 rounded-2xl py-4 pl-12 pr-5 text-white text-xs font-black tracking-widest focus:ring-blue-500/20 focus:border-blue-500 transition-all uppercase placeholder:text-slate-600">
<svg class="w-5 h-5 absolute left-4 top-3.5 text-slate-500" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"/>
</svg>
</div>
</div>
<div id="results-container-options" class="overflow-y-auto p-6 space-y-2 custom-scrollbar flex-grow min-h-[300px]"></div>
<div class="p-4 bg-white/5 text-center">
<p class="text-[9px] text-slate-500 font-black uppercase tracking-widest line-clamp-1">Appuyez sur Échap pour fermer</p>
</div>
</div>
`;
return div;
}
setupSearchEvent(modal) {
const input = modal.querySelector('#modal-search-input-options');
const container = modal.querySelector('#results-container-options');
input.oninput = () => {
const query = input.value.toLowerCase().trim();
const filtered = this.allOptions.filter(o =>
o.name.toLowerCase().includes(query)
);
this.renderOptions(filtered, container, modal);
};
window.addEventListener('keydown', (e) => {
if (e.key === 'Escape') modal.classList.add('hidden');
});
}
renderOptions(options, container, modal) {
container.innerHTML = '';
if (options.length === 0) {
container.innerHTML = '<div class="text-slate-600 p-12 text-center text-[10px] font-black uppercase tracking-[0.2em]">Aucune option trouvée</div>';
return;
}
options.forEach(option => {
const card = document.createElement('div');
card.className = 'flex items-center gap-5 p-4 bg-white/5 border border-white/5 rounded-2xl hover:bg-blue-500/10 hover:border-blue-500/40 transition-all cursor-pointer group animate-in fade-in slide-in-from-bottom-2';
const imgHtml = option.image
? `<img src="${option.image}" class="w-14 h-14 rounded-xl object-cover shadow-lg group-hover:scale-110 transition-transform" onerror="this.src='/provider/images/favicon.png'">`
: `<div class="w-14 h-14 bg-slate-950 rounded-xl flex items-center justify-center text-[8px] text-slate-700 font-black border border-white/5">OPT</div>`;
card.innerHTML = `
${imgHtml}
<div class="flex-grow">
<div class="text-white font-black text-xs uppercase tracking-wider mb-1">${option.name}</div>
<div class="flex gap-4">
<span class="text-blue-400 text-[10px] font-mono">PRIX HT: ${option.price}€</span>
</div>
</div>
<div class="w-10 h-10 rounded-full bg-blue-500/0 group-hover:bg-blue-500/20 flex items-center justify-center text-blue-500 transition-all">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="3" d="M12 6v6m0 0v6m0-6h6m-6 0H6"/></svg>
</div>
`;
card.onclick = () => {
this.fillOptionLine(option);
modal.classList.add('hidden');
};
container.appendChild(card);
});
}
fillOptionLine(option) {
// On cherche la ligne parente (ajuste le sélecteur si différent de celui des produits)
const row = this.closest('.form-repeater__row');
if (row) {
// Mapping selon ta structure de DevisOption
const nameInput = row.querySelector('input[name*="[product]"]');
if(nameInput) nameInput.value = option.name;
// Feedback visuel (Bleu pour les options)
const fieldset = row.querySelector('fieldset');
if (fieldset) {
fieldset.classList.add('border-blue-500/50', 'bg-blue-500/5');
setTimeout(() => fieldset.classList.remove('border-blue-500/50', 'bg-blue-500/5'), 800);
}
}
}
}
export class SearchProductFormule extends HTMLButtonElement { export class SearchProductFormule extends HTMLButtonElement {
constructor() { constructor() {
super(); super();

View File

@@ -32,7 +32,7 @@ pwa:
enabled: true enabled: true
name: "Réservation Lukikevent" name: "Réservation Lukikevent"
short_name: "Réservation Lukikevent" short_name: "Réservation Lukikevent"
start_url: "reservation" start_url: "/"
display: "standalone" display: "standalone"
background_color: "#ffffff" background_color: "#ffffff"
theme_color: "#f4c842" theme_color: "#f4c842"

View File

@@ -0,0 +1,35 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20260128112815 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE formules_options_inclus (id SERIAL NOT NULL, formule_id INT DEFAULT NULL, name VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_90546E632A68F4D1 ON formules_options_inclus (formule_id)');
$this->addSql('ALTER TABLE formules_options_inclus ADD CONSTRAINT FK_90546E632A68F4D1 FOREIGN KEY (formule_id) REFERENCES formules (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SCHEMA public');
$this->addSql('ALTER TABLE formules_options_inclus DROP CONSTRAINT FK_90546E632A68F4D1');
$this->addSql('DROP TABLE formules_options_inclus');
}
}

View File

@@ -3,6 +3,7 @@
namespace App\Controller\Dashboard; namespace App\Controller\Dashboard;
use App\Entity\Formules; use App\Entity\Formules;
use App\Entity\FormulesOptionsInclus;
use App\Entity\FormulesProductInclus; use App\Entity\FormulesProductInclus;
use App\Entity\Options; use App\Entity\Options;
use App\Entity\Product; use App\Entity\Product;
@@ -140,6 +141,25 @@ class FormulesController extends AbstractController
return $this->redirectToRoute('app_crm_formules_view', ['id' => $formules->getId()]); return $this->redirectToRoute('app_crm_formules_view', ['id' => $formules->getId()]);
} }
if ($request->isMethod('POST') && $request->request->has('option')) {
$options = $request->request->all('option');
foreach ($options as $option) {
if(isset($option['id']) && $option['id'] !="") {
$productInclus = $entityManager->getRepository(FormulesOptionsInclus::class)->find($option['id']);
} else {
$productInclus = new FormulesOptionsInclus();
$productInclus->setFormule($formules);
}
$productInclus->setName($option['product']);
$entityManager->persist($productInclus);
}
$entityManager->flush();
$appLogger->record('UPDATE', 'Mise à jour des options inclus dans la formule' . $formules->getName());
$this->addFlash('success', 'Options mis à jour avec succès.');
return $this->redirectToRoute('app_crm_formules_view', ['id' => $formules->getId()]);
}
// 2. GESTION DES PRIX (Formulaire Manuel price[]) // 2. GESTION DES PRIX (Formulaire Manuel price[])
// On vérifie si le tableau 'price' existe dans la requête POST // On vérifie si le tableau 'price' existe dans la requête POST
if ($request->isMethod('POST') && $request->request->has('price')) { if ($request->isMethod('POST') && $request->request->has('price')) {
@@ -178,15 +198,25 @@ class FormulesController extends AbstractController
'product' => '', 'product' => '',
] ]
]; ];
$options = [
[
'product' => '',
]
];
foreach ($formules->getFormulesProductIncluses() as $key=>$fc){ foreach ($formules->getFormulesProductIncluses() as $key=>$fc){
$lines[$key]['product'] = $fc->getProduct()->getName(); $lines[$key]['product'] = $fc->getProduct()->getName();
$lines[$key]['id'] = $fc->getId(); $lines[$key]['id'] = $fc->getId();
} }
foreach ($formules->getFormulesOptionsIncluses() as $key=>$fc){
$options[$key]['product'] = $fc->getName();
$options[$key]['id'] = $fc->getId();
}
return $this->render('dashboard/formules/view.twig', [ return $this->render('dashboard/formules/view.twig', [
'formule' => $formules, 'formule' => $formules,
'form' => $form->createView(), 'form' => $form->createView(),
'type' => $formules->getType(), 'type' => $formules->getType(),
'lines' => $lines, 'lines' => $lines,
'option' => $options,
]); ]);
} }

View File

@@ -63,9 +63,16 @@ class Formules
#[ORM\Column(nullable: true)] #[ORM\Column(nullable: true)]
private ?float $caution = null; private ?float $caution = null;
/**
* @var Collection<int, FormulesOptionsInclus>
*/
#[ORM\OneToMany(targetEntity: FormulesOptionsInclus::class, mappedBy: 'formule')]
private Collection $formulesOptionsIncluses;
public function __construct() public function __construct()
{ {
$this->formulesProductIncluses = new ArrayCollection(); $this->formulesProductIncluses = new ArrayCollection();
$this->formulesOptionsIncluses = new ArrayCollection();
} }
@@ -270,4 +277,34 @@ class Formules
return $this->id."-".$s->slugify($this->name); return $this->id."-".$s->slugify($this->name);
} }
/**
* @return Collection<int, FormulesOptionsInclus>
*/
public function getFormulesOptionsIncluses(): Collection
{
return $this->formulesOptionsIncluses;
}
public function addFormulesOptionsInclus(FormulesOptionsInclus $formulesOptionsInclus): static
{
if (!$this->formulesOptionsIncluses->contains($formulesOptionsInclus)) {
$this->formulesOptionsIncluses->add($formulesOptionsInclus);
$formulesOptionsInclus->setFormule($this);
}
return $this;
}
public function removeFormulesOptionsInclus(FormulesOptionsInclus $formulesOptionsInclus): static
{
if ($this->formulesOptionsIncluses->removeElement($formulesOptionsInclus)) {
// set the owning side to null (unless already changed)
if ($formulesOptionsInclus->getFormule() === $this) {
$formulesOptionsInclus->setFormule(null);
}
}
return $this;
}
} }

View File

@@ -0,0 +1,50 @@
<?php
namespace App\Entity;
use App\Repository\FormulesOptionsInclusRepository;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: FormulesOptionsInclusRepository::class)]
class FormulesOptionsInclus
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $name = null;
#[ORM\ManyToOne(inversedBy: 'formulesOptionsIncluses')]
private ?Formules $formule = null;
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): static
{
$this->name = $name;
return $this;
}
public function getFormule(): ?Formules
{
return $this->formule;
}
public function setFormule(?Formules $formule): static
{
$this->formule = $formule;
return $this;
}
}

View File

@@ -0,0 +1,43 @@
<?php
namespace App\Repository;
use App\Entity\FormulesOptionsInclus;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @extends ServiceEntityRepository<FormulesOptionsInclus>
*/
class FormulesOptionsInclusRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, FormulesOptionsInclus::class);
}
// /**
// * @return FormulesOptionsInclus[] Returns an array of FormulesOptionsInclus objects
// */
// public function findByExampleField($value): array
// {
// return $this->createQueryBuilder('f')
// ->andWhere('f.exampleField = :val')
// ->setParameter('val', $value)
// ->orderBy('f.id', 'ASC')
// ->setMaxResults(10)
// ->getQuery()
// ->getResult()
// ;
// }
// public function findOneBySomeField($value): ?FormulesOptionsInclus
// {
// return $this->createQueryBuilder('f')
// ->andWhere('f.exampleField = :val')
// ->setParameter('val', $value)
// ->getQuery()
// ->getOneOrNullResult()
// ;
// }
}

View File

@@ -76,3 +76,78 @@
</button> </button>
</div> </div>
</form> </form>
<form action="{{ path('app_crm_formules_view', {id: formule.id}) }}" method="POST"
class="w-full backdrop-blur-2xl bg-white/5 border border-white/10 rounded-[2.5rem] p-8 shadow-2xl relative overflow-hidden mt-6">
<div class="w-full form-repeater" data-component="options" is="repeat-line">
<div class="flex items-center justify-between mb-6 px-4">
<h4 class="text-sm font-black text-white uppercase tracking-widest">Détail des options inclus</h4>
</div>
<ol class="form-repeater__rows space-y-4" data-ref="rows">
{% for key,line in option %}
<li class="form-repeater__row group animate-in slide-in-from-right-5 duration-300">
<fieldset class="backdrop-blur-md bg-white/5 border border-white/10 rounded-[2.5rem] p-8 hover:border-blue-500/30 transition-all shadow-xl">
{% if line.id is defined %}
<input type="hidden" name="option[{{ key }}][id]" value="{{ line.id }}">
{% endif %}
<div class="grid grid-cols-1 lg:grid-cols-12 gap-5 items-start">
{# 1. PRODUIT / WYSIWYG #}
<div class="lg:col-span-11">
<label class="text-[9px] font-black text-slate-500 uppercase tracking-widest ml-1 mb-2 block">
Options
</label>
<div class="relative flex items-center">
{# Utilisation de l'input texte standard sans l'attribut 'is' #}
<input
type="text"
name="option[{{ key }}][product]"
value="{{ line.product }}"
required
class="w-full bg-slate-950/50 border border-white/5 rounded-2xl text-white focus:ring-purple-500/20 focus:border-purple-500 transition-all py-3 pl-5 pr-12 text-sm outline-none"
>
{# BOUTON RECHERCHER #}
<button
is="search-optionsformule"
type="button"
class="absolute right-2 p-2 bg-purple-500/10 hover:bg-purple-500 text-purple-400 hover:text-white rounded-xl transition-all duration-300 group/search"
title="Rechercher un produit"
>
{# Icône loupe pour un look plus compact #}
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"/>
</svg>
</button>
</div>
</div>
{# 6. SUPPRIMER #}
<div class="lg:col-span-1 flex justify-center lg:pt-5">
<button type="button" data-ref="removeButton" class="p-4 bg-red-500/10 hover:bg-red-500 text-red-500 hover:text-white rounded-2xl transition-all duration-300 shadow-lg hover:shadow-red-500/20">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"/>
</svg>
</button>
</div>
</div>
</fieldset>
</li>
{% endfor %}
</ol>
<div class="mt-6 px-4">
<button type="button" data-ref="addButton" class="w-full py-4 border-2 border-dashed border-white/10 hover:border-purple-500/50 bg-white/5 hover:bg-purple-500/10 rounded-3xl text-purple-400 text-[10px] font-black uppercase tracking-[0.4em] transition-all flex items-center justify-center space-x-3 group">
<span class="text-xl group-hover:rotate-90 transition-transform duration-300">+</span>
<span>Ajouter une option</span>
</button>
</div>
<button type="submit" class="mt-2 group w-full py-5 bg-blue-600 hover:bg-blue-500 text-white font-black text-[11px] uppercase tracking-[0.3em] rounded-2xl shadow-xl shadow-blue-600/20 transition-all hover:-translate-y-1 active:scale-[0.98] flex items-center justify-center">
<span>Sauvegarder les modifications</span>
<svg class="w-4 h-4 ml-3 transform group-hover:translate-x-1 transition-transform" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 7l5 5m0 0l-5 5m5-5H6" />
</svg>
</button>
</div>
</form>

View File

@@ -24,13 +24,13 @@
{# Gauche : Image & Badge #} {# Gauche : Image & Badge #}
<div class="relative group"> <div class="relative group">
<div class="rounded-[3rem] overflow-hidden border-4 border-slate-900 shadow-[15px_15px_0px_0px_rgba(15,23,42,1)]"> <div class="rounded-[3rem] overflow-hidden border-4 border-slate-900 shadow-[15px_15px_0px_0px_rgba(15,23,42,1)] bg-slate-50">
{% if formule.imageName %} {% if formule.imageName %}
<img src="{{ vich_uploader_asset(formule, 'imageFile') }}" <img src="{{ vich_uploader_asset(formule, 'imageFile') }}"
alt="{{ formule.name }}" alt="{{ formule.name }}"
class="w-full h-auto object-contain transform group-hover:scale-105 transition-transform duration-700"> class="w-full h-auto object-contain max-h-[600px] mx-auto transform group-hover:scale-105 transition-transform duration-700">
{% else %} {% else %}
<div class="aspect-square bg-slate-100 flex items-center justify-center"> <div class="aspect-square flex items-center justify-center">
<img src="{{ asset('provider/images/favicon.png') }}" class="w-32 opacity-20"> <img src="{{ asset('provider/images/favicon.png') }}" class="w-32 opacity-20">
</div> </div>
{% endif %} {% endif %}
@@ -90,39 +90,67 @@
</div> </div>
</div> </div>
{# --- COMPOSITION DU PACK --- #} {% if formule.type == "pack" %}
<div class="max-w-7xl mx-auto px-4 py-20"> {# --- COMPOSITION DU PACK --- #}
<div class="flex items-center space-x-4 mb-12"> <div class="max-w-7xl mx-auto px-4 py-20">
<h2 class="text-4xl font-black text-slate-900 uppercase italic tracking-tighter">Ce pack <span class="text-[#f39e36]">comprend</span></h2> <div class="flex items-center space-x-4 mb-12">
<div class="h-1 flex-grow bg-slate-100 rounded-full"></div> <h2 class="text-4xl font-black text-slate-900 uppercase italic tracking-tighter">Ce pack <span class="text-[#f39e36]">comprend</span></h2>
</div> <div class="h-1 flex-grow bg-slate-100 rounded-full"></div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-8">
{# Liste des produits inclus #}
<div class="space-y-4">
<h3 class="text-xs font-black text-slate-400 uppercase tracking-[0.3em] mb-6">Équipements & Structures</h3>
{% for item in formule.formulesProductIncluses %}
<div class="flex items-center p-4 bg-white border-2 border-slate-100 rounded-3xl group hover:border-[#f39e36] transition-colors shadow-sm">
<div class="w-16 h-16 rounded-2xl overflow-hidden border border-slate-100 flex-shrink-0 bg-slate-50">
{% if item.product.imageName %}
<img src="{{ vich_uploader_asset(item.product, 'imageFile') }}" class="w-full h-full object-cover">
{% endif %}
</div>
<div class="ml-6 flex-grow">
<p class="text-xs font-black text-[#f39e36] uppercase tracking-tighter">Réf: {{ item.product.ref }}</p>
<h4 class="text-lg font-black text-slate-900 uppercase leading-none italic">{{ item.product.name }}</h4>
</div>
<div class="text-slate-300 group-hover:text-[#f39e36] transition-colors">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="3" d="M5 13l4 4L19 7"/></svg>
</div>
</div>
{% else %}
<p class="text-slate-400 italic">Aucun produit inclus.</p>
{% endfor %}
</div> </div>
{# BLOC INFOS COMPLEMENTAIRES #} <div class="grid grid-cols-1 md:grid-cols-2 gap-12">
{# Liste des produits inclus #}
<div class="space-y-4">
<h3 class="text-xs font-black text-slate-400 uppercase tracking-[0.3em] mb-6 flex items-center">
<span class="w-2 h-2 bg-[#f39e36] rounded-full mr-2"></span> Structures & Matériel
</h3>
{% for item in formule.formulesProductIncluses %}
<div class="flex items-center p-4 bg-white border-2 border-slate-100 rounded-3xl group hover:border-[#f39e36] transition-colors shadow-sm">
<div class="w-16 h-16 rounded-2xl overflow-hidden border border-slate-100 flex-shrink-0 bg-slate-50">
{% if item.product.imageName %}
<img src="{{ vich_uploader_asset(item.product, 'imageFile') }}" class="w-full h-full object-cover">
{% endif %}
</div>
<div class="ml-6 flex-grow">
<p class="text-xs font-black text-[#f39e36] uppercase tracking-tighter">Réf: {{ item.product.ref }}</p>
<h4 class="text-lg font-black text-slate-900 uppercase leading-none italic">{{ item.product.name }}</h4>
</div>
<div class="text-slate-200 group-hover:text-[#f39e36] transition-colors">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="3" d="M5 13l4 4L19 7"/></svg>
</div>
</div>
{% else %}
<p class="text-slate-400 italic">Aucun produit inclus.</p>
{% endfor %}
</div>
{# Liste des options incluses #}
<div class="space-y-4">
<h3 class="text-xs font-black text-slate-400 uppercase tracking-[0.3em] mb-6 flex items-center">
<span class="w-2 h-2 bg-[#fc0e50] rounded-full mr-2"></span> Services & Bonus Inclus
</h3>
{% for option in formule.formulesOptionsIncluses %}
<div class="flex items-center p-6 bg-[#fc0e50]/5 border-2 border-[#fc0e50]/20 rounded-3xl relative overflow-hidden group">
<div class="w-12 h-12 bg-white border-2 border-[#fc0e50] rounded-2xl flex items-center justify-center text-[#fc0e50] shadow-sm z-10">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v6m0 0v6m0-6h6m-6 0H6"/>
</svg>
</div>
<div class="ml-6 z-10">
<h4 class="text-xl font-black text-slate-900 uppercase italic leading-none">{{ option.name }}</h4>
<p class="text-[10px] font-black text-[#fc0e50] uppercase tracking-widest mt-1">Avantage inclus</p>
</div>
{# Déco de fond #}
<div class="absolute -right-4 -bottom-4 text-6xl opacity-10 grayscale group-hover:rotate-12 transition-transform">🎁</div>
</div>
{% else %}
<div class="h-full flex items-center justify-center p-12 border-2 border-dashed border-slate-100 rounded-[3rem]">
<p class="text-slate-300 font-bold uppercase text-[10px] tracking-widest italic">Aucun bonus supplémentaire</p>
</div>
{% endfor %}
</div>
</div>
</div> </div>
</div> {% endif %}
</div> </div>
{% endblock %} {% endblock %}