{% extends 'base.html.twig' %}

{% block pagewrapper %}
    <h1 class="page-title">{%if infotitle is defined%}{{infotitle}}{%else%}Inscriptions{%endif%}</h1>

    <div style="padding-top:50px;max-width: 1000px; margin:auto; font-size:18px;">
        <div class='alert alert-{{ mode }}' style='margin: 5px 0px'>
            {% autoescape %}
            <p>{{ info|raw }}</p>
            {% endautoescape %}

            {% if mode=="error" %}
                <a class="btn btn-primary" href="{{ path("app_core_logout") }}">Déconnexion</a>
            {% endif %}
        </div>
    </div>
{% endblock %}

{% block localjavascript %}

    {% if mode=="success" %}
        $(document).ready(function() {
            // Redirection vers la mire d'authentification
            setTimeout(function(){
                {% if redirectto is defined and redirectto is not null %}
                window.location.href="{{ redirectto }}";
                {% else %}
                window.location.href="{{ path("app_core_login") }}";
                {% endif %}
            }, 6000);     
        });
    {% endif %}
{% endblock %}

