templates/content/structure/zonesActives.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. {% if monR > 0 %}
  17.   <!-- navH -->
  18.   {% if stack.navH is defined and stack.navH is not null %}
  19.     <a href="{{ path("webSite_stacks_show", { "id" : stack.navH, 'recherche': recherche}) }}">
  20.       <div id="navH{{ stack.navH }}" class="navH zoneActive text-center" style="opacity:0.8; background-color:red; height:20px;position:absolute; top:0; width:70%; left:15%;">
  21.         {{ stack.navH }}
  22.       </div>
  23.     </a>
  24.   {% endif %}
  25.   <!-- navG -->
  26.   {% if stack.navG is defined and stack.navG is not null %}
  27.     <a href="{{ path("webSite_stacks_show", { "id" : stack.navG, 'recherche': recherche }) }}">
  28.       <div id="navG{{ stack.navG }}" class="navG zoneActive" style="opacity:0.8; background-color:green; width:20px; position: absolute; top:20%; height:60%;">
  29.         {{ stack.navG }}
  30.       </div>
  31.     </a>
  32.   {% endif %}
  33.   <!-- navD -->
  34.   {% if stack.navD is defined and stack.navD is not null %}
  35.     <a href="{{ path("webSite_stacks_show", { "id" : stack.navD, 'recherche': recherche }) }}">
  36.       <div id="navD{{ stack.navD }}" class="navD zoneActive" style="opacity:0.8; background-color:yellow; width:20px; position: absolute; top:20%; height:60%; right:0;">
  37.         {{ stack.navD }}
  38.       </div>
  39.     </a>
  40.   {% endif %}
  41.   <!-- navBG -->
  42.   {% if stack.navBG is defined and stack.navBG is not null %}
  43.     <a href="{{ path("webSite_stacks_show", { "id" : stack.navBG, 'recherche': recherche }) }}">
  44.       <div id="navBG{{ stack.navD }}" class="navBG zoneActive" style="opacity:0.8; background-color:orange; height:20px; position: absolute; bottom:0; width:25%; left:15%;">
  45.         {{ stack.navBG }}
  46.       </div>
  47.     </a>
  48.   {% endif %}
  49.   <!-- navBD -->
  50.   {% if stack.navBD is defined and stack.navBD is not null %}
  51.     <a href="{{ path("webSite_stacks_show", { "id" : stack.navBD, 'recherche': recherche }) }}">
  52.       <div id="navBD{{ stack.navD }}" class="navBD zoneActive" style="opacity:0.8; background-color:lightgreen; height:20px; position: absolute; bottom:0; width:25%; right:15%;">
  53.         {{ stack.navBD }}
  54.       </div>
  55.     </a>
  56.   {% endif %}
  57.   <!-- xxxx -->
  58.   {% if stack.zones is defined and stack.zones is not null and stack.zones is not empty %}
  59.     {% for zone in stack.zones %}
  60.       {% if zone.destination is defined and zone.destination is not null and zone.destination != 0 %}
  61.         <a href="{{ path("webSite_stacks_show", { "id" : zone.destination, 'recherche': recherche }) }}">
  62.       {% else %}
  63.         <a href="{{ path("webSite_stacks_show", { "id" : zone.rollover, 'recherche': recherche }) }}">
  64.       {% endif %}
  65.           <div class="zoneAdd zoneActive" id="zone{{ zone.id }}"
  66.             style="
  67.               position:absolute;
  68.               background-color: pink;
  69.               opacity:0.6;
  70.               left: {{ (zone.x / 900) * 100 }}%;
  71.               top: {{ (zone.y / 675) * 100 }}%;
  72.               width: {{ (zone.largeur / 900) * 100 }}%;
  73.               height: {{ (zone.hauteur / 675) * 100 }}%;
  74.             "
  75.           >
  76.             {% if zone.destination is defined and zone.destination is not null and zone.destination != 0 %}
  77.             {{ zone.destination }}
  78.             {% else %}
  79.             {{ zone.rollover }}
  80.             {% endif %}
  81.           </div>
  82.         </a>
  83.   {% endfor %}
  84.   {% endif %}
  85. {% endif %}