{% extends "base.html.twig" %}
{% block title %}Détails de
{{ product.name }}
{% endblock %}
{% block body %}
<style>
body {
font-family: Varela,sans-serif;
color: #2b4b78;
}
.container {
padding-right:85px;
padding-left:85px;
background-color: #FFF;
}
h1 {
font-family: "Montserrat", sans-serif;
font-size:26pt;
font-weight:bold;
color:#003c8c;
}
h2 {
font-family: "Montserrat", sans-serif;
font-size:20pt;
font-weight:normal !important;
color:#003c8c;
}
h3 {
color:#003c8c;
}
.ariane {
padding-top:25px;
padding-bottom:25px;
font-family: "Montserrat", sans-serif;
-webkit-font-smoothing: antialiased;
}
.ariane A {
padding-top:25px;
padding-bottom:25px;
font-family: "Montserrat", sans-serif;
text-decoration:underline !important;
font-size: 16px !important;
color: #161d3f !important;
font-weight: 500 !important;
}
.arianeEnd {
color:#006ec8;
font-family: "Montserrat", sans-serif;
font-size: 16px !important;
font-weight: 500 !important;
}
.headerTxt, .headerTxt p {
font-size:16pt !important;
font-family: "Montserrat", sans-serif!important;
color:#003c8c !important;
font-weight: 400 !important;
}
.mainReference {
font-family: "Montserrat", sans-serif;
background-color: #003c8c;
color:#FFF;
padding:5px;
font-size:22pt;
}
.tabcontent, .tabcontent p{
font-size:12pt !important;
font-family: "Montserrat", sans-serif!important;
color:#003c8c !important;
}
.spacerTop {
margin-top:15px
}
.options {
font-family: "Montserrat", sans-serif;
font-size:13pt;
color:#003c8c;
font-weight:bold;
border-bottom: solid 1px #78c8e6;
}
.collapsible {
background-color: #FFF;
font-family: "Montserrat", sans-serif;
font-size:13pt;
color:#003c8c;
cursor: pointer;
padding: 18px;
width: 100%;
border: none;
text-align: left;
outline: none;
}
.activeCollapsible, .collapsible:hover {
font-weight: bolder;
}
.collapsible:after {
content: '\002B';
color: #003c8c;
font-weight: bold;
float: right;
margin-left: 5px;
}
.activeCollapsible:after {
content: "\2212";
}
.content {
padding: 0 18px;
max-height: 0;
overflow: hidden;
transition: max-height 0.2s ease-out;
}
.productTable {
font-family: "Montserrat", sans-serif;
font-size:10pt;
color:#505050;
background-color:#FFF;
border-spacing : 2px;
border-collapse: separate;
}
.productTable TH {
background-color:#e5e5e5;
text-align: center;
padding:3px;
font-weight:bold;
}
.productTable TD {
margin:2px;
text-align: center;
border-bottom: solid 1px #e5e5e5;
padding: 5px;
}
.productTable TR {
border-bottom: solid 1px #e5e5e5;
}
#menu-item-153 {
position: relative; /* Nécessaire pour positionner le trait en bas de l'élément */
}
#menu-item-153::after {
content: "";
display: block;
width: 100%;
height: 3px;
background-color: #006ec8;
position: absolute;
bottom: 0;
left: 0;
}
#navbar-underline {
display:none;
}
.user-box {
border: 2px solid #006ec8;
border-radius: 10px;
padding: 20px;
background-color: #f8fbff;
color: #003c8c;
font-family: "Montserrat", sans-serif;
box-shadow: 0 2px 6px rgba(0,0,0,0.1);
margin-top: 30px;
}
.user-box h3 {
border-bottom: 1px solid #006ec8;
padding-bottom: 10px;
margin-bottom: 15px;
font-size: 18pt;
color: #003c8c;
}
.contact-section {
border: 2px solid #006ec8;
border-radius: 10px;
padding: 15px;
background-color: #f8fbff;
}
.contact-section h3 {
color: #003c8c;
font-size: 18pt;
margin-bottom: 15px;
}
ul li {
color:#0d3b79 !important;
}
</style>
<main class="container padding-header">
<section class="row">
<div class="col-md-9">
<div class="ariane col-12">
<span>
<a href="https://lelorrain.fr/">Accueil</a> /
{% if product.categorie1 != null %}{{ product.categorie1|raw }} / {% endif %}
{% if product.categorie2 != null %}{{ product.categorie2|raw }} / {% endif %}
{% if product.categorie3 != null %}{{ product.categorie3|raw }} / {% endif %}
{% if product.derniereCategorie != null %}<span class="arianeEnd">{{ product.derniereCategorie|raw }}</span>{% endif %}
</span>
</div>
<div class="col-12 spacerTop">
{% set _ = productsSources|length %}
{% if productsSources|length > 0 %}
<h1><span class="souligne-title">{{ product.title }}</span></h1>
{% else %}
<h1><span class="souligne-title">{{ product.name }}</span></h1>
{% endif %}
</div>
<div class="col-12 spacerTop">
{% if productsSources|length > 0 %}
<div class="headerTxt">{{ product.subTitle }}</div>
{% else %}
<div class="headerTxt">{{ product.header|raw }}</div>
{% endif %}
</div>
<div class="col-12 spacerTop">
<span class="mainReference">REF. {{ product.mainReference }}</span>
</div>
<div class="col-12 spacerTop">
<div id="carouselExampleIndicators" class="carousel slide" data-bs-ride="carousel" style="width:80%;height:auto;">
<div class="carousel-indicators">
{% for iteration in 1..product.images|length %}
<button type="button" data-bs-target="#carouselExampleIndicators" data-bs-slide-to="{{ iteration - 1 }}" {{ (loop.first ) ?'class="active" aria-current="true"' : '' }} aria-label="Slide {{ iteration }}"></button>
{% endfor %}
</div>
<div class="carousel-inner">
{% for image in product.images %}
<div class="carousel-item {{ (loop.first ) ? 'active' : '' }}">
<img src="{{ asset('assets/uploads/products/mini/') ~ image.name }}" class="d-block" alt="{{ product.name }}" style="width:auto;max-height:275px;">
</div>
{% endfor %}
</div>
{% if product.images|length > 1 %}
<button class="carousel-control-prev" type="button" data-bs-target="#carouselExampleIndicators" data-bs-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="visually-hidden">Previous</span>
</button>
<button class="carousel-control-next" type="button" data-bs-target="#carouselExampleIndicators" data-bs-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="visually-hidden">Next</span>
</button>
{% endif %}
</div>
</div>
{% set hasDescription = product.description is not empty and product.description != product.slug %}
<div class="tab">
{% if hasDescription %}<button class="tablinks" onclick="openTab(event, 'descriptionProduit')" id="defaultOpen">Description Produit</button>{% endif %}
{% if product.donneesTechniques is not empty %} <button class="tablinks" onclick="openTab(event, 'donneesTechniques')" {% if not hasDescription %} id="defaultOpen" {% endif %}>Données techniques</button> {% endif %}
{% if product.videoProduit is not empty %} <button class="tablinks" onclick="openTab(event, 'videoProduit')">Vidéo produit</button> {% endif %}
</div>
{% if product.description is not empty and product.description != product.slug %}
<div id="descriptionProduit" class="tabcontent">
<p>{{ product.description|raw }}</p>
</div>
{% endif %}
{% if product.donneesTechniques is not empty %}
<div id="donneesTechniques" class="tabcontent">
{% set firstProductSource = productsSources|first %}
{% if firstProductSource is not empty %}
<p>{{ firstProductSource.footer|raw }}</p>
{% else %}
<p>{{ product.donneesTechniques|raw }}</p>
{% endif %}
</div>
{% endif %}
{% if product.donneesTechniques is not empty %}
<div id="videoProduit" class="tabcontent">
<p>{{ product.videoProduit|raw }}</p>
</div>
{% endif %}
{% if productsSources|length > 0 %}
<div class="options spacerTop">
<span>OPTIONS</span>
</div>
<button class="collapsible">Produits de la gamme</button>
<div class="content">
<div class="col-12 mb-12">
<table class="productTable" cellspacing="2px">
{% set num = 0 %}
{% set firstProduct = productsSources|first %}
{% set nbCols = 0 %}
{% set countName = 0 %}
{% set countGas = 0 %}
{% set countGraduation = 0 %}
{% set countMaximumPressure = 0 %}
{% set countFlowPressure = 0 %}
{% set countSubType = 0 %}
{% set countCapacity = 0 %}
{% set countLength = 0 %}
{% set countThread = 0 %}
{% set countAccessoryTxt = 0 %}
{% set countInPort = 0 %}
{% set countOutPort = 0 %}
{% set countWeight = 0 %}
{% for linkedProduct in productsSources %}
{% if linkedProduct.name is not empty %}
{% set countName = countName + 1 %}
{% endif %}
{% if linkedProduct.gas is not empty %}
{% set countGas = countGas + 1 %}{% set nbCols = nbCols+1 %}
{% endif %}
{% if linkedProduct.graduation is not empty %}
{% set countGraduation = countGraduation + 1 %}{% set nbCols = nbCols+1 %}
{% endif %}
{% if linkedProduct.maximumPressure is not empty %}
{% set countMaximumPressure = countMaximumPressure + 1 %}{% set nbCols = nbCols+1 %}
{% endif %}
{% if linkedProduct.flowPressure is not empty %}
{% set countFlowPressure = countFlowPressure + 1 %}{% set nbCols = nbCols+1 %}
{% endif %}
{% if linkedProduct.subType is not empty %}
{% set countSubType = countSubType + 1 %}{% set nbCols = nbCols+1 %}
{% endif %}
{% if linkedProduct.capacity is not empty %}
{% set countCapacity = countCapacity + 1 %}{% set nbCols = nbCols+1 %}
{% endif %}
{% if linkedProduct.length is not empty %}
{% set countLength = countLength + 1 %}{% set nbCols = nbCols+1 %}
{% endif %}
{% if linkedProduct.thread is not empty %}
{% set countThread = countThread + 1 %}{% set nbCols = nbCols+1 %}
{% endif %}
{% if linkedProduct.accessoryTxt is not empty %}
{% set countAccessoryTxt = countAccessoryTxt + 1 %}{% set nbCols = nbCols+1 %}
{% endif %}
{% if linkedProduct.inPort is not empty %}
{% set countInPort = countInPort + 1 %}{% set nbCols = nbCols+1 %}
{% endif %}
{% if linkedProduct.outPort is not empty %}
{% set countOutPort = countOutPort + 1 %}{% set nbCols = nbCols+1 %}
{% endif %}
{% if linkedProduct.weight is not empty %}
{% set countWeight = countWeight + 1 %}{% set nbCols = nbCols+1 %}
{% endif %}
{% endfor %}
{% for linkedProduct in productsSources %}
{% if num == 0 %}
<tr style="font-weight:bold">
{% if countName > 0 %}<th>Ref.</th>{% endif %}
{% if countGas > 0 %}<th>Gaz</th>{% endif %}
{% if countGraduation > 0 %}<th>Graduation</th>{% endif %}
{% if countMaximumPressure > 0 %}<th>Pression maxi en bar</th>{% endif %}
{% if countFlowPressure > 0 %}<th>Débit / pression </th>{% endif %}
{% if countSubType > 0 %}<th>Sous-type</th>{% endif %}
{% if countCapacity > 0 %}<th>Capacité en mm</th>{% endif %}
{% if countLength > 0 %}<th>L. hors tout en mm</th>{% endif %}
{% if countThread > 0 %}<th>Filetage</th>{% endif %}
{% if countAccessoryTxt > 0 %}<th>Accessoire</th>{% endif %}
{% if countInPort > 0 and product.boolInPort %}<th>Entrée</th>{% endif %}
{% if countOutPort > 0 and product.boolOutPort %}<th>Sortie</th>{% endif %}
{% if countWeight > 0 %}<th>Poids en kg</th>{% endif %}
{% if nbCols == 0 %}<th>Description</th>{% endif %}
</tr>
{% endif %}
<tr>
{% if countName > 0 %}<td style="text-align:left"><a href="/produits/{{ linkedProduct.mainReference }}">{{ linkedProduct.mainReference }}</a></td>{% endif %}
{% if countGas> 0 %}<td style="text-align:left">{{ linkedProduct.gas }}</td>{% endif %}
{% if countGraduation > 0 %}<td style="text-align:left">{{ linkedProduct.graduation }}</td>{% endif %}
{% if countMaximumPressure > 0 %}<td style="text-align:left">{{ linkedProduct.maximumPressure }}</td>{% endif %}
{% if countFlowPressure > 0 %}<td style="text-align:left">{{ linkedProduct.flowPressure }}</td>{% endif %}
{% if countSubType > 0 %}<td style="text-align:left">{{ linkedProduct.subType }}</td>{% endif %}
{% if countCapacity > 0 %}<td style="text-align:left">{{ linkedProduct.capacity }}</td>{% endif %}
{% if countLength > 0 %}<td style="text-align:left">{{ linkedProduct.length }}</td>{% endif %}
{% if countThread > 0 %}<td style="text-align:left">{{ product.thread }}</td>{% endif %}
{% if countAccessoryTxt > 0 %}<td style="text-align:left">{{ linkedProduct.accessoryTxt }}</td>{% endif %}
{% if countInPort > 0 and product.boolInPort %}<td style="text-align:left">{{ linkedProduct.inPort }}</td>{% endif %}
{% if countOutPort > 0 and product.boolOutPort %}<td style="text-align:left">{{ linkedProduct.outPort }}</td>{% endif %}
{% if countWeight >0 %}<td style="text-align:left">{{ linkedProduct.weight }}</td>{% endif %}
{% if nbCols == 0 %}<td style="text-align:left">{{ linkedProduct.description|raw }}{% endif %}
</tr>
{% set num = num +1 %}
{% endfor %}
</table>
</div>
</div>
{% endif %}
{% set count = 0 %}
{% for accessory in product.linkedProducts %}
{% if accessory.name is not empty %}
{% set count = count + 1 %}
{% endif %}
{% endfor %}
{% if count > 0 %}
<div class="options spacerTop">
<span>OPTIONS</span>
</div>
<button class="collapsible">Produits de la gamme</button>
<div class="content">
<div class="col-12 mb-12">
<table class="productTable" cellspacing="2px">
{% set num = 0 %}
{% set firstProduct = product.linkedProducts|first %}
{% set nbCols = 0 %}
{% set countName = 0 %}
{% set countGas = 0 %}
{% set countGraduation = 0 %}
{% set countMaximumPressure = 0 %}
{% set countFlowPressure = 0 %}
{% set countSubType = 0 %}
{% set countCapacity = 0 %}
{% set countLength = 0 %}
{% set countThread = 0 %}
{% set countAccessoryTxt = 0 %}
{% set countInPort = 0 %}
{% set countOutPort = 0 %}
{% set countWeight = 0 %}
{% for linkedProduct in product.linkedProducts %}
{% if linkedProduct.name is not empty %}
{% set countName = countName + 1 %}
{% endif %}
{% if linkedProduct.gas is not empty %}
{% set countGas = countGas + 1 %}{% set nbCols = nbCols+1 %}
{% endif %}
{% if linkedProduct.graduation is not empty %}
{% set countGraduation = countGraduation + 1 %}{% set nbCols = nbCols+1 %}
{% endif %}
{% if linkedProduct.maximumPressure is not empty %}
{% set countMaximumPressure = countMaximumPressure + 1 %}{% set nbCols = nbCols+1 %}
{% endif %}
{% if linkedProduct.flowPressure is not empty %}
{% set countFlowPressure = countFlowPressure + 1 %}{% set nbCols = nbCols+1 %}
{% endif %}
{% if linkedProduct.subType is not empty %}
{% set countSubType = countSubType + 1 %}{% set nbCols = nbCols+1 %}
{% endif %}
{% if linkedProduct.capacity is not empty %}
{% set countCapacity = countCapacity + 1 %}{% set nbCols = nbCols+1 %}
{% endif %}
{% if linkedProduct.length is not empty %}
{% set countLength = countLength + 1 %}{% set nbCols = nbCols+1 %}
{% endif %}
{% if linkedProduct.thread is not empty %}
{% set countThread = countThread + 1 %}{% set nbCols = nbCols+1 %}
{% endif %}
{% if linkedProduct.accessoryTxt is not empty %}
{% set countAccessoryTxt = countAccessoryTxt + 1 %}{% set nbCols = nbCols+1 %}
{% endif %}
{% if linkedProduct.inPort is not empty %}
{% set countInPort = countInPort + 1 %}{% set nbCols = nbCols+1 %}
{% endif %}
{% if linkedProduct.outPort is not empty %}
{% set countOutPort = countOutPort + 1 %}{% set nbCols = nbCols+1 %}
{% endif %}
{% if linkedProduct.weight is not empty %}
{% set countWeight = countWeight + 1 %}{% set nbCols = nbCols+1 %}
{% endif %}
{% endfor %}
{% for linkedProduct in product.linkedProducts %}
{% if num == 0 %}
<tr style="font-weight:bold">
{% if countName > 0 %}<th>Ref.</th>{% endif %}
{% if countGas > 0 %}<th>Gaz</th>{% endif %}
{% if countGraduation > 0 %}<th>Graduation</th>{% endif %}
{% if countMaximumPressure > 0 %}<th>Pression maxi en bar</th>{% endif %}
{% if countFlowPressure > 0 %}<th>Débit / pression </th>{% endif %}
{% if countSubType > 0 %}<th>Sous-type</th>{% endif %}
{% if countCapacity > 0 %}<th>Capacité en mm</th>{% endif %}
{% if countLength > 0 %}<th>L. hors tout en mm</th>{% endif %}
{% if countThread > 0 %}<th>Filetage</th>{% endif %}
{% if countAccessoryTxt > 0 %}<th>Accessoire</th>{% endif %}
{% if countInPort > 0 and product.boolInPort %}<th>Entrée</th>{% endif %}
{% if countOutPort > 0 and product.boolOutPort %}<th>Sortie</th>{% endif %}
{% if countWeight > 0 %}<th>Poids en kg</th>{% endif %}
{% if nbCols == 0 %}<th>Description</th>{% endif %}
</tr>
{% endif %}
<tr>
{% if countName > 0 %}<td style="text-align:left"><a href="/produits/{{ linkedProduct.mainReference }}">{{ linkedProduct.mainReference }}</a></td>{% endif %}
{% if countGas> 0 %}<td style="text-align:left">{{ linkedProduct.gas }}</td>{% endif %}
{% if countGraduation > 0 %}<td style="text-align:left">{{ linkedProduct.graduation }}</td>{% endif %}
{% if countMaximumPressure > 0 %}<td style="text-align:left">{{ linkedProduct.maximumPressure }}</td>{% endif %}
{% if countFlowPressure > 0 %}<td style="text-align:left">{{ linkedProduct.flowPressure }}</td>{% endif %}
{% if countSubType > 0 %}<td style="text-align:left">{{ linkedProduct.subType }}</td>{% endif %}
{% if countCapacity > 0 %}<td style="text-align:left">{{ linkedProduct.capacity }}</td>{% endif %}
{% if countLength > 0 %}<td style="text-align:left">{{ linkedProduct.length }}</td>{% endif %}
{% if countThread > 0 %}<td style="text-align:left">{{ product.thread }}</td>{% endif %}
{% if countAccessoryTxt > 0 %}<td style="text-align:left">{{ linkedProduct.accessoryTxt }}</td>{% endif %}
{% if countInPort > 0 and product.boolInPort %}<td style="text-align:left">{{ linkedProduct.inPort }}</td>{% endif %}
{% if countOutPort > 0 and product.boolOutPort %}<td style="text-align:left">{{ linkedProduct.outPort }}</td>{% endif %}
{% if countWeight >0 %}<td style="text-align:left">{{ linkedProduct.weight }}</td>{% endif %}
{% if nbCols == 0 %}<td style="text-align:left">{{ linkedProduct.description|raw }}{% endif %}
</tr>
{% set num = num +1 %}
{% endfor %}
</table>
</div>
</div>
{% endif %}
{% set previous_title = "" %}
{% set count = 0 %}
{% for accessory in product.accessories %}
{% set count = count + 1 %}
{% endfor %}
{% if count > 0 %}
{% set filteredAccessories = product.accessories|filter(item => item.gas is not empty)|filter(item => item.subTitle is empty) %}
{% set count2 = 0 %}
{% for accessory in filteredAccessories %}
{% set count2 = count2 + 1 %}
{% endfor %}
{% set filteredAccessories = product.accessories|filter(item => item.subTitle is not empty) %}
{% set count2 = 0 %}
{% for accessory in filteredAccessories %}
{% set count2 = count2 + 1 %}
{% endfor %}
{% if count2 > 0 %}
<button class="collapsible">Accessoires Compatibles</button>
{% endif %}
<div class="content">
{% set count = 0 %}
{% for accessory in product.accessories %}
{% if accessory.gas is not empty and (accessory.speed is empty or (accessory.speed is not empty and accessory.subTitle is empty)) %}
{% set count = count + 1 %}
{% elseif accessory.subTitle == "Multidards" or accessory.subTitle == "Annulaire" %}
{% set count = count + 1 %}
{% endif %}
{% endfor %}
{% set countSubTitle = 0 %}
{% for accessory in product.accessories %}
{% if accessory.subTitle is not empty %}
{% set countSubTitle = count + 1 %}
{% endif %}
{% endfor %}
{% if count > 0 %}
<div class="col-12 mb-12" style="margin-top:25px;">
{# Créer un tableau d'accessoires avec un découpage par GAZ - ils doivent avoir un gaz renseigné et pas de sous titre #}
{% set filteredAccessories = product.accessories|filter(item => item.gas is not empty)|filter(item => item.subTitle is empty) %}
{% set num = 0 %}
{% set sub = "first" %}
{% set nbCol = 4 %}
{% set firstProduct = filteredAccessories|first %}
{% if product.graduation %}
{% if firstProduct.graduation is not empty %}
{% set nbCol = nbCol +1 %} {% endif %}
{% endif %}
{% if product.boolInPort %}
{% if firstProduct.inPort is not empty %}
{% set nbCol = nbCol +1 %} {% endif %}
{% endif %}
{% if product.boolOutPort %}
{% if firstProduct.outPort is not empty %}
{% set nbCol = nbCol +1 %} {% endif %}
{% endif %}
{% for accessoire in filteredAccessories %}
{% if (sub != accessoire.gas) %}
{% if sub != "first" %}
</table>
</td>
</tr>
</table>
{% endif %}
{% if previous_title != accessoire.title %}
<h2>
{{ accessoire.title }}
</h2>
{% endif %}
{% set previous_title = accessoire.title %}
<table class="productTable" cellspacing="2px">
<tr class="responsiveImage">
<td style="text-align:left">
{% if accessoire.images is not null %}
{% set firstImage = accessoire.images|first %}
{% if firstImage %}
<img src="{{ asset('assets/uploads/products/mini/') ~ firstImage.name }}" class="d-block w-100" alt="{{ firstImage.name }}" style="transform: scale(0.5);">
{% endif %}
{% endif %}
</td>
</tr>
<tr>
<td style="text-align:left" class="notResponsiveImage">
{% if accessoire.images is not null %}
{% set firstImage = accessoire.images|first %}
{% if firstImage %}
<img src="{{ asset('assets/uploads/products/mini/') ~ firstImage.name }}" class="d-block w-100" alt="{{ firstImage.name }}" style="transform: scale(0.5);">
{% endif %}
{% endif %}
</td>
<td style="text-align:left">
{% set count = 0 %}
{% set countName = 0 %}
{% set countCaliber = 0 %}
{% set countThickness = 0 %}
{% set countSpeed = 0 %}
{% set countFlowPressure = 0 %}
{% set countMaximumPressure = 0 %}
{% set countThread = 0 %}
{% set countGraduation = 0 %}
{% set countInPort = 0 %}
{% set countOutPort = 0 %}
{% set countAccessoryType = 0 %}
{% set countDrillingThickness = 0 %}
{% set countPressureInBar = 0 %}
{% set countDriftThickness = 0 %}
{% set countGougingThickness = 0 %}
{% set countWeight = 0 %}
{% set filteredAccessoriesFor = product.accessories|filter(item => item.gas == accessoire.gas)|filter(item => item.subTitle is empty) %}
{% for accessory in filteredAccessoriesFor %}
{% if accessory.gas is not empty and accessory.gas == accessoire.gas and accessory.subTitle == accessoire.subTitle %}
{% if accessory.gas is not empty and (accessory.speed is empty or (accessory.speed is not empty and accessory.subTitle is empty)) %}
{% set count = count + 1 %}
{% endif %}
{% if accessory.name is not empty %}
{% set countName = countName + 1 %}
{% endif %}
{% if accessory.caliber is not empty %}
{% set countCaliber = countCaliber + 1 %}
{% endif %}
{% if accessory.thickness is not empty %}
{% set countThickness = countThickness + 1 %}
{% endif %}
{% if accessory.speed is not empty %}
{% set countSpeed = countSpeed + 1 %}
{% endif %}
{% if accessory.flowPressure is not empty %}
{% set countFlowPressure = countFlowPressure + 1 %}
{% endif %}
{% if accessory.maximumPressure is not empty %}
{% set countMaximumPressure = countMaximumPressure + 1 %}
{% endif %}
{% if accessory.Thread is not empty %}
{% set countThread = countThread + 1 %}
{% endif %}
{% if accessory.graduation is not empty %}
{% set countGraduation = countGraduation + 1 %}
{% endif %}
{% if accessory.inPort is not empty %}
{% set countInPort = countInPort + 1 %}
{% endif %}
{% if accessory.outPort is not empty %}
{% set countOutPort = countOutPort + 1 %}
{% endif %}
{% if accessory.accessoryType is not empty %}
{% set countAccessoryType = countAccessoryType + 1 %}
{% endif %}
{% if accessory.DrillingThickness is not empty %}
{% set countDrillingThickness = countDrillingThickness + 1 %}
{% endif %}
{% if accessory.pressureInBar is not empty %}
{% set countPressureInBar = countPressureInBar + 1 %}
{% endif %}
{% if accessory.driftThickness is not empty %}
{% set countDriftThickness = countDriftThickness + 1 %}
{% endif %}
{% if accessory.gougingThickness is not empty %}
{% set countGougingThickness = countGougingThickness + 1 %}
{% endif %}
{% if accessory.weight is not empty %}
{% set countWeight = countWeight + 1 %}
{% endif %}
{% endif %}
{% endfor %}
<table class="productTable" cellspacing="2px">
<tr style="font-weight:bold;padding-top: 25px;">
<td colspan="{{ nbCol }}">
{{accessoire.gas }}
</td>
</tr>
<tr style="font-weight:bold">
{% if countName > 0 %}<th>Ref. 2</th>{% endif %}
{% if countCaliber > 0 %}<th>Calibre</th>{% endif %}
{% if countThickness > 0 %}<th>Epaisseur de coupe en mm</th>{% endif %}
{% if countSpeed > 0 %}<th>Débit l/h</th>{% endif %}
{% if countFlowPressure > 0 %}<th>Débit / pression </th>{% endif %}
{% if countMaximumPressure > 0 %}<th>Pression maxi en bar</th>{% endif %}
{% if countThread > 0 %}<th>Filetage</th>{% endif %}
{% if countGraduation > 0 %}<th>Graduation</th>{% endif %}
{% if countInPort > 0 %}<th>Entrée</th>{% endif %}
{% if countOutPort > 0 %}<th>Sortie</th>{% endif %}
{% if countAccessoryType > 0 %}<th>Type</th>{% endif %}
{% if countDrillingThickness > 0 %}<th>Epaisseur de perçage</th>{% endif %}
{% if countPressureInBar > 0 %}<th>Pression de service en bar</th>{% endif %}
{% if countDriftThickness > 0 %}<th>Epaisseur de dérivetage en mm</th>{% endif %}
{% if countGougingThickness > 0 %}<th>Epaisseur de gougeage en mm</th>{% endif %}
{% if countWeight > 0 %}<th>Poids en kg</th>{% endif %}
</tr>
{% set sub = accessoire.gas %}
{% endif %}
<tr>
{% if countName > 0 %} <td style="text-align:left"><a href="/produits/{{ accessoire.name }}">{{ accessoire.name }}</a></td> {% endif %}
{% if countCaliber > 0 %}<td style="text-align:left">{{ accessoire.caliber }}</td> {% endif %}
{% if countThickness > 0 %}<td style="text-align:left">{{ accessoire.thickness }}</td> {% endif %}
{% if countSpeed > 0 %}<td style="text-align:left">{{ accessoire.speed }}</td>{% endif %}
{% if countFlowPressure > 0 %}<td style="text-align:left">{{ accessoire.flowPressure }}</td>{% endif %}
{% if countMaximumPressure > 0 %}<td style="text-align:left">{{ accessoire.maximumPressure }}</td>{% endif %}
{% if countThread > 0 %}<td style="text-align:left">{{ accessoire.thread }}</td>{% endif %}
{% if countGraduation > 0 %}<td style="text-align:left">{{ accessoire.graduation }}</td> {% endif %}
{% if countInPort > 0 %}<td style="text-align:left">{{ accessoire.inPort }}</td> {% endif %}
{% if countOutPort > 0 %}<td style="text-align:left">{{ accessoire.outPort }}</td> {% endif %}
{% if countAccessoryType > 0 %}<td style="text-align:left">{{ accessoire.accessoryType }}</td>{% endif %}
{% if countDrillingThickness > 0 %}<td style="text-align:left">{{ accessoire.drillingThickness }}</td>{% endif %}
{% if countPressureInBar > 0 %}<td style="text-align:left">{{ accessoire.pressureInBar }}</td>{% endif %}
{% if countDriftThickness > 0 %}<td style="text-align:left">{{ accessoire.driftThickness }}</td>{% endif %}
{% if countGougingThickness > 0 %}<td style="text-align:left">{{ accessoire.gougingThickness }}</td>{% endif %}
{% if countWeight > 0 %}<td style="text-align:left">{{ accessoire.weight }}</td>{% endif %}
</tr>
{% set num = num +1 %}
{% endfor %}
</table>
</td>
</tr>
</table>
{% if countSubTitle > 0 %}
{# Créer un tableau trié en fonction de `subTitle` #}
{% set filteredAccessories = product.accessories|filter(item => item.gas is not empty)|filter(item => item.subTitle is not empty)| sort((a, b) => a.subtitle <=> b.subtitle) %}
{% set num = 0 %}
{% set sub = "first" %}
{% set nbCol = 4 %}
{% set firstProduct = filteredAccessories|first %}
{% if product.graduation %}
{% if firstProduct.graduation is not empty %}
{% set nbCol = nbCol +1 %} {% endif %}
{% endif %}
{% if product.inPort %}
{% if firstProduct.inPort is not empty %}
{% set nbCol = nbCol +1 %} {% endif %}
{% endif %}
{% if product.outPort %}
{% if firstProduct.outPort is not empty %}
{% set nbCol = nbCol +1 %} {% endif %}
{% endif %}
{% for accessoire in filteredAccessories %}
{% if (sub != accessoire.subTitle) %}
{% if sub != "first" %}
</table>
</td>
</tr>
</table>
{% endif %}
{% if previous_title != accessoire.title %}
<h2>
{{ accessoire.title }}
</h2>
{% endif %}
{% set previous_title = accessoire.title %}
<table class="productTable" cellspacing="2px">
<tr class="responsiveImage">
<td style="text-align:left">
{% if accessoire.images is not null %}
{% set firstImage = accessoire.images|first %}
{% if firstImage %}
<img src="{{ asset('assets/uploads/products/mini/') ~ firstImage.name }}" class="d-block w-100" alt="{{ firstImage.name }}" style="transform: scale(0.5);">
{% endif %}
{% endif %}
</td>
</tr>
<tr>
<td style="text-align:left" class="notResponsiveImage">
{% if accessoire.images is not null %}
{% set firstImage = accessoire.images|first %}
{% if firstImage %}
<img src="{{ asset('assets/uploads/products/mini/') ~ firstImage.name }}" class="d-block w-100" alt="{{ firstImage.name }}" style="transform: scale(0.5);">
{% endif %}
{% endif %}
</td>
<td style="text-align:left">
{% set count = 0 %}
{% set countGas = 0 %}
{% set countName = 0 %}
{% set countCaliber = 0 %}
{% set countThickness = 0 %}
{% set countSpeed = 0 %}
{% set countFlowPressure = 0 %}
{% set countMaximumPressure = 0 %}
{% set countThread = 0 %}
{% set countGraduation = 0 %}
{% set countInPort = 0 %}
{% set countOutPort = 0 %}
{% set countAccessoryType = 0 %}
{% set countDrillingThickness = 0 %}
{% set countPressureInBar = 0 %}
{% set countDriftThickness = 0 %}
{% set countGougingThickness = 0 %}
{% set countWeight = 0 %}
{% set filteredAccessoriesFor = product.accessories|filter(item => item.gas == accessoire.gas)| sort((a, b) => a.subtitle <=> b.subtitle) %}
{% if countSubTitle > 0 %}
{% set filteredAccessoriesFor = product.accessories|filter(item => item.subTitle == accessoire.subTitle)| sort((a, b) => a.subtitle <=> b.subtitle) %}
{% endif %}
{% for accessory in filteredAccessoriesFor %}
{% if accessory.gas is not empty and (accessory.speed is empty or (accessory.speed is not empty and accessory.subTitle is empty)) %}
{% set count = count + 1 %}
{% endif %}
{% if accessory.name is not empty %}
{% set countName = countName + 1 %}
{% endif %}
{% if accessory.caliber is not empty %}
{% set countCaliber = countCaliber + 1 %}
{% endif %}
{% if accessory.thickness is not empty %}
{% set countThickness = countThickness + 1 %}
{% endif %}
{% if accessory.speed is not empty %}
{% set countSpeed = countSpeed + 1 %}
{% endif %}
{% if accessory.flowPressure is not empty %}
{% set countFlowPressure = countFlowPressure + 1 %}
{% endif %}
{% if accessory.maximumPressure is not empty %}
{% set countMaximumPressure = countMaximumPressure + 1 %}
{% endif %}
{% if accessory.Thread is not empty %}
{% set countThread = countThread + 1 %}
{% endif %}
{% if accessory.graduation is not empty %}
{% set countGraduation = countGraduation + 1 %}
{% endif %}
{% if accessory.inPort is not empty %}
{% set countInPort = countInPort + 1 %}
{% endif %}
{% if accessory.outPort is not empty %}
{% set countOutPort = countOutPort + 1 %}
{% endif %}
{% if accessory.accessoryType is not empty %}
{% set countAccessoryType = countAccessoryType + 1 %}
{% endif %}
{% if accessory.DrillingThickness is not empty %}
{% set countDrillingThickness = countDrillingThickness + 1 %}
{% endif %}
{% if accessory.pressureInBar is not empty %}
{% set countPressureInBar = countPressureInBar + 1 %}
{% endif %}
{% if accessory.driftThickness is not empty %}
{% set countDriftThickness = countDriftThickness + 1 %}
{% endif %}
{% if accessory.gougingThickness is not empty %}
{% set countGougingThickness = countGougingThickness + 1 %}
{% endif %}
{% if accessory.weight is not empty %}
{% set countWeight = countWeight + 1 %}
{% endif %}
{% endfor %}
<table class="productTable" cellspacing="2px">
<tr style="font-weight:bold;padding-top: 25px;">
<td colspan="{{ nbCol }}">
<p>{{ accessoire.subTitle
|replace({
'[1]': '',
'[2]': '',
'[3]': '',
'[4]': ''
})
}}</p>
{% if accessoire.header is not empty %}{{ accessoire.header|raw }}{% endif %}
</td>
</tr>
<tr style="font-weight:bold">
<th>Ref.</th>
<th>Gaz</th>
{% if countCaliber > 0 %}<th>Calibre</th>{% endif %}
{% if countThickness > 0 %}<th>Epaisseur de coupe en mm</th>{% endif %}
{% if countSpeed > 0 %}
{% if accessoire.subtitle == "Multidards" %}
<th>Débit g/h</th>
{% else %}
<th>Débit l/h</th>
{% endif %}
{% endif %}
{% if countFlowPressure > 0 %}<th>Débit / pression </th>{% endif %}
{% if countMaximumPressure > 0 %}<th>Pression maxi en bar</th>{% endif %}
{% if countThread > 0 %}<th>Filetage</th>{% endif %}
{% if countGraduation > 0 %}<th>Graduation</th>{% endif %}
{% if countInPort > 0 %}<th>Entrée</th>{% endif %}
{% if countOutPort > 0 %}<th>Sortie</th>{% endif %}
{% if countAccessoryType > 0 %}<th>Type</th>{% endif %}
{% if countDrillingThickness > 0 %}
{% if accessoire.subtitle == "Annulaire" %}
<th>Diamètre perçage</th>
{% else %}
<th>Epaisseur de perçage</th>
{% endif %}
{% endif %}
{% if countPressureInBar > 0 %}<th>Pression de service en bar</th>{% endif %}
{% if countDriftThickness > 0 %}<th>Epaisseur de dérivetage en mm</th>{% endif %}
{% if countGougingThickness > 0 %}<th>Epaisseur de gougeage en mm</th>{% endif %}
{% if countWeight > 0 %}<th>Poids en kg</th>{% endif %}
</tr>
{% set sub = accessoire.subTitle %}
{% endif %}
<tr>
{% if countName > 0 %} <td style="text-align:left"><a href="/produits/{{ accessoire.name }}">{{ accessoire.name }}</a></td> {% endif %}
<td style="text-align:left">{{ accessoire.gas }}</td>
{% if countCaliber > 0 %}<td style="text-align:left">{{ accessoire.caliber }}</td> {% endif %}
{% if countThickness > 0 %}<td style="text-align:left">{{ accessoire.thickness }}</td> {% endif %}
{% if countSpeed > 0 %}<td style="text-align:left">{{ accessoire.speed }}</td>{% endif %}
{% if countFlowPressure > 0 %}<td style="text-align:left">{{ accessoire.flowPressure }}</td>{% endif %}
{% if countMaximumPressure > 0 %}<td style="text-align:left">{{ accessoire.maximumPressure }}</td>{% endif %}
{% if countThread > 0 %}<td style="text-align:left">{{ accessoire.thread }}</td>{% endif %}
{% if countGraduation > 0 %}<td style="text-align:left">{{ accessoire.graduation }}</td> {% endif %}
{% if countInPort > 0 %}<td style="text-align:left">{{ accessoire.inPort }}</td> {% endif %}
{% if countOutPort > 0 %}<td style="text-align:left">{{ accessoire.outPort }}</td> {% endif %}
{% if countAccessoryType > 0 %}<td style="text-align:left">{{ accessoire.accessoryType }}</td>{% endif %}
{% if countDrillingThickness > 0 %}<td style="text-align:left">{{ accessoire.drillingThickness }}</td>{% endif %}
{% if countPressureInBar > 0 %}<td style="text-align:left">{{ accessoire.pressureInBar }}</td>{% endif %}
{% if countDriftThickness > 0 %}<td style="text-align:left">{{ accessoire.driftThickness }}</td>{% endif %}
{% if countGougingThickness > 0 %}<td style="text-align:left">{{ accessoire.gougingThickness }}</td>{% endif %}
{% if countWeight > 0 %}<td style="text-align:left">{{ accessoire.weight }}</td>{% endif %}
</tr>
{% set num = num +1 %}
{% endfor %}
</table>
</td>
</tr>
</table>
{% endif %}
</div>
{% endif %}
{% set count = 0 %}
{% set countDriftThickness = 0 %}
{% set countGougingThickness = 0 %}
{% for accessory in product.accessories %}
{% if accessory.speed is not empty %}
{% set count = count + 1 %}
{% endif %}
{% if accessory.driftThickness is not empty %}
{% set countDriftThickness = countDriftThickness + 1 %}
{% endif %}
{% if accessory.gougingThickness is not empty %}
{% set countGougingThickness = countGougingThickness + 1 %}
{% endif %}
{% endfor %}
{% if count > 0 %}
<div class="col-12 mb-12" style="margin-top:25px;">
{% set filteredAccessories = product.accessories |filter(item => item.subtitle != "Annulaire") | filter(item => item.subtitle != "Multidards") | sort((a, b) => a.subtitle <=> b.subtitle) %}
{% set firstAccessory = filteredAccessories|first %}
{% set num = 0 %}
{% set sub = "first" %}
{% set nbCol = 3 %}
{% set firstProduct = filteredAccessories|first %}
{% if product.graduation %}
{% if firstProduct.graduation is not empty %}
{% set nbCol = nbCol +1 %} {% endif %}
{% endif %}
{% if product.inPort %}
{% if firstProduct.inPort is not empty %}
{% set nbCol = nbCol +1 %} {% endif %}
{% endif %}
{% if product.outPort %}
{% if firstProduct.outPort is not empty %}
{% set nbCol = nbCol +1 %} {% endif %}
{% endif %}
{% for accessoire in filteredAccessories %}
{% if accessoire.subtitle != "" %}
{% if sub != accessoire.subtitle %}
{% set firstProduct = accessoire %}
{% if sub != "first" %}
</table>
</td>
</tr>
</table>
{% endif %}
{% set count = 0 %}
{% set countGas = 0 %}
{% set countName = 0 %}
{% set countCaliber = 0 %}
{% set countThickness = 0 %}
{% set countSpeed = 0 %}
{% set countFlowPressure = 0 %}
{% set countMaximumPressure = 0 %}
{% set countThread = 0 %}
{% set countGraduation = 0 %}
{% set countInPort = 0 %}
{% set countOutPort = 0 %}
{% set countAccessoryType = 0 %}
{% set countDrillingThickness = 0 %}
{% set countPressureInBar = 0 %}
{% set countDriftThickness = 0 %}
{% set countGougingThickness = 0 %}
{% set countSubSubType = 0 %}
{% set filteredAccessoriesFor = product.accessories|filter(item => item.subtitle == accessoire.subtitle) %}
{% for accessory in filteredAccessoriesFor %}
{% if accessory.gas is not empty and (accessory.speed is empty or (accessory.speed is not empty and accessory.subTitle is empty)) %}
{% set count = count + 1 %}
{% endif %}
{% if accessory.gas is not empty %}
{% set countGas = countGas + 1 %}
{% endif %}
{% if accessory.name is not empty %}
{% set countName = countName + 1 %}
{% endif %}
{% if accessory.caliber is not empty %}
{% set countCaliber = countCaliber + 1 %}
{% endif %}
{% if accessory.thickness is not empty %}
{% set countThickness = countThickness + 1 %}
{% endif %}
{% if accessory.speed is not empty %}
{% set countSpeed = countSpeed + 1 %}
{% endif %}
{% if accessory.flowPressure is not empty and accessory.flowPressure != "-" %}
{% set countFlowPressure = countFlowPressure + 1 %}
{% endif %}
{% if accessory.maximumPressure is not empty %}
{% set countMaximumPressure = countMaximumPressure + 1 %}
{% endif %}
{% if accessory.Thread is not empty %}
{% set countThread = countThread + 1 %}
{% endif %}
{% if accessory.graduation is not empty %}
{% set countGraduation = countGraduation + 1 %}
{% endif %}
{% if accessory.inPort is not empty %}
{% set countInPort = countInPort + 1 %}
{% endif %}
{% if accessory.outPort is not empty %}
{% set countOutPort = countOutPort + 1 %}
{% endif %}
{% if accessory.accessoryType is not empty %}
{% set countAccessoryType = countAccessoryType + 1 %}
{% endif %}
{% if accessory.DrillingThickness is not empty %}
{% set countDrillingThickness = countDrillingThickness + 1 %}
{% endif %}
{% if accessory.pressureInBar is not empty %}
{% set countPressureInBar = countPressureInBar + 1 %}
{% endif %}
{% if accessory.driftThickness is not empty %}
{% set countDriftThickness = countDriftThickness + 1 %}
{% endif %}
{% if accessory.gougingThickness is not empty %}
{% set countGougingThickness = countGougingThickness + 1 %}
{% endif %}
{% if accessory.subSubType is not empty %}
{% set countSubSubType = countSubSubType + 1 %}
{% endif %}
{% endfor %}
{% if previous_title != accessoire.title %}
<h2>
{{ accessoire.title }}
</h2>
{% endif %}
{% set previous_title = accessoire.title %}
<table class="productTable" cellspacing="2px">
<tr class="responsiveImage">
<td>
{% if accessoire.images is not null %}
{% set firstImage = accessoire.images|first %}
{% if firstImage %}
<img src="{{ asset('assets/uploads/products/mini/') ~ firstImage.name }}" class="d-block w-100" alt="{{ firstImage.name }}" style="transform: scale(0.5);">
{% endif %}
{% endif %}
</td>
</tr>
<tr>
<td class="notResponsiveImage">
{% if accessoire.images is not null %}
{% set firstImage = accessoire.images|first %}
{% if firstImage %}
<img src="{{ asset('assets/uploads/products/mini/') ~ firstImage.name }}" class="d-block w-100" alt="{{ firstImage.name }}" style="transform: scale(0.5);">
{% endif %}
{% endif %}
</td>
<td>
<table class="productTable" cellspacing="2px">
<tr style="font-weight:bold;padding-top: 25px;">
<td colspan="{{ nbCol }}">
<p>{{accessoire.subtitle }} </p>
</td>
</tr>
<tr style="font-weight:bold">
{% if countGas > 0 %}<th>Gaz</th>{% endif %}
{% if countName > 0 %}<th>Ref. 4</th>{% endif %}
{% if countCaliber > 0 %}<th>Calibre</th>{% endif %}
{% if countThickness > 0 %}<th>Epaisseur de coupe en mm</th>{% endif %}
{% if countSpeed > 0 %}
{% if accessoire.subtitle == "Annulaire OX/Propane" %}
<th>Diamètre perçage</th>
{% else %}
<th>Débit l/h</th>
{% endif %}
{% endif %}
{% if countFlowPressure > 0 %}<th>Débit / pression </th>{% endif %}
{% if countMaximumPressure > 0 %}<th>Pression maxi en bar</th>{% endif %}
{% if countThread > 0 %}<th>Filetage</th>{% endif %}
{% if countGraduation > 0 %}<th>Graduation</th>{% endif %}
{% if countInPort > 0 %}<th>Entrée</th>{% endif %}
{% if countOutPort > 0 %}<th>Sortie</th>{% endif %}
{% if countAccessoryType > 0 %}<th>Type</th>{% endif %}
{% if countDrillingThickness > 0 %}<th>Epaisseur de perçage</th>{% endif %}
{% if countPressureInBar > 0 %}<th>Pression de service en bar</th>{% endif %}
{% if countDriftThickness > 0 %}<th>Epaisseur de dérivetage en mm</th>{% endif %}
{% if countGougingThickness > 0 %}<th>Epaisseur de gougeage en mm</th>{% endif %}
{% if countSubSubType > 0 %}
{% for accessory in product.accessories %}
{% if accessory.speed is not empty %}
{% if accessory.subSubType is not empty %}<th>Sous-Type</th>{% endif %}
{% endif %}
{% endfor %}
{% endif %}
</tr>
{% set sub = accessoire.subtitle %}
{% endif %}
<tr>
{% if countGas > 0 %}<td style="text-align:left">{{ accessoire.gas }}</td>{% endif %}
{% if countName > 0 %}<td style="text-align:left"><a href="/produits/{{ accessoire.name }}">{{ accessoire.name }}</a></td>{% endif %}
{% if countCaliber > 0 %}<td style="text-align:left">{{ accessoire.caliber }}</td> {% endif %}
{% if countThickness > 0 %}<td style="text-align:left">{{ accessoire.thickness }}</td> {% endif %}
{% if countSpeed > 0 %}<td style="text-align:left">{{ accessoire.speed }}</td>{% endif %}
{% if countFlowPressure > 0 %}<td style="text-align:left">{{ accessoire.flowPressure }}</td>{% endif %}
{% if countMaximumPressure > 0 %}<td style="text-align:left">{{ accessoire.maximumPressure }}</td>{% endif %}
{% if countThread > 0 %}<td style="text-align:left">{{ accessoire.thread }}</td>{% endif %}
{% if countGraduation > 0 %}<td style="text-align:left">{{ accessoire.graduation }}</td>{% endif %}
{% if countInPort > 0 %}<td style="text-align:left">{{ accessoire.inPort }}</td>{% endif %}
{% if countOutPort > 0 %}<td style="text-align:left">{{ accessoire.outPort }}</td>{% endif %}
{% if countAccessoryType > 0 %}<td style="text-align:left">{{ accessoire.accessoryType }}</td>{% endif %}
{% if countDrillingThickness > 0 %}<td style="text-align:left">{{ accessoire.drillingThickness }}</td>{% endif %}
{% if countPressureInBar > 0 %}<td style="text-align:left">{{ accessoire.pressureInBar }}</td>{% endif %}
{% if countDriftThickness > 0 %}<td style="text-align:left">{{ accessoire.driftThickness }}</td>{% endif %}
{% if countGougingThickness > 0 %}<td style="text-align:left">{{ accessoire.gougingThickness }}</td>{% endif %}
{% if accessoire.subSubType is not empty %}<td style="text-align:left">{{ accessoire.subSubType }}</td>{% endif %}
</tr>
{% endif %}
{% set num = num +1 %}
{% endfor %}
</table>
</td>
</tr>
</table>
</div>
{% endif %}
</div>
{% endif %}
<hr>
<div class="12">
<p>{{ product.footer|raw }}</p>
</div>
</div>
{% if app.user %}
<div class="col-md-3">
<div class="user-box p-3 mb-4 border rounded shadow-sm bg-light">
<h5 class="mb-2">Utilisateur </h5>
<p><strong>Nom :</strong> {{ app.user.lastname }}</p>
<p><strong>Prénom :</strong> {{ app.user.firstname }}</p>
<a class="btn btn-outline-secondary btn-sm" href="{{ path('app_logout') }}">Me déconnecter</a>
{% if tarifs is not empty %}
<hr>
<h6>Tarifs produits :</h6>
<ul class="list-unstyled">
{% for tarif in tarifs %}
<li>
{{ tarif.designation }} :
{% if user.entreprise %}
{% set prixRemise = user.entreprise.calculerTarifRemise(tarif) %}
{% if prixRemise != tarif.prixVente %}
<span class="text-success">{{ prixRemise }} € après remise</span>
{% endif %}
{% endif %}
{% if user.agence %}
{% set prixRemise = user.agence.calculerTarifRemise(tarif) %}
{% if prixRemise != tarif.prixVente %}
<span class="text-success">{{ prixRemise }} € après remise</span>
{% endif %}
{% endif %}
</li>
{% endfor %}
</ul>
{% endif %}
</div>
{% else %}
<div class="user-box p-3 border rounded shadow-sm bg-light">
<h5>Utilisateur non connecté</h5>
<p><a href="{{ path('app_login') }}" class="btn btn-outline-primary btn-sm">Se connecter</a></p>
<p>« Affichez vos prix remisé en accédant à votre espace client, pas encore d’espace
client? Faites en la demande en cliquant <a href="{{ path('app_register') }}">ICI</a> »</p>
</div>
</div>
{% endif %}
</section>
</main>
{% endblock %}