templates/nav.html.twig line 5

Open in your IDE?
  1. {% set placeid2 = app.session.get('place') %}
  2.         
  3. {% block body %}
  4.     
  5. {% set cartitems = app.session.get('cartitems') %}
  6. {% if cartitems is not defined or cartitems == ""  %}
  7.     {% set cartitems = 0 %}
  8. {% endif %}
  9. {% set cartitems = '(' ~ cartitems ~ ')' %}
  10. {% if app.user %}
  11.     
  12.         <div class="navbar navbar-expand-lg bg-dark navbar-dark">
  13.             <div class="container-fluid">
  14.                 {% set placeid2 = app.session.get('place') %}
  15.                 {% if placeid2 is defined and placeid2 != ""  %}
  16.                         <a href="{{ path('homepage2',{placeid: placeid2}) }}">
  17.                         {% if company == 'KVO' %}
  18.                             <!--
  19.                             <h2>Wellness und Spa</h2>
  20.                             -->
  21.                             <img src="{{ asset('./images/kvo_logo3.png') }}" width="80px" height="80px" style="margin-top: -20px" />
  22.                         {% else %}
  23.                             {% if placeid2 == '2' %}
  24.                                 <h2 class="navItem">Kursprogramm Friedrichsbad</h2>
  25.                             {% elseif placeid2 == '3' %}
  26.                                 <h2 class="navItem">Kursprogramm Nienhausen</h2>
  27.                             {% elseif placeid2 == '4' %}
  28.                                 <h2 class="navItem">Kursprogramm Nord-Ost-Bad</h2>
  29.                             {% elseif placeid2 == '5' %}
  30.                                 <h2 class="navItem">Kursprogramm Jugendhalle</h2>
  31.                             {% elseif placeid2 == '6' %}
  32.                                 <h2 class="navItem">Kursprogramm Yogazentrum</h2>
  33.                             {% else %}
  34.                                 <h2 class="navItem">Kursprogramm</h2>
  35.                             {% endif %}
  36.                         {% endif %}
  37.                          <span></span></a>
  38.                 {% else %}
  39.                         <a href="{{ path('homepage') }}">
  40.                         {% if company == 'KVO' %}
  41.                             <!--
  42.                             <h2>Wellness und Spa</h2>
  43.                             -->
  44.                             <img src="{{ asset('./images/kvo_logo3.png') }}" width="80px" height="80px" style="margin-top: -20px" />
  45.                         {% else %}
  46.                             {% if placeid2 == '2' %}
  47.                                 <h2 class="navItem">Kursprogramm Friedrichsbad</h2>
  48.                             {% elseif placeid2 == '3' %}
  49.                                 <h2 class="navItem">Kursprogramm Nienhausen</h2>
  50.                             {% elseif placeid2 == '4' %}
  51.                                 <h2 class="navItem">Kursprogramm Nord-Ost-Bad</h2>
  52.                             {% elseif placeid2 == '5' %}
  53.                                 <h2 class="navItem">Kursprogramm Jugendhalle</h2>
  54.                             {% elseif placeid2 == '6' %}
  55.                                 <h2 class="navItem">Kursprogramm Yogazentrum</h2>
  56.                             {% else %}
  57.                                 <h2 class="navItem">Kursprogramm</h2>
  58.                             {% endif %}
  59.                         {% endif %}
  60.                         
  61.                          </a>
  62.                     {% endif %}
  63.                 <button type="button" class="navbar-toggler" data-toggle="collapse" data-target="#navbarCollapse">
  64.                     <span class="navbar-toggler-icon"></span>
  65.                 </button>
  66.                 <div class="collapse navbar-collapse justify-content-between" id="navbarCollapse" >
  67.                     <div class="navbar-nav ml-auto">
  68.         {% if placeid2 is defined and placeid2 != ""  %}
  69.             <a href="{{ path('homepage2',{placeid: placeid2}) }}" class="navItem" > 
  70.             <svg xmlns="http://www.w3.org/2000/svg" width="{{ defaultSVGWidth }}" height="{{ defaultSVGHeight }}" fill="currentColor" class="navItem bi bi-house" viewBox="0 0 16 16">
  71.             <path fill-rule="evenodd" d="M2 13.5V7h1v6.5a.5.5 0 0 0 .5.5h9a.5.5 0 0 0 .5-.5V7h1v6.5a1.5 1.5 0 0 1-1.5 1.5h-9A1.5 1.5 0 0 1 2 13.5zm11-11V6l-2-2V2.5a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5z"/>
  72.             <path fill-rule="evenodd" d="M7.293 1.5a1 1 0 0 1 1.414 0l6.647 6.646a.5.5 0 0 1-.708.708L8 2.207 1.354 8.854a.5.5 0 1 1-.708-.708L7.293 1.5z"/>
  73.             </svg> Home</a>
  74.         {% else %}
  75.             <a href="{{ path('homepage') }}" class="navItem" > 
  76.             <svg xmlns="http://www.w3.org/2000/svg" width="{{ defaultSVGWidth }}" height="{{ defaultSVGHeight }}" fill="currentColor" class="navItem bi bi-house" viewBox="0 0 16 16">
  77.             <path fill-rule="evenodd" d="M2 13.5V7h1v6.5a.5.5 0 0 0 .5.5h9a.5.5 0 0 0 .5-.5V7h1v6.5a1.5 1.5 0 0 1-1.5 1.5h-9A1.5 1.5 0 0 1 2 13.5zm11-11V6l-2-2V2.5a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5z"/>
  78.             <path fill-rule="evenodd" d="M7.293 1.5a1 1 0 0 1 1.414 0l6.647 6.646a.5.5 0 0 1-.708.708L8 2.207 1.354 8.854a.5.5 0 1 1-.708-.708L7.293 1.5z"/>
  79.             </svg> Home</a>    
  80.         {% endif %}
  81.         {% if company == 'KVO' %}
  82. &nbsp; &nbsp; &nbsp;
  83.         <a href="{{ path('zusatzinfo') }}" class="navItem" ><svg xmlns="http://www.w3.org/2000/svg" width="{{ defaultSVGWidth }}" height="{{ defaultSVGHeight }}" fill="currentColor" class="navItem bi bi-info-circle" viewBox="0 0 16 16">
  84.         <path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"/>
  85.         <path d="m8.93 6.588-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533L8.93 6.588zM9 4.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"/>
  86.         </svg>   Info</a>
  87.         {% endif %}
  88. &nbsp; &nbsp; &nbsp;
  89.         {% if app.user.urole >= 2 %}
  90.         <a href="{{ path('backendDashboard') }}" class="navItem" > 
  91.         <svg xmlns="http://www.w3.org/2000/svg" width="{{ defaultSVGWidth }}" height="{{ defaultSVGHeight }}" fill="currentColor" class="navItem bi bi-archive" viewBox="0 0 16 16">
  92.         <path d="M0 2a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1v7.5a2.5 2.5 0 0 1-2.5 2.5h-9A2.5 2.5 0 0 1 1 12.5V5a1 1 0 0 1-1-1V2zm2 3v7.5A1.5 1.5 0 0 0 3.5 14h9a1.5 1.5 0 0 0 1.5-1.5V5H2zm13-3H1v2h14V2zM5 7.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1-.5-.5z"/>
  93.         </svg>  Backend</a>
  94.         {% endif %}
  95.         &nbsp; &nbsp; &nbsp;
  96.         
  97.         <a href="{{ path('cart') }}" class="navItem" > 
  98.         <svg xmlns="http://www.w3.org/2000/svg" width="{{ defaultSVGWidth }}" height="{{ defaultSVGHeight }}" fill="currentColor" class="navItem bi bi-cart4" viewBox="0 0 16 16">
  99.         <path d="M0 2.5A.5.5 0 0 1 .5 2H2a.5.5 0 0 1 .485.379L2.89 4H14.5a.5.5 0 0 1 .485.621l-1.5 6A.5.5 0 0 1 13 11H4a.5.5 0 0 1-.485-.379L1.61 3H.5a.5.5 0 0 1-.5-.5zM3.14 5l.5 2H5V5H3.14zM6 5v2h2V5H6zm3 0v2h2V5H9zm3 0v2h1.36l.5-2H12zm1.11 3H12v2h.61l.5-2zM11 8H9v2h2V8zM8 8H6v2h2V8zM5 8H3.89l.5 2H5V8zm0 5a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm-2 1a2 2 0 1 1 4 0 2 2 0 0 1-4 0zm9-1a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm-2 1a2 2 0 1 1 4 0 2 2 0 0 1-4 0z"/>
  100.         </svg> Warenkorb {{ cartitems }}
  101.         </a>
  102.         &nbsp; &nbsp; &nbsp;
  103.         
  104.         <a href="{{ path('userSettings') }}" class="navItem" > 
  105.         <svg xmlns="http://www.w3.org/2000/svg" width="{{ defaultSVGWidth }}" height="{{ defaultSVGHeight }}" fill="currentColor" class="navItem bi bi-person" viewBox="0 0 16 16">
  106.         <path d="M8 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm2-3a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm4 8c0 1-1 1-1 1H3s-1 0-1-1 1-4 6-4 6 3 6 4zm-1-.004c-.001-.246-.154-.986-.832-1.664C11.516 10.68 10.289 10 8 10c-2.29 0-3.516.68-4.168 1.332-.678.678-.83 1.418-.832 1.664h10z"/>
  107.         </svg>  {{ app.user.username }}</a>
  108.         &nbsp; &nbsp; &nbsp;
  109.         
  110.         
  111.         <a href="{{ path('userHistory',{start: 0, offset: 25}) }}" class="navItem" > 
  112.         <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-journal-bookmark" viewBox="0 0 16 16">
  113.         <path fill-rule="evenodd" d="M6 8V1h1v6.117L8.743 6.07a.5.5 0 0 1 .514 0L11 7.117V1h1v7a.5.5 0 0 1-.757.429L9 7.083 6.757 8.43A.5.5 0 0 1 6 8z"/>
  114.         <path d="M3 0h10a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2v-1h1v1a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1H3a1 1 0 0 0-1 1v1H1V2a2 2 0 0 1 2-2z"/>
  115.         <path d="M1 5v-.5a.5.5 0 0 1 1 0V5h.5a.5.5 0 0 1 0 1h-2a.5.5 0 0 1 0-1H1zm0 3v-.5a.5.5 0 0 1 1 0V8h.5a.5.5 0 0 1 0 1h-2a.5.5 0 0 1 0-1H1zm0 3v-.5a.5.5 0 0 1 1 0v.5h.5a.5.5 0 0 1 0 1h-2a.5.5 0 0 1 0-1H1z"/>
  116.         </svg>  Historie</a>
  117.         &nbsp; &nbsp; &nbsp;
  118.         
  119.         <!--<a class="navItem" href="{{ path('logout2') }}">-->
  120.         <a class="navItem" href="javascript:logout();">
  121.         <svg xmlns="http://www.w3.org/2000/svg" width="{{ defaultSVGWidth }}" height="{{ defaultSVGHeight }}" fill="currentColor" class="navItem bi bi-door-closed" viewBox="0 0 16 16" >
  122.         <path d="M3 2a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v13h1.5a.5.5 0 0 1 0 1h-13a.5.5 0 0 1 0-1H3V2zm1 13h8V2H4v13z"/>
  123.         <path d="M9 9a1 1 0 1 0 2 0 1 1 0 0 0-2 0z"/>
  124.         </svg>  Logout</a>
  125.     </div>
  126.     </div>
  127.     </div>
  128.     </div>
  129.     
  130.     {% else %}
  131.         <div class="navbar navbar-expand-lg bg-dark navbar-dark">
  132.             <div class="container-fluid">
  133.  {% set placeid2 = app.session.get('place') %}
  134.                 {% if placeid2 is defined and placeid2 != ""  %}
  135.                         <a href="{{ path('homepage2',{placeid: placeid2}) }}">
  136.                         {% if company == 'KVO' %}
  137.                             <!--
  138.                             <h2>Wellness und Spa</h2>
  139.                             -->
  140.                             <img src="{{ asset('./images/kvo_logo3.png') }}" width="80px" height="80px" style="margin-top: -20px" />
  141.                         {% else %}
  142.                             {% if placeid2 == '2' %}
  143.                                 <h2>Kursprogramm Friedrichsbad</h2>
  144.                             {% elseif placeid2 == '3' %}
  145.                                 <h2>Kursprogramm Nienhausen</h2>
  146.                             {% elseif placeid2 == '4' %}
  147.                                 <h2>Kursprogramm Nord-Ost-Bad</h2>
  148.                             {% elseif placeid2 == '5' %}
  149.                                 <h2>Kursprogramm Jugendhalle</h2>
  150.                             {% elseif placeid2 == '6' %}
  151.                                 <h2>Kursprogramm Yogazentrum</h2>
  152.                             {% else %}
  153.                                 <h2>Kursprogramm</h2>
  154.                             {% endif %}
  155.                         {% endif %}
  156.                          <span></span></a>
  157.                 {% else %}
  158.                         <a href="{{ path('homepage') }}">
  159.                         {% if company == 'KVO' %}
  160.                             <!--
  161.                             <h2>Wellness und Spa</h2>
  162.                             -->
  163.                             <img src="{{ asset('./images/kvo_logo3.png') }}" width="80px" height="80px" style="margin-top: -20px" />
  164.                         {% else %}
  165.                             {% if placeid2 == '2' %}
  166.                                 <h2>Kursprogramm Friedrichsbad</h2>
  167.                             {% elseif placeid2 == '3' %}
  168.                                 <h2>Kursprogramm Nienhausen</h2>
  169.                             {% elseif placeid2 == '4' %}
  170.                                 <h2>Kursprogramm Nord-Ost-Bad</h2>
  171.                             {% elseif placeid2 == '5' %}
  172.                                 <h2>Kursprogramm Jugendhalle</h2>
  173.                             {% elseif placeid2 == '6' %}
  174.                                 <h2>Kursprogramm Yogazentrum</h2>
  175.                             {% else %}
  176.                                 <h2>Kursprogramm</h2>
  177.                             {% endif %}
  178.                         {% endif %}
  179.                         
  180.                         </a>
  181.                     {% endif %}
  182.                     <button type="button" class="navbar-toggler" data-toggle="collapse" data-target="#navbarCollapse">
  183.                     <span class="navbar-toggler-icon"></span>
  184.                 </button>
  185.                 <div class="collapse navbar-collapse justify-content-between" id="navbarCollapse">
  186.                     <div class="navbar-nav ml-auto">
  187.         {% if placeid2 is defined and placeid2 != ""  %}
  188.             <a  href="{{ path('homepage2',{placeid: placeid2}) }}" class="navItem" > 
  189.             <svg  xmlns="http://www.w3.org/2000/svg" width="{{ defaultSVGWidth }}" height="{{ defaultSVGHeight }}" fill="currentColor" class="navItem bi bi-house" viewBox="0 0 16 16">
  190.             <path fill-rule="evenodd" d="M2 13.5V7h1v6.5a.5.5 0 0 0 .5.5h9a.5.5 0 0 0 .5-.5V7h1v6.5a1.5 1.5 0 0 1-1.5 1.5h-9A1.5 1.5 0 0 1 2 13.5zm11-11V6l-2-2V2.5a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5z"/>
  191.             <path fill-rule="evenodd" d="M7.293 1.5a1 1 0 0 1 1.414 0l6.647 6.646a.5.5 0 0 1-.708.708L8 2.207 1.354 8.854a.5.5 0 1 1-.708-.708L7.293 1.5z"/>
  192.             </svg> Home</a>
  193.         {% else %}
  194.             <a href="{{ path('homepage') }}" class="navItem" > 
  195.             <svg xmlns="http://www.w3.org/2000/svg" width="{{ defaultSVGWidth }}" height="{{ defaultSVGHeight }}" fill="currentColor" class="navItem bi bi-house" viewBox="0 0 16 16">
  196.             <path fill-rule="evenodd" d="M2 13.5V7h1v6.5a.5.5 0 0 0 .5.5h9a.5.5 0 0 0 .5-.5V7h1v6.5a1.5 1.5 0 0 1-1.5 1.5h-9A1.5 1.5 0 0 1 2 13.5zm11-11V6l-2-2V2.5a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5z"/>
  197.             <path fill-rule="evenodd" d="M7.293 1.5a1 1 0 0 1 1.414 0l6.647 6.646a.5.5 0 0 1-.708.708L8 2.207 1.354 8.854a.5.5 0 1 1-.708-.708L7.293 1.5z"/>
  198.             </svg> Home</a>    
  199.         {% endif %}
  200.         {% if company == 'KVO' %}
  201.         &nbsp; &nbsp; &nbsp;
  202.         <a href="{{ path('zusatzinfo') }}" class="navItem" ><svg  xmlns="http://www.w3.org/2000/svg" width="{{ defaultSVGWidth }}" height="{{ defaultSVGHeight }}" fill="currentColor" class="navItem bi bi-info-circle" viewBox="0 0 16 16">
  203.         <path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"/>
  204.         <path d="m8.93 6.588-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533L8.93 6.588zM9 4.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"/>
  205.         </svg>Info</a>
  206.         {% endif %}
  207.         &nbsp; &nbsp; &nbsp;
  208.         <a  href="{{ path('cart') }}" class="navItem" > 
  209.         <svg xmlns="http://www.w3.org/2000/svg" width="{{ defaultSVGWidth }}" height="{{ defaultSVGHeight }}" fill="currentColor" class="navItem bi bi-cart4" viewBox="0 0 16 16">
  210.         <path d="M0 2.5A.5.5 0 0 1 .5 2H2a.5.5 0 0 1 .485.379L2.89 4H14.5a.5.5 0 0 1 .485.621l-1.5 6A.5.5 0 0 1 13 11H4a.5.5 0 0 1-.485-.379L1.61 3H.5a.5.5 0 0 1-.5-.5zM3.14 5l.5 2H5V5H3.14zM6 5v2h2V5H6zm3 0v2h2V5H9zm3 0v2h1.36l.5-2H12zm1.11 3H12v2h.61l.5-2zM11 8H9v2h2V8zM8 8H6v2h2V8zM5 8H3.89l.5 2H5V8zm0 5a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm-2 1a2 2 0 1 1 4 0 2 2 0 0 1-4 0zm9-1a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm-2 1a2 2 0 1 1 4 0 2 2 0 0 1-4 0z"/>
  211.         </svg> Warenkorb {{ cartitems }}
  212.         </a>
  213.         &nbsp; &nbsp; &nbsp;
  214.         <a href="{{ path('login') }}" class="navItem" > <i class="navItem bi bi-person"></i> Login</a>
  215.     </div>
  216.     </div>
  217.     </div>
  218.     </div>
  219.     {% endif  %}
  220. <script>
  221. function logout()
  222. {
  223.     url2 = "{{ url }}logout2";   
  224.     $.ajax({
  225.         url: url2,
  226.         data:{
  227.             id: '{% if app.user %}{{ app.user.id }}{% endif %}'
  228.         },
  229.         method: 'POST'
  230.     }).done(function(data) 
  231.     { 
  232.        location.href = "{{url}}logout";
  233.     });
  234. }
  235. </script>
  236. {% endblock %}