templates/default/hotel_menu.html.twig line 1

Open in your IDE?
  1. {% if hotels|length > 1 %}
  2.     <li class="menu single-menu {% if 'admin_booking_list' in route %}active{% endif %}">
  3.         <a href="{{ path('admin_booking_list') }}" >
  4.             <div class="">
  5.                 <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-list"><line x1="8" y1="6" x2="21" y2="6"/><line x1="8" y1="12" x2="21" y2="12"/><line x1="8" y1="18" x2="21" y2="18"/><line x1="3" y1="6" x2="3.01" y2="6"/><line x1="3" y1="12" x2="3.01" y2="12"/><line x1="3" y1="18" x2="3.01" y2="18"/></svg>
  6.                 <span>Réservations</span>
  7.             </div>
  8.         </a>
  9.     </li>
  10.             
  11.     <li class="menu single-menu {% if 'admin_hotel' in route %}active{% endif %}" data-controller="admin">
  12.         <a href="#hotel" data-toggle="collapse" aria-expanded="true" class="dropdown-toggle">
  13.             <div class="">
  14.                 <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-briefcase"><rect x="2" y="7" width="20" height="14" rx="2" ry="2"/><path d="M16 21V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16"/></svg>
  15.                 <span>Mes établissements</span>
  16.             </div>
  17.             <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-down"><polyline points="6 9 12 15 18 9"></polyline></svg>
  18.         </a>
  19.         <ul class="submenu list-unstyled collapse" id="hotel" data-parent="#topAccordion" style="">
  20.             <li>
  21.                 <div class="search-dropdown">
  22.                     <input type="text" class="form-control" placeholder="Search" data-action="admin#search">
  23.                 </div>
  24.             </li>
  25.             {% if is_granted('ROLE_ADMIN') %}
  26.                 <li {% if 'admin_hotel_add' in route %}class="active"{% endif %}>
  27.                     <a href="{{ path('admin_hotel_add') }}"> Ajouter un établissement </a>
  28.                 </li>
  29.             {% endif %}
  30.             {% for hotel in hotels %}
  31.                 <li {% if 'admin_hotel' in route and 'admin_hotel_add' not in route %}class="active"{% endif %}>
  32.                     <a href="{{ path('admin_hotel_show', { 'id' : hotel.id }) }}" data-admin-target="href"> {{ hotel.name|title }} </a>
  33.                 </li>
  34.             {% endfor %}
  35.         </ul>
  36.     </li>
  37. {% elseif hotels|length == 1 %}
  38.     <li class="menu single-menu {% if 'admin_booking_list' in route %}active{% endif %}">
  39.         <a href="{{ path('admin_booking_list') }}" >
  40.             <div class="">
  41.                 <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-list"><line x1="8" y1="6" x2="21" y2="6"/><line x1="8" y1="12" x2="21" y2="12"/><line x1="8" y1="18" x2="21" y2="18"/><line x1="3" y1="6" x2="3.01" y2="6"/><line x1="3" y1="12" x2="3.01" y2="12"/><line x1="3" y1="18" x2="3.01" y2="18"/></svg>
  42.                 <span>Réservations</span>
  43.             </div>
  44.         </a>
  45.     </li>
  46.             
  47.     {% if is_granted('ROLE_ADMIN') %}
  48.         <li class="menu single-menu {% if 'admin_hotel' in route %}active{% endif %}" data-controller="admin">
  49.             <a href="#hotel" data-toggle="collapse" aria-expanded="true" class="dropdown-toggle">
  50.                 <div class="">
  51.                     <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-briefcase"><rect x="2" y="7" width="20" height="14" rx="2" ry="2"/><path d="M16 21V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16"/></svg>
  52.                     <span>Mes établissements</span>
  53.                 </div>
  54.                 <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-down"><polyline points="6 9 12 15 18 9"></polyline></svg>
  55.             </a>
  56.             <ul class="submenu list-unstyled collapse" id="hotel" data-parent="#topAccordion" style="">
  57.                 <li>
  58.                     <div class="search-dropdown">
  59.                         <input type="text" class="form-control" placeholder="Search" data-action="admin#search">
  60.                     </div>
  61.                 </li>
  62.                 {% if is_granted('ROLE_ADMIN') %}
  63.                     <li {% if 'admin_hotel_add' in route %}class="active"{% endif %}>
  64.                         <a href="{{ path('admin_hotel_add') }}"> Ajouter un établissement </a>
  65.                     </li>
  66.                 {% endif %}
  67.                 {% for hotel in hotels %}
  68.                     <li {% if 'admin_hotel' in route and 'admin_hotel_add' not in route %}class="active"{% endif %}>
  69.                         <a href="{{ path('admin_hotel_show', { 'id' : hotel.id }) }}" data-admin-target="href"> {{ hotel.name|title }} </a>
  70.                     </li>
  71.                 {% endfor %}
  72.             </ul>
  73.         </li>
  74.     {% else %}
  75.         <li class="menu single-menu {% if 'admin_hotel' in route %}active{% endif %}">
  76.             <a href="{{ path('admin_hotel_show', { 'id' : hotels[0].id }) }}" >
  77.                 <div class="">
  78.                     <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-briefcase"><rect x="2" y="7" width="20" height="14" rx="2" ry="2"/><path d="M16 21V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16"/></svg>
  79.                     <span>{{ hotels[0].name }}</span>
  80.                 </div>
  81.             </a>
  82.         </li>
  83.     {% endif %}
  84. {% elseif is_granted('ROLE_ADMIN') %}
  85.     <li class="menu single-menu {% if 'admin_booking_list' in route %}active{% endif %}">
  86.         <a href="{{ path('admin_booking_list') }}" >
  87.             <div class="">
  88.                 <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-list"><line x1="8" y1="6" x2="21" y2="6"/><line x1="8" y1="12" x2="21" y2="12"/><line x1="8" y1="18" x2="21" y2="18"/><line x1="3" y1="6" x2="3.01" y2="6"/><line x1="3" y1="12" x2="3.01" y2="12"/><line x1="3" y1="18" x2="3.01" y2="18"/></svg>
  89.                 <span>Réservations</span>
  90.             </div>
  91.         </a>
  92.     </li>
  93.             
  94.     <li class="menu single-menu {% if 'admin_hotel_add' in route %}active{% endif %}">
  95.         <a href="{{ path('admin_hotel_add') }}" >
  96.             <div class="">
  97.                 <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-briefcase"><rect x="2" y="7" width="20" height="14" rx="2" ry="2"/><path d="M16 21V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16"/></svg>
  98.                 <span>Ajouter un établissement</span>
  99.             </div>
  100.         </a>
  101.     </li>
  102. {% endif %}