{% extends "admin/login.html" %}

{% load i18n %}

{% block content %}
    <div id="content-main">
        {% if user.is_authenticated %}
            <p class="errornote">
                {% blocktranslate trimmed %}
                    You are authenticated as {{ username }}, but are not authorized to
                    access this page. Would you like to login to a different account?
                {% endblocktranslate %}
            </p>
        {% endif %}
        {% if django_login_allowed %}{{ block.super }}{% endif %}
        {% if payla_oidc_login_allowed %}
            <div class="oidc-login">
                <form method="get" action="{% url 'oidc_authentication_init' %}" novalidate>
                    {% csrf_token %}
                    {% if request.GET.next %}
                        <input type="hidden" name="next" value="{{ request.GET.next|escape }}">
                    {% elif next %}
                        <input type="hidden" name="next" value="{{ next|escape }}">
                    {% endif %}
                    <button type="submit"
                            class="button btn btn-primary"
                            style="width: 100%;
                                   height: 40px;
                                   font-size: 16px;
                                   background-color: #ca0303ff;
                                   border: none;
                                   border-radius: 4px;
                                   cursor: pointer;
                                   transition: background-color 0.3s"
                            onmouseover="this.style.backgroundColor='#a50202'"
                            onmouseout="this.style.backgroundColor='#ca0303ff'">Login via ORY</button>
                </form>
            </div>
        {% endif %}
        {% if not django_login_allowed and not payla_oidc_login_allowed %}
            <p class="errornote">{% translate "No authentication methods are currently available." %}</p>
        {% endif %}
    </div>
{% endblock content %}
