{% extends 'base.html.twig' %}
{% block body %}
<table class="table table-striped table-bordered">
<thead>
<tr class="bg-info">
<th scope="col">Destinataires</th>
<th scope="col">Date</th>
<th scope="col">Sujet</th>
<th scope="col">Nombre</th>
<th scope="col">Texte</th>
<th scope="col">Action</th>
</thead>
</tr>
{% for lis in lettres %}
<tr>
<td style="font-size:80%;width:200px">
{% if lis.CVO is defined and lis.date |date('Y-m-d') > "2021-04-13" %}
{% if lis.CVO == true %}
<div style="color:red">CVO moulin rouges <b>incluses</b></div>
{% else %}
CVO moulin rouges exclues
{% endif %}
{% endif %}
{% if lis.CVOC is defined and lis.date |date('Y-m-d') > "2021-04-13" %}
{% if lis.CVOC == true %}
<div style="color:red">CVO confiserie rouges <b>incluses</b></div>
{% else %}
CVO confiserie rouges exclues
{% endif %}
{% endif %}
{% if lis.moulin %}
<p>- moulins</p>
{% endif %}
{% if lis.confiseur %}
<p>- confiseurs</p>
{% endif %}
{% if lis.domaine %}
<p>- domaines</p>
{% endif %}
{% if lis.syndicat %}
<p>- syndicats</p>
{% endif %}
{% if lis.salaries %}
<p>- salariƩs</p>
{% endif %}
{% if lis.administrateur %}
<p>- administrateurs</p>
{% endif %}
{% if lis.syndiclocal %}
<p>- syndicats locaux</p>
{% endif %}
{% if lis.association %}
<p>- associations</p>
{% endif %}
{% if lis.membre %}
<p>- membres de l'AG AFIDOL</p>
{% endif %}
{% if lis.piegeur %}
<p>- piƩgeurs</p>
{% endif %}
{% if lis.mailzones|length == 0 %}
{% else %}
<p><u>Zones</u> :</p>
{% for mz in lis.mailzones %}
<p>- {{ mz.name }}</p>
{% endfor %}
{% endif %}
</td>
<td class="text-center small">
{{ lis.date|date("d/m/Y H:i") }}
</td>
<td style="font-size:80%">
{{ lis.titre|UTF8Decode|HtmlEntityDecode }}
</td>
<td class="text-center small">
{{ lis.nombre }}
</td>
<td style="max-width: 500px; font-size:80%">
{% set tex = lis.texte|slice(0,300)|UTF8Decode %}
{% set tex = tex|striptags|HtmlEntityDecode %}
{{ tex }}
...
</td>
<td>
<a href="{{path('view',{'id':lis.id})}}"><button class="btn-sm btn-primary">Voir</button></a>
</td>
</tr>
{% endfor %}
</table>
{% endblock body %}