{# si l'utilisateur est loggué #}
{% if app.user is not null %}
{% set monR = 0 %}
{# recupere ses ROLES #}
{% for role in app.user.roles %}
{% if role == "ROLE_ADMIN" %}
{% set monR = monR + 3 %}
{% else %}
{% set monR = monR + 1 %}
{% endif %}
{% endfor %}
{# sinon c'est un simple visiteur #}
{% else %}
{% set monR = 0 %}
{% endif %}
<div class="col-12">
<table class="table events-table tabStructure">
<thead class="menuTop">
<tr>
{% if app.user is not null %}
{% for role in app.user.roles %}
{% if role == "ROLE_ADMIN" %}
<th class="event-Id">Id</th>
{% endif %}
{% endfor %}
{% else %}
{% endif %}
<th class="event-Catégories/séquences">Catégories/séquences</th>
<th class="event-Cards">Cards</th>
<th class="event-Texte/Commentaires">
Texte{% if app.user is not null %}/Commentaires{% endif %}
</th>
{% if monR > 0 %}
<th class="event-Films">Films</th>
<th class="event-Transition">Transition</th>
<th class="event-Navigation">Navigation</th>
<th class="event-Zones">Zones</th>
<th class="event-Timer">Timer</th>
{% endif %}
</tr>
</thead>
<tbody>
{% if stacks|length > 0 %}
{% for stack in stacks %}
<tr id="ligne_{{ stack.id }}">
{# TD ID #}
{% if app.user is not null %}
{% for role in app.user.roles %}
{% if role == "ROLE_ADMIN" %}
{% include 'content/structure/tableauTd.html.twig' with {'foo': 'data-label="Id"'} %}
{{ stack.id }}
{% if app.user is not null %}
{% for role in app.user.roles %}
{% if role == "ROLE_ADMIN" %}
<hr>
<div class="mObile">
<button id="btnStatus{{ stack.id }}" class="btn btn-sm btnImmemoryShowAdmin" type="button" name="button">
État d'avancée
</button>
{% include "content/admin/stacks/verifRadio.html.twig" %}
</div>
{% else %}
{% endif %}
{% endfor %}
{% else %}
{% endif %}
</td>
{% endif %}
{% endfor %}
{% else %}
{% endif %}
{# TD Catégories/séquences #}
{% include 'content/structure/tableauTd.html.twig' with {'foo': 'data-label="Catégorie/Séquence"'} %}
<h3 class="catTableau">{{ stack.Scategorie.nom }} </h3>
<h2 class="seqTableau">{{ stack.Ssequence.nom }}</h2>
</td>
{# TD Cards #}
{% include 'content/structure/tableauTd.html.twig' with {'foo': 'data-label="Cards"'} %}
{{ stack.nom }} <br>
<div class="row">
<div class="col-5 imgTableau">
{% set image640 = stack.urlImage %}
<!--
<img class="centrerIMG2" src="{{ pathLocal }}/{{ image640|replace({'/900/': '/640/', '.jpg': ".png"}) }}" alt="{{ stack.nom }}" style="width:100%;">
-->
<img class="centrerIMG2" src="{{ pathLocal }}/{{ stack.urlImage0 }}" alt="{{ stack.nom }}" style="width:100%;">
<br>
<small>Natif : 640X480</small>
</div>
<div class="col-7 imgTableau">
<img class="centrerIMG2" src="{{ pathLocal }}/{{ stack.urlImage }}" alt="{{ stack.nom }}" style="width:100%;">
<br>
<small>Upscalé : 900X675</small>
</div>
</div>
<hr>
<a class="btn btnImmemory" href="{{ path('front_cdrom_900_ciblebif', {'id': stack.id}) }}" target="_blank">
CDRom
</a>
{% if app.user is not null %}
{% if search is defined and search is not null %}
<a class="btn btnImmemory" href="{{ path('webSite_stacks_show', {'id': stack.id, 'recherche': search }) }}">
{% else %}
<a class="btn btnImmemory" href="{{ path('webSite_stacks_show', {'id': stack.id, 'recherche': recherche }) }}">
{% endif %}
{% else %}
<a class="btn btnImmemory" href="{{ path('visiteur_stacks_show', {'id': stack.id, 'recherche': recherche }) }}">
{% endif %}
Détails
</a>
{% if app.user is not null %}
{% for role in app.user.roles %}
{% if role == "ROLE_ADMIN" %}
<a class="btn btnImmemory mObile" href="{{ path('admin_stacks_edit', {'id': stack.id}) }}">
Modification
</a>
<a class="btn btnImmemory mObile" href="{{ path('admin_stacks_duplicate', {'id': stack.id}) }}">
Dupliquer
</a>
{% else %}
{% endif %}
{% endfor %}
{% else %}
{% endif %}
</td>
{# TD Texte/Commentaires #}
{% include 'content/structure/tableauTd.html.twig' with {'foo': 'data-label="Textes/Commentaires"'} %}
<div class="commTableau">
{% if stack.texte is empty %}
Pas de texte
{% else %}
{% set monTexte = stack.texte|striptags|slice(0, 125) ~ '...' %}
{{ monTexte|raw }}
{# stack.texte|striptags|slice(0, 125) ~ '...' #}
{% endif %}
</div>
{% if app.user is not null %}
<div class="commTableau">
{% include "content/structure/commentaires/caseCommentaires.html.twig" %}
</div>
{% else %}
{% endif %}
</td>
{% if monR > 0 %}
{% include 'content/structure/tableauTd.html.twig' with {'foo': 'data-label="Film"'} %}
{% if stack.film is empty %}
{% elseif stack.film.id == 1 %}
{% else %}
{{ stack.film.nom }}
{% endif %}
</td>
{% include 'content/structure/tableauTd.html.twig' with {'foo': 'data-label="tansitions"'} %}
{% if stack.transitIn.nom is defined and stack.transitIn.nom is not empty %}
{{ stack.transitIn.nom }}
{% else %}
-
{% endif %}
</td>
{% include 'content/structure/tableauTd.html.twig' with {'foo': 'data-label="Navigation"'} %}
<table class="navCDRom">
<tr>
<td colspan="4">
{% if stack.navH is defined and stack.navH is not empty %}
{{ stack.navH }}
{% else %}
-
{% endif %}
</td>
</tr>
<tr>
<td>
{% if stack.navG is defined and stack.navG is not empty %}
{{ stack.navG }}
{% else %}
-
{% endif %}
</td>
<td colspan="2" class="milieuCadre"></td>
<td>
{% if stack.navD is defined and stack.navD is not empty %}
{{ stack.navD }}
{% else %}
-
{% endif %}
</td>
</tr>
<tr>
<td colspan="2">
{% if stack.navBG is defined and stack.navBG is not empty %}
{{ stack.navBG }}
{% else %}
-
{% endif %}
</td>
<td colspan="2">
{% if stack.navBD is defined and stack.navBD is not empty %}
{{ stack.navBD }}
{% else %}
-
{% endif %}
</td>
</tr>
</table>
</td>
{% include 'content/structure/tableauTd.html.twig' with {'foo': 'data-label="Zones"'} %}
<ul>
{% for zone in stack.zones %}
<li>{{ zone.nom }} - {{ zone.destination }}</li>
{% endfor %}
</ul>
</td>
{% include 'content/structure/tableauTd.html.twig' with {'foo': 'data-label="timer"'} %}
<ul>
{% for timer in stack.timers %}
<li>{{ timer.nom }} ({{ timer.duree }}) </li>
{% endfor %}
</ul>
</td>
{% endif %}
</tr>
{% endfor %}
{% else %}
<tr>
<td colspan="9">Pas de Card.</td>
</tr>
{% endif %}
</tbody>
</table>
</div>
<div class="row">
</div>