{% if hotels|length > 1 %}
<li class="menu single-menu {% if 'admin_booking_list' in route %}active{% endif %}">
<a href="{{ path('admin_booking_list') }}" >
<div class="">
<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>
<span>Réservations</span>
</div>
</a>
</li>
<li class="menu single-menu {% if 'admin_hotel' in route %}active{% endif %}" data-controller="admin">
<a href="#hotel" data-toggle="collapse" aria-expanded="true" class="dropdown-toggle">
<div class="">
<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>
<span>Mes établissements</span>
</div>
<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>
</a>
<ul class="submenu list-unstyled collapse" id="hotel" data-parent="#topAccordion" style="">
<li>
<div class="search-dropdown">
<input type="text" class="form-control" placeholder="Search" data-action="admin#search">
</div>
</li>
{% if is_granted('ROLE_ADMIN') %}
<li {% if 'admin_hotel_add' in route %}class="active"{% endif %}>
<a href="{{ path('admin_hotel_add') }}"> Ajouter un établissement </a>
</li>
{% endif %}
{% for hotel in hotels %}
<li {% if 'admin_hotel' in route and 'admin_hotel_add' not in route %}class="active"{% endif %}>
<a href="{{ path('admin_hotel_show', { 'id' : hotel.id }) }}" data-admin-target="href"> {{ hotel.name|title }} </a>
</li>
{% endfor %}
</ul>
</li>
{% elseif hotels|length == 1 %}
<li class="menu single-menu {% if 'admin_booking_list' in route %}active{% endif %}">
<a href="{{ path('admin_booking_list') }}" >
<div class="">
<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>
<span>Réservations</span>
</div>
</a>
</li>
{% if is_granted('ROLE_ADMIN') %}
<li class="menu single-menu {% if 'admin_hotel' in route %}active{% endif %}" data-controller="admin">
<a href="#hotel" data-toggle="collapse" aria-expanded="true" class="dropdown-toggle">
<div class="">
<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>
<span>Mes établissements</span>
</div>
<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>
</a>
<ul class="submenu list-unstyled collapse" id="hotel" data-parent="#topAccordion" style="">
<li>
<div class="search-dropdown">
<input type="text" class="form-control" placeholder="Search" data-action="admin#search">
</div>
</li>
{% if is_granted('ROLE_ADMIN') %}
<li {% if 'admin_hotel_add' in route %}class="active"{% endif %}>
<a href="{{ path('admin_hotel_add') }}"> Ajouter un établissement </a>
</li>
{% endif %}
{% for hotel in hotels %}
<li {% if 'admin_hotel' in route and 'admin_hotel_add' not in route %}class="active"{% endif %}>
<a href="{{ path('admin_hotel_show', { 'id' : hotel.id }) }}" data-admin-target="href"> {{ hotel.name|title }} </a>
</li>
{% endfor %}
</ul>
</li>
{% else %}
<li class="menu single-menu {% if 'admin_hotel' in route %}active{% endif %}">
<a href="{{ path('admin_hotel_show', { 'id' : hotels[0].id }) }}" >
<div class="">
<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>
<span>{{ hotels[0].name }}</span>
</div>
</a>
</li>
{% endif %}
{% elseif is_granted('ROLE_ADMIN') %}
<li class="menu single-menu {% if 'admin_booking_list' in route %}active{% endif %}">
<a href="{{ path('admin_booking_list') }}" >
<div class="">
<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>
<span>Réservations</span>
</div>
</a>
</li>
<li class="menu single-menu {% if 'admin_hotel_add' in route %}active{% endif %}">
<a href="{{ path('admin_hotel_add') }}" >
<div class="">
<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>
<span>Ajouter un établissement</span>
</div>
</a>
</li>
{% endif %}