<!doctype html>
<html lang="fr">
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<title>
			{% block title %}Share -
			{% endblock %}
		</title>
		{% block stylesheets %}
			<link href="https://bootswatch.com/5/lumen/bootstrap.min.css" rel="stylesheet">
			<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css">
		{% endblock %}
	</head>
	<body>
		<nav class="navbar navbar-expand-lg bg-light" data-bs-theme="light">
			<div class="container-fluid">
				<a class="navbar-brand" href="{{path('app_accueil')}}">Share</a>
				<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bstarget="#navbarColor03" aria-controls="navbarColor03" aria-expanded="false" arialabel="Toggle navigation">
					<span class="navbar-toggler-icon"></span>
				</button>
				<div class="collapse navbar-collapse" id="navbarColor03">
					<ul class="navbar-nav me-auto">
						<li class="nav-item">
							<a class="nav-link active" href="{{path('app_accueil')}}">Home
								<span class="visually-hidden">(current)</span>
							</a>
						</li>
						<li class="nav-item">
							<a class="nav-link active" href="{{path('app_contact')}}">Contact
								<span class="visually-hidden">(current)</span>
							</a>
						</li>
						{% if is_granted('ROLE_ADMIN') or is_granted('ROLE_MOD')%}
							<li class="nav-item">
								<a class="nav-link active" href="{{path('app_liste_contacts')}}">Liste des contacts</a>
							</li>
						{% endif %}

						<li class="nav-item">
							<a class="nav-link active" href="{{path('app_propos')}}">A propos
								<span class="visually-hidden">(current)</span>
							</a>
						</li>
						<li class="nav-item">
							<a class="nav-link active" href="{{path('app_mention')}}">Mention
								<span class="visually-hidden">(current)</span>
							</a>
						</li>
						<li class="nav-item dropdown">
							<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-haspopup="true" ariaexpanded="false">Catégorie</a>
							<div class="dropdown-menu">
								<a class="dropdown-item" href="{{path('app_categorie')}}">Ajout</a>
								<a class="dropdown-item" href="{{path('app_liste_categories')}}">Liste</a>
							</div>
						</li>
						<li class="nav-item dropdown">
							<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-haspopup="true" ariaexpanded="false">Connexion</a>
							<div class="dropdown-menu">
								<a class="dropdown-item" href="{{path('app_login')}}">Login</a>
								<a class="dropdown-item" href="{{path('app_register')}}">Register</a>
							</div>
						</li>
						{% if is_granted('ROLE_ADMIN')%}
						<li class="nav-item dropdown">
							<a class="nav-link dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">Admin</a>
							<div class="dropdown-menu">
								<a class="dropdown-item" href="{{path('app_liste_users')}}">Liste des Users</a>
								<a class="dropdown-item" href="#">Something else here</a>
								<div class="dropdown-divider"></div>
								<a class="dropdown-item" href="#">Separated link</a>
							</div>
						</li>
						{% endif %}
					</ul>
					<form class="d-flex">
						<input class="form-control me-sm-2" type="search" placeholder="Search">
						<button class="btn btn-secondary my-2 my-sm-0" type="submit">Search</button>
					</form>
					<ul class="navbar-nav me-auto">
						{% if not is_granted('IS_AUTHENTICATED_FULLY') %}
							<li class="nav-item">
								<a class="nav-link" href="{{path('app_login')}}">Se connecter
								</a>
							</li>
							<li class="nav-item">
								<a class="nav-link" href="{{path('app_register')}}">S'inscrire
								</a>
							</li>
						{% else %}
							<a class="nav-link" href="{{path('app_profil')}}">
									{{app.user.email}}
									<i class="bi bi-person-circle"></i>
									</a>
									<a class="nav-link" href="{{path('app_logout')}}">
									<i class="bi-x-circle-fill"></i>
								</a>
							</li>
						{% endif %}
					</ul>
				</div>
			</div>
		</nav>
		{% for message in app.flashes('notice') %}
			<h2 class="alert alert-warning text-center mt-4 mb-4" role="alert">
				{{ message }}
			</h2>
		{% endfor %}
		{% block body %}Share
		{% endblock %}

		{% block javascripts %}
			<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
		{% endblock %}
	</body>
</html>
