{% extends "layout/base.html" %}
{% block title %}Register{% endblock %}
{% block content %}
<!-- Main -->
<h1>Registration of User</h1>
<section>
    <form method="post" action="/register">
        {{ form.hidden_tag() }}
        <div class="fields">
            <div class="field">
                {{ form.username.label }}

                {% if form.username.errors %}
                    {{ form.username }}
                    <div>
                        {% for error in form.username.errors %}
                        <p class="error">{{ error }}</p>
                        {% endfor %}
                    </div>
                {% else %}
                {{ form.username(size=30) }}
                {% endif %}
            </div>
            <div class="field ">
                {{ form.email.label }}

                {% if form.email.errors %}
                    {{ form.email }}
                    <div>
                        {% for error in form.email.errors %}
                        <p class="error">{{ error }}</p>
                        {% endfor %}
                    </div>
                {% else %}
                {{ form.email(size=30) }}
                {% endif %}
            </div>
            <div class="field">
                {{ form.password.label }}
                {{ form.password(size=30) }}
            </div>
            <div class="field">
                {{ form.confirm_password.label }}
                {{ form.confirm_password(size=30) }}
            </div>
            <div class="field">
                {{ form.accessType.label }}
                {{ form.accessType }}
            </div>
        </div>
        <ul class="actions">
            <li>{{form.submit}}</li>
        </ul>
    </form>
</section>

{% endblock content %}