
{% extends 'base.html' %}

{% load i18n widget_tweaks %}


{% block content %}

    <div class="container">
        <div class="row">
            <div class="col-md-6 col-md-offset-3 col-sm-6 col-sm-offset-3 col-xs-12">
                <h2>{% trans 'Реєстрація на сайті' %}</h2>

                {% if not request.user.is_authenticated %}

                    <form id="login-form" method="post">

                        {% csrf_token %}

                        {{ form.non_field_errors }}

                        <div class="input-group">
                            <span class="input-group-addon">
                                <span class="input-icon input-icon-user"></span>
                                <span class="input-text">{{ form.username.label }} *</span>
                            </span>
                            {{ form.username|add_class:"form-control input-lg" }}
                            <div class="help-block">{{ form.username.errors }}</div>
                        </div>

                        <div class="input-group">
                            <span class="input-group-addon">
                                <span class="input-icon input-icon-email"></span>
                                <span class="input-text">{{ form.email.label }} *</span>
                            </span>
                            {{ form.email|add_class:"form-control input-lg" }}
                            <div class="help-block">{{ form.email.errors }}</div>
                        </div>

                        <div class="input-group">
                            <span class="input-group-addon">
                                <span class="input-icon input-icon-password"></span>
                                <span class="input-text">{{ form.password1.label }} *</span>
                            </span>
                            {{ form.password1|add_class:"form-control input-lg" }}
                            <div class="help-block">{{ form.password1.errors }}</div>
                        </div>

                        <div class="input-group">
                            <span class="input-group-addon">
                                <span class="input-icon input-icon-password"></span>
                                <span class="input-text">{{ form.password2.label }} *</span>
                            </span>
                            {{ form.password2|add_class:"form-control input-lg" }}
                            <div class="help-block">{{ form.password2.errors }}</div>
                        </div>

                        <button class="btn btn-block btn-custom-2">
                            <i class="fa fa-check"></i>
                            {% trans 'Створити аккаунт' %}
                        </button>
                    </form>

                {% else %}
                    <p class="alert alert-warning">
                        {% trans 'Щоб створити новий аккаунт Вам потрібно' %}
                        <a href="{% url 'accounts:logout' %}?next={{ request.get_full_path }}">{% trans 'вийти' %}</a>.
                    </p>
                {% endif %}

            </div>
        </div>
    </div>

{% endblock %}
