{% extends 'core/page.html' %}
{% load i18n %}

{% block page %}

    <h1>{% trans "Create a new account" %}</h1>

    {% if settings.AUTH_WORKFLOW %}
    <p>
        {% trans 'Please note that after registration, your account needs to be manually activated by an admin. This can take one or two days. You will receive an email when you can log in.'%}
    </p>
    {% endif %}

    <p>{% blocktrans %}Already have an account? Then please <a href="{{ login_url }}">sign in</a>.{% endblocktrans %}</p>

    <form method="post" action="{% url 'account_signup' %}" novalidate>
        {% csrf_token %}

        {% if redirect_field_value %}
        <input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" />
        {% endif %}

        {{ form }}

        <input type="submit" class="btn btn-primary" value="{% trans 'Create account' %}" />
    </form>

    {% if settings.AUTH_TERMS_OF_USE %}
    <div class="modal" id="terms-of-use-modal" tabindex="-1">
        <div class="modal-dialog modal-lg">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title">{% trans 'Terms of use' %}</h5>
                    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                </div>

                <div class="modal-body">
                    {% include 'account/terms_of_use.html' %}
                </div>

                <div class="modal-footer">
                    <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">
                        {% trans 'Close' %}
                    </button>
                </div>
            </div>
        </div>
    </div>
    {% endif %}

{% endblock %}
