<!DOCTYPE html>
<html lang="fr">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="assests/css/style.css">
    <!-- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-sRIl4kxILFvY47J16cr9ZwB07vP4J8+LH7qKQnuqkuIAvNWLzeN8tE5YBujZqJLB" crossorigin="anonymous">
    <script src="https://use.fontawesome.com/releases/v6.3.0/js/all.js" crossorigin="anonymous"></script>
    <title>Folliow{block name="title"}{/block}</title>
</head>
<body class="d-flex flex-column min-vh-100">
    <nav class="navbar navbar-expand-lg navbar-light">
        <div class="container-fluid">
            {* Logo *}
            <a class="navbar-brand d-flex align-items-center" href="index.php">
                <img src="assests/img/logo.png" alt="Logo" class="logo-image">
            </a>
            
            {* Toggler pour mobile *}
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
                <span class="navbar-toggler-icon"></span>
            </button>
            
            {* Menu de navigation *}
            <div class="collapse navbar-collapse" id="navbarNav">
                <ul class="navbar-nav me-auto">
                   
                    <li class="nav-item">
                        <a class="nav-link" href="?ctrl=project&action=about">À propos</a>
                    </li>

                    <li class="nav-item">
                        <a class="nav-link" href="?ctrl=project&action=search">Rechercher</a>
                    </li>
                    {if isset($smarty.session.user)}
                        <li class="nav-item">
                            <a class="nav-link" href="?ctrl=project&action=addedit_project">Ajouter un projet</a>
                        </li>
                        {if $smarty.session.user.authorisation_name == "Administrateur"}
                            <li class="nav-item">
                                <a class="nav-link" href="?ctrl=admin&action=admin">Admin</a>
                            </li>
                        {/if}
                    {/if}
                </ul>
                
                {* Menu secondaire *}
                <nav class="col-4 d-flex justify-content-end align-items-center" aria-label="Connexion utilisateur">
                    {if !isset($smarty.session.user)}
                        {* Utilisateur non connecté *}
                        <ul class="navbar-nav">    
                            <li class="nav-item">
                                <a class="nav-link" href="index.php?ctrl=user&action=signup" title="Créer un compte" aria-label="Créer un compte">
                                    S'inscrire
                                </a>
                            </li>
                            <li class="nav-item">    
                                <a class="nav-link" href="index.php?ctrl=user&action=login" title="Se connecter" aria-label="Se connecter">
                                    Se connecter 
                                </a>
                            </li>
                        </ul> 
                    {else}
                        {* Utilisateur connecté *}
                        <ul class="navbar-nav">   
                            <li class="nav-item"> 
                                <a class="nav-link" href="index.php?ctrl=user&action=user&pseudo={$smarty.session.user.user_pseudo}" title="Modifier mon compte" aria-label="Modifier mon compte">
                                    <img src="{$smarty.env.IMG_USER_PATH}{$smarty.session.user.user_image ?? "images.jpg"}"
                                        class="rounded-circle flex-shrink-0 mt-2 ml-5"
                                        style="width: 36px; height: 36px; object-fit: cover;"
                                        alt="Photo de profil">
                                </a>
                            </li>

                            <li> 
                                <a class="nav-link" href="index.php?ctrl=user&action=logout" title="Se déconnecter" aria-label="Se déconnecter">
                                    Se déconnecter
                                </a>
                            </li>
                        </ul>
                    {/if}
                </nav>
            </div>
        </div>
    </nav>
	
	<main id="main-content" class="container my-4">
	  <section
		class="p-4 mb-4 text-center txt_title "
		aria-labelledby="page-title"
	  >
		<div class="col-lg-8 mx-auto">
		  <h2 id="page-title" class="display-5 fw-semibold mb-3">
			{block name="h2"}{/block}
		  </h2>
		  <p class="lead mb-2">
			{block name="p"}{/block}
		  </p>
		  <p class="text-muted small mb-0">
			{block name="date_maj"}{/block}
		  </p>
		</div>
	  </section>
	</main>

</body>
    {include file="views/_partial/messages.tpl"}
