{% import "components/macros.html.twig" as macros %}
<nav class="navbar navbar-expand-sm navbar-light bg-custom border-bottom gap-2">
<a class="navbar-brand font-weight-bold" href="{{ path('homePage') }}"><img src="{{ asset('build/images/RappBattleLogoAlpha.png') }}" alt="Logo"/></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarColor" aria-controls="navbarColor" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarColor">
<ul class="navbar-nav">
<li class="nav-item"><a class="nav-link" href="{{ path('battles') }}">Battles</a> </li>
<li class="nav-item"><a class="nav-link" href="{{ path('beats') }}">Beats</a> </li>
<li class="nav-item"><a class="nav-link" href="{{ path('rappers') }}">Rappers</a> </li>
<li class="nav-item"><a class="nav-link" href="{{ path('crews') }}">Crews</a> </li>
<li class="nav-item"><a class="nav-link" href="{{ path('leaderboard') }}">Leaderboard</a> </li>
<li class="nav-item"><a class="nav-link" href="{{ path('downloads') }}">Downloads</a> </li>
<li class="nav-item "><a class="nav-link" href="{{ path('about') }}">About</a> </li>
<li class="nav-item "><a class="nav-link" href="{{ path('faq') }}">FAQ</a> </li>
</ul>
</div>
{% if app.user %}
<div class="dropdown">
<a class="btn btn-primary dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
<i class="bi bi-bell"></i>
</a>
<div class="dropdown-menu dropdown-menu-end notifications-nav">
<div class="row">
<div class="notifications-list--small">
{% if userData.userNotificationsHomepage|length > 0 %}
<div class="messages-list">
{% for notification in userData.userNotificationsHomepage %}
{{ macros.renderNotificationListItemSmall(notification,true) }}
{% endfor %}
</div>
{% else %}
<p class="text-center">No notifications</p>
{% endif %}
</div>
</div>
<div class="row dropdown-footer">
<a href="{{ path('notifications') }}" class="text-center"><i class="bi bi-bell-fill"></i> See all notifications</a>
</div>
</div>
</div>
<div class="dropdown">
<a class="btn btn-primary dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
<i class="bi bi-envelope"></i>
</a>
<div class="dropdown-menu dropdown-menu-end messages-nav">
<div class="row">
<div class="messages-list--small">
{% if userData.userMessagesHomepage|length > 0 %}
<div class="messages-list">
{% for message in userData.userMessagesHomepage %}
{{ macros.renderMessageListItemSmall(message,true) }}
{% endfor %}
</div>
{% else %}
<p class="text-center">No messages</p>
{% endif %}
</div>
</div>
<div class="row dropdown-footer">
<a href="{{ path('messages') }}" class="text-center"><i class="bi bi-envelope-fill"></i> See all messages</a>
</div>
</div>
</div>
{% endif %}
<div class="dropdown pr-50">
<a class="btn btn-primary dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
<i class="bi bi-person"></i>
</a>
<ul class="dropdown-menu dropdown-menu-end">
{% if app.user %}
<li><a href="{{ path('profile') }}" class="dropdown-item" type="button">Profile</a></li>
<li><a href="{{ path('messages') }}" class="dropdown-item" type="button">Messages ({{ userData.userNewMessages|length }})</a></li>
<li><a href="{{ path('notifications') }}" class="dropdown-item" type="button">Notifications ({{ userData.userNewNotifications|length }})</a></li>
<li><a href="{{ path('settings') }}" class="dropdown-item" type="button">Settings</a></li>
<li><a href="{{ path('app_logout') }}" class="dropdown-item" type="button">Logout</a></li>
{% else %}
<li><a href="{{ path('login') }}" class="dropdown-item" type="button">Login</a></li>
<li><a href="{{ path('register') }}" class="dropdown-item" type="button">Register</a></li>
{% endif %}
</ul>
</div>
</nav>