login.html 2.67 KB
Newer Older
1
{% extends "base.html" %}
2 3
{% load i18n %}
{% load static %}
4

5 6 7
{% block title %}
    {% trans "Login" %}
{% endblock %}
8

9 10 11
{% block supplementary_css %}
    <link rel="stylesheet" href="{% static 'registration/login.css' %}"/>
{% endblock %}
12

13 14 15 16 17 18 19 20 21 22 23 24 25 26
{% block content %}
    {% if next %}
        <div class="sib-login-title">
            {% if user.is_authenticated %}
                <h2>
                    {% blocktrans %}
                        Your account doesn't have access to this page. To proceed,
                        please login with an account that has access.
                    {% endblocktrans %}
                </h2>
            {% else %}
                <h2>{% trans "Please login to see this page." %}</h2>
            {% endif %}
        </div>
27
    {% endif %}
28

29
    <div class="sib-login-forms">
Gaëlle Morin's avatar
Gaëlle Morin committed
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
        <div class="flex-column">
            {% if form.errors %}
                <p class="error">{% trans "Your username and password didn't match. Please try again." %}</p>
            {% endif %}
            <form class="flex-column" method="post" action="{% url 'login' %}">
                {% csrf_token %}
                <div class="input-line">
                    <label for="id_username">{%  trans "Username or e-mail:" %}</label>
                    {{ form.username }}
                </div>
                <div class="input-line">
                    {{ form.password.label_tag }}
                    {{ form.password }}
                </div>
                <input type="submit" value="{% trans 'login' %}"/>
                <input type="hidden" name="next" value="{{ next }}"/>
            </form>
            <a class="sib-link" href="{% url 'password_reset' %}">{% trans "Lost password?" %}</a>
        </div>
49

Gaëlle Morin's avatar
Gaëlle Morin committed
50 51
        <div class="flex-column">
            <p class="other-login-title text-center">{% trans "Login using another authentification provider" %}</p>
52

Gaëlle Morin's avatar
Gaëlle Morin committed
53 54 55 56 57 58 59 60
            <form class="flex-column" method="post" action="{% url 'oidc_login' %}">
                {% csrf_token %}
                <label for="id_subject" title="Your e-mail, web-id or provider url">{% trans "E-mail, web-id or provider url:" %}</label>
                <input type="text" name="subject" required id="id_subject"/>
                <input type="submit" value="{% trans 'login' %}"/>
                <input type="hidden" name="next" value="{{ next }}"/>
            </form>
        </div>
61 62 63

        <div class="flex-column">
            <p class="other-login-title text-center">{% trans "Doesn't have an account yet?" %}</p>
Calum Mackervoy's avatar
Calum Mackervoy committed
64
            <a class="sib-link sib-register-link" href="{% url 'django_registration_register' %}?next={{next|urlencode}}">{% trans "Register now!" %}</a>
65
        </div>
66
    </div>
67
{% endblock %}