{# 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 %}
{# si l'utilisateur est visiteur ou membre #}
{% if monR < 2 %}
<td {{ foo }}>
{# sinon met la couleur #}
{% elseif monR > 2 %}
{% if stack.status is defined and stack.status is not null %}
{% if stack.status == 1 %}
<td style="background-color: green" {{ foo }}>
{% elseif stack.status == 2 %}
<td style="background-color: crimson" {{ foo }}>
{% elseif stack.status == 3 %}
<td style="background-color: orange" {{ foo }}>
{% elseif stack.status == 4 %}
<td style="background-color: lightskyblue" {{ foo }}>
{% elseif stack.status == 5 %}
<td style="background-color: yellow" {{ foo }}>
{% elseif stack.status == 6 %}
<td style="background-color: mediumpurple" {{ foo }}>
{% elseif stack.status == 7 %}
<td style="background-color: grey" {{ foo }}>
{% else %}
<td style="background-color: white" {{ foo }}>
{% endif %}
{% else %}
<td {{ foo }}>
{% endif %}
{% endif %}