{% load static %}
<!DOCTYPE html>
<html>
    <head>
        <title>
            OIDC Tests
        </title>
    </head>
    <body>
{% if messages %}
{% for message in messages %}
    {% if message.level == DEFAULT_MESSAGE_LEVELS.SUCCESS %}
        <div class="alert alert-success text-center" role="alert" style="color: #fff;
    background-color: #369763;border-color: #369763;">
    {% elif message.level == DEFAULT_MESSAGE_LEVELS.ERROR %}
        <div class="alert alert-error text-center" role="alert" style="color: #fff;
        background-color: #ad1f1f;border-color: #ad1f1f;">
    {% else %}
        <div class="alert alert-success text-center" role="alert" style="color: #fff;
        background-color: #913697;border-color: #913697;">
        {% endif %}
        <b>{{ message }}</b>
    </div>
{% endfor %}
{% endif %}

<div>
    Welcome
    <div>
        <div class="session-container">
            {% if user.is_authenticated %}
            <a id="oidc-logout-link" href="{% url op_logout_url %}">OIDC-LOGOUT-LINK</a>
            {% else %}
                <a id="oidc-anon-logout-link" href="{% url op_logout_url %}">OIDC-ANON-LOGOUT-LINK</a>
                <a id="oidc-login-link" href="{% url op_login_url %}">OIDC-LOGIN-LINK</a>
            {% endif %}
        </div>
            <hr />
        <div class="user-container">
        {% if user.is_authenticated %}
            You are <b>logged in</b> as {{ user.email }}
            <ul>
                <b>Session ID :</b>{{ request.session.oidc_sid }}
                <b>User ID :</b>{{ user.id }}
            </ul>
        {% else %}
            You are <b>logged out</b>
        {% endif %}
        </div>
    </div>
</div>
</body>
</html>