templates/content/structure/tableauTd.html.twig line 1

Open in your IDE?
  1. {# si l'utilisateur est logguĂ© #}
  2. {% if app.user is not null %}
  3.   {% set monR = 0 %}
  4.   {# recupere ses ROLES #}
  5.   {% for role in app.user.roles  %}
  6.     {% if role == "ROLE_ADMIN" %}
  7.       {% set monR = monR + 3 %}
  8.     {% else %}
  9.       {% set monR = monR + 1 %}
  10.     {% endif %}
  11.   {% endfor %}
  12. {# sinon c'est un simple visiteur #}
  13. {% else %}
  14.   {% set monR = 0 %}
  15. {% endif %}
  16. {# si l'utilisateur est visiteur ou membre #}
  17. {% if monR < 2 %}
  18.   <td {{ foo }}>
  19. {# sinon met la couleur #}
  20. {% elseif monR > 2 %}
  21.   {% if stack.status is defined and stack.status is not null %}
  22.     {% if stack.status == 1 %}
  23.       <td style="background-color: green" {{ foo }}>
  24.     {% elseif stack.status == 2 %}
  25.       <td style="background-color: crimson" {{ foo }}>
  26.     {% elseif stack.status == 3 %}
  27.       <td style="background-color: orange" {{ foo }}>
  28.     {% elseif stack.status == 4 %}
  29.       <td style="background-color: lightskyblue" {{ foo }}>
  30.     {% elseif stack.status == 5 %}
  31.       <td style="background-color: yellow" {{ foo }}>
  32.     {% elseif stack.status == 6 %}
  33.       <td style="background-color: mediumpurple" {{ foo }}>
  34.     {% elseif stack.status == 7 %}
  35.       <td style="background-color: grey" {{ foo }}>
  36.     {% else %}
  37.       <td style="background-color: white" {{ foo }}>
  38.     {% endif %}
  39.   {% else %}
  40.     <td {{ foo }}>
  41.   {% endif %}
  42. {% endif %}