{% import "macros/macros.html.twig" as macros %}
<nav class="w3-sidebar w3-collapse w3-white w3-animate-left" style="z-index:3;width:300px;height:100%" id="mySidebar"><br>
<div class="w3-container w3-row">
<div class="w3-col s4">
{% if app.user and app.user.member and app.user.member.informationMember.image %}
{{macros.imageSmall(asset('uploads/'~ app.user.member.informationMember.image.name))}}
{% else %}
<img src="{{ asset('img/avatar3.png') }}" class="w3-circle w3-card w3-margin-right" style="height:46px;width:46px">
{% endif %}
</div>
<div class="w3-col s8 w3-bar">
{% if app.user %}
<span>Bienvenue
<strong>
{% if app.user.member %}
{{ app.user.member.informationMember.firstName}}
{% else %}
{{app.user.username}}
{% endif %}
</strong>
</span><br>
<a href="{{ path('home') }}" class="w3-bar-item w3-button">
{{macros.icon('fa fa-home')}}
</a>
<a href="{{ path('member_self_modify') }}" class="w3-bar-item w3-button">
{{macros.icon('fas fa-user-edit')}}
</a>
<a href="{{ path('member_modify_password') }}" class="w3-bar-item w3-button ">
{{macros.icon('fa fa-key')}}
</a>
{% else %}
<p class="w3-center w3-margin-right">
Vous n'êtes pas encore connecté
</p>
{% endif %}
</div>
</div>
<hr>
{% if app.user %}
<div class="w3-container">
<h5>Navigation</h5>
</div>
<div class="w3-bar-block">
<a href="{{ path('home') }}" class="w3-bar-item w3-button {% if route == 'home' %}w3-theme{% endif %}">
{{macros.iconMargin('fa fa-home')}}
Accueil</a>
<a href="{{ path('club_information') }}" class="w3-bar-item w3-button {% if route == 'club_information' %}w3-theme{% endif %}">
{{macros.iconMargin('fa fa-info')}}
Information club</a>
<a href="{{ path('member_my_information') }}" class="w3-bar-item w3-button {% if route == 'member_my_information' or route == 'member_modify' %}w3-theme{% endif %}">
{{macros.iconMargin('fa fa-user')}}
Mes informations</a>
<a {% if app.user.member %} href="{{ path('contribution_by_member', {"id": app.user.member.id} )}}" {% endif %} class="w3-bar-item w3-button {% if route == 'contribution_by_member' and app.user.member.id == id %}w3-theme{% endif %} {% if not app.user.member %} w3-disabled {% endif %}">
{{macros.iconMargin('fas fa-euro-sign')}}
Mes contributions
</a>
<a href="{{ path('outing_list') }}" class="w3-bar-item w3-button {% if route == 'outing_list' %}w3-theme{% endif %}">
{{macros.iconMargin('fa fa-anchor')}}
Liste des sorties</a>
<a href="{{ path('commission_list') }}" class="w3-bar-item w3-button {% if route == 'commission_list' %}w3-theme{% endif %}">
{{macros.iconMargin('fas fa-user-friends')}}
Liste des commissions</a>
</div>
<br>
{% else %}
<div class="w3-bar-block">
<p class="w3-bar-item w3-center">
{{macros.iconMargin('fas fa-info-circle')}}
<font class="w3-small">
Connectez vous pour avoir accès aux fonctionalités
</font>
</p>
</div>
<br>
{% endif %}
<div class="w3-bar-block w3-center">
<img src="{{ asset('img/logo_text.png') }}" class="w3-round" alt="logo with text">
</div>
{% if app.user %}
<br>
<div class="w3-bar-block">
<a href="{{ path('app_logout') }}" class="w3-bar-item w3-red w3-button">
{{macros.iconMargin('fas fa-sign-out-alt')}}
Déconnexion</a>
</div>
{% if is_granted('ROLE_ADMIN') %}
<hr>
<div id="adm" class="w3-container w3-center">
<h4>Admin</h4>
</div>
<hr>
<div class="w3-container">
<h5>Listes</h5>
</div>
<div class="w3-bar-block">
<a href="{{ path('member_list') }}" class="w3-bar-item w3-button {% if route == 'member_list' %}w3-theme{% endif %}">
{{macros.iconMargin('fa fa-users')}}
Liste des adhérents</a>
<a href="{{ path('contact_list') }}" class="w3-bar-item w3-button {% if route == 'contact_list' %}w3-theme{% endif %}">
{{macros.iconMargin('fas fa-address-book')}}
Liste des contacts</a>
<a href="{{ path('contribution_list') }}" class="w3-bar-item w3-button {% if route == 'contribution_list' or (route == 'contribution_by_member' and app.user.member.id != id) %}w3-theme{% endif %}">
{{macros.iconMargin('fas fa-euro-sign')}}
Liste des contributions</a>
</div>
<hr>
<div class="w3-container">
<h5>Actions</h5>
</div>
<div class="w3-bar-block">
<a href="#" class="w3-bar-item w3-button">
{{macros.iconMargin('fa fa-paper-plane')}}
Effectuer un mailing</a>
<a href="#" class="w3-bar-item w3-button">
{{macros.iconMargin('fas fa-file-pdf')}}
Génération de pdf</a>
</div>
<hr>
<div class="w3-container">
<h5>Ajouter</h5>
</div>
<div class="w3-bar-block">
<a href="{{ path('member_add') }}" class="w3-bar-item w3-button {% if route == 'member_add' %}w3-theme{% endif %}">
{{macros.iconMargin('fa fa-user-plus')}}
Ajouter un adhérent</a>
<a href="{{ path('contact_add') }}" class="w3-bar-item w3-button {% if route == 'contact_add' %}w3-theme{% endif %}">
{{macros.iconMargin('fas fa-address-book')}}
Ajouter un contact</a>
<a href="{{ path('commission_add') }}" class="w3-bar-item w3-button {% if route == 'commission_add' %}w3-theme{% endif %}">
{{macros.iconMargin('fas fa-user-friends')}}
Ajouter une commission</a>
<a href="{{ path('contribution_add') }}" class="w3-bar-item w3-button {% if route == 'contribution_add' %}w3-theme{% endif %}">
{{macros.iconMargin('fas fa-euro-sign')}}
Ajouter une contribution</a>
<a href="{{ path('outing_add') }}" class="w3-bar-item w3-button {% if route == 'outing_add' %}w3-theme{% endif %}">
{{macros.iconMargin('fa fa-anchor')}}
Ajouter une sortie</a>
</div>
<hr>
{% endif %}
<br>
<br>
<br>
{% endif %}
</nav><!-- Overlay effect when opening sidebar on small screens --><div class="w3-overlay w3-hide-large w3-animate-opacity" onclick="w3_close()" style="cursor:pointer" title="close side menu" id="myOverlay"></div>