{% load i18n staticfiles %}

<script type="text/javascript">
    var mandaye_redirect_url = '{{force_redirect_url}}';
    var mandaye_redirect_locator = '{{force_redirect_locator}}';
    var mandaye_logout_locator = '{{logout_locator}}';
</script>

<script type="text/javascript" src="{% static 'force.redirect.js' %}"></script>
<script type="text/javascript" src="{% static 'single.logout.js' %}"></script>

{% if site_scripts %}
    {%for script in site_scripts%}
        <script type="text/javascript" src="{% static script %}"></script>
    {%endfor%}
{%endif%}

{% include 'mandaye/panel_styles.html' %}

<div id="mandaye-logo">
    <a href="{% if portal_user_url %}{{ portal_user_url }}{% else %}/{% endif %}">
        <img src="{% static 'images/logo.png' %}" alt="logo.png">
    </a>
</div>
{% if user.is_authenticated %}
    <div id="mandaye-username"><a href="{{idp_url}}/accounts">{{ user.get_full_name }}</a></div>
    {% if is_linked %}
        <div id="mandaye-logon-url"><a href="{% url 'logout' %}">Me déconnecter</a></div>
        <div id="mandaye-association-url"><a href="{% url 'dissociate' %}">Délier mon compte</a></div>
        {% if portal_user_url %}<div id="mandaye-advances"><a href="{{portal_user_url}}">Mes démarches</a></div>{% endif %}
    {% else %}
        <div id="mandaye-assocation-url"><a href="{% url 'post-login' %}">Me connecter avec mon compte citoyen</a></div>
    {% endif %}
{% else %}
    <div id="mandaye-assocation-url"><a href="{% url 'post-login' %}">Me connecter avec mon compte citoyen</a></div>
{% endif %}
