{% extends "base.html" %}

{% block content %}
    <div class="content-section">
        <form method="POST" action="">
            {{ form.hidden_tag() }}
            <fieldset class="form-group">
                <legend class="border-bottom mb-4">Join Today</legend>
                <div class="form-group">
                    {{ form.username.label(class="form-control-label") }}
                    {% if form.username.errors %}
                        {{ form.username(class="form-control is-invalid") }}
                        <div class="invalid-feedback">
                            {% for error in form.username.errors %}
                                <span>{{ error }}</span>
                            {% endfor %}
                        </div>
                    {% else %}
                        {{ form.username(class="form-control") }}
                    {% endif %}
                </div>
                <div class="form-group">
                    {{ form.email.label(class="form-control-label") }}
                    {% if form.email.errors %}
                        {{ form.email(class="form-control is-invalid") }}
                        <div class="invalid-feedback">
                            {% for error in form.email.errors %}
                                <span>{{ error }}</span>
                            {% endfor %}
                        </div>
                    {% else %}
                        {{ form.email(class="form-control") }}
                    {% endif %}
                </div>
                <div class="form-group">
                    {{ form.password.label(class="form-control-label") }}
                    {% if form.password.errors %}
                        {{ form.password(class="form-control is-invalid") }}
                        <div class="invalid-feedback">
                            {% for error in form.password.errors %}
                                <span>{{ error }}</span>
                            {% endfor %}
                        </div>
                    {% else %}
                        {{ form.password(class="form-control") }}
                    {% endif %}
                </div>
                <div class="form-group">
                    {{ form.confirm_password.label(class="form-control-label") }}
                    {% if form.confirm_password.errors %}
                        {{ form.confirm_password(class="form-control is-invalid") }}
                        <div class="invalid-feedback">
                            {% for error in form.confirm_password.errors %}
                                <span>{{ error }}</span>
                            {% endfor %}
                        </div>
                    {% else %}
                        {{ form.confirm_password(class="form-control") }}
                    {% endif %}
                </div>
                <div class="form-group">
                    {{ form.mobile_number.label(class="form-control-label") }}
                    {% if form.mobile_number.errors %}
                        {{ form.mobile_number(class="form-control is-invalid") }}
                        <div class="invalid-feedback">
                            {% for error in form.mobile_number.errors %}
                                <span>{{ error }}</span>
                            {% endfor %}
                        </div>
                    {% else %}
                        {{ form.mobile_number(class="form-control") }}
                    {% endif %}
                </div>
                <div class="form-group">
                    {{ form.date_of_birth.label(class="form-control-label") }}
                    {% if form.date_of_birth.errors %}
                        {{ form.date_of_birth(class="form-control is-invalid") }}
                        <div class="invalid-feedback">
                            {% for error in form.date_of_birth.errors %}
                                <span>{{ error }}</span>
                            {% endfor %}
                        </div>
                    {% else %}
                        {{ form.date_of_birth(class="form-control") }}
                    {% endif %}
                </div>
                <div class="form-group">
                    {{ form.gender.label(class="form-control-label") }}
                    {% if form.gender.errors %}
                        {{ form.gender(class="form-control is-invalid") }}
                        <div class="invalid-feedback">
                            {% for error in form.gender.errors %}
                                <span>{{ error }}</span>
                            {% endfor %}
                        </div>
                    {% else %}
                        {{ form.gender(class="form-control") }}
                    {% endif %}
                </div>
                <div class="form-group">
                    {{ form.role.label(class="form-control-label") }}
                    {{ form.role(class="form-control") }}
                </div>
            </fieldset>
            <div class="form-group">
                {{ form.submit(class="btn btn-outline-info") }}
            </div>
        </form>
    </div>
    <div class="border-top pt-3">
        <small class="text-muted">
            Already Have An Account? <a class="ml-2" href="{{ url_for('auth.login') }}">Sign In</a>
        </small>
    </div>
{% endblock %}
