{% import 'Front/Default/macro.html.twig' as m %}

<header class="header" role="banner">
    <div class="website-header">
        <div class="container">
            <div class="row">
                <div class="col-md-8">
                    <a href="{{ path('_welcome') }}" class="website-brand">
                        {{ m.svg({class: 'icon-logo', id:'logo--logo-colorful', title:'Fondation C.génial'}) }}
                    </a>
                    <span class="website-baseline">La science et l’entreprise font école</span>
                </div>
               
                <div class="col-md-4 d-none d-lg-block">
                    <div class="website-menu-connect">
                        {% if app.user is not null and is_granted("IS_AUTHENTICATED_REMEMBERED") %}
                            {% if is_granted("ROLE_ADMIN_ITDLC") or is_granted("ROLE_ADMIN_PEE") or is_granted("ROLE_ADMIN_FULL") or is_granted("ROLE_SUPER_ADMIN") %}
                                <a class="btn btn-sm btn-tangerine" href="{{ path('admin_homepage') }}">Administration</a>
                            {% else %}
                                <a class="btn btn-sm btn-tangerine" href="{{ path('espace_perso') }}">Mon espace perso</a>
                            {% endif %}
                            <a class="btn btn-sm" href="{{ path('fos_user_security_logout') }}">Se déconnecter</a>
                        {% else %}
                        {#
                            <a class="btn btn-sm" href="{{ path('fos_user_security_login') }}">Se connecter</a>
                            <a class="btn btn-sm btn-tangerine" href="{{ path('fos_user_registration_register') }}">Sʼinscrire</a>
                        #}
                        {#<a class="btn btn-sm" href="https://www.cgenial.org/224-travaux-en-cours">Se connecter</a>
                            <a class="btn btn-sm btn-tangerine" href="https://www.cgenial.org/224-travaux-en-cours">Sʼinscrire</a>
                        #}
                            <a class="btn btn-sm btn-connect" href="https://cgenial-connect.fr/inscription">Cgénial Connect</a>
                            <a class="btn btn-sm btn-tangerine" target="_blank" href="https://www.helloasso.com/associations/fondation-cgenial/formulaires/1/widget">Faire un don</a>
                        {% endif %}
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="website-header-nav-mobile d-lg-none">
        <div class="container">
            <div class="row">
                <div class="col-3">
                    <button class="btn btn-xs toggle-website-menu-main" type="button" data-toggle data-target="#website-menu-main" aria-controls="website-menu-main" aria-expanded="false" aria-label="Toggle docs navigation"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30" width="30" height="30" focusable="false"><title>Menu</title><path stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-miterlimit="10" d="M4 7h22M4 15h22M4 23h22"></path></svg></button>
                </div>
                <div class="col-9">
                    <div class="website-menu-connect">
                        {% if app.user is not null and is_granted("IS_AUTHENTICATED_REMEMBERED") %}
                            {% if is_granted("ROLE_ADMIN_ITDLC") or is_granted("ROLE_ADMIN_PEE") or is_granted("ROLE_ADMIN_FULL") or is_granted("ROLE_SUPER_ADMIN") %}
                                <a class="btn btn-sm btn-tangerine" href="{{ path('admin_homepage') }}">Admin</a>
                            {% else %}
                                <a class="btn btn-sm btn-tangerine" href="{{ path('espace_perso') }}">Compte</a>
                            {% endif %}
                            <a class="btn btn-sm btn-tundora" href="{{ path('fos_user_security_logout') }}">Se déconnecter</a>
                        {% else %}
                            <a class="btn btn-sm btn-tundora" href="https://cgenial-connect.fr/inscription">Se connecter</a>
                            <a class="btn btn-sm btn-tangerine" target="_blank" href="https://www.helloasso.com/associations/fondation-cgenial/formulaires/1/widget">Faire un don</a>
                        {% endif %}
                    </div>
                </div>
            </div>
        </div>
    </div>

    <nav id="website-menu-main" class="website-menu website-menu-main d-none d-lg-block" role="navigation">
        <div class="container">
        {% block mainmenu %}
            {{ render(controller('AppBundle:Render:menu')) }}
        {% endblock %}
        </div>
    </nav>
</header>