{% extends 'layouts/base-fullscreen.html' %}

{% block title %} Login {% endblock title %}

<!-- Specific CSS goes HERE -->
{% block stylesheets %}{% endblock stylesheets %}



{% block content %}

<!-- Page content -->
<div class="container mt--8 pb-5">
    <div class="row justify-content-center">
        <div class="col-lg-5 col-md-7">
            <div class="card bg-secondary shadow border-0">
                <div class="card-header bg-transparent pb-5">

                    <div class="text-muted text-center mt-2 mb-3">
                        Register
                        <br />
                        {% if msg %}
                        <span class="text-danger">{{ msg | safe }}</span>
                        {% else %}
                        <span>
                            Add your credentials
                        </span>
                        {% endif %}
                    </div>

                </div>
                <div class="card-body px-lg-5 py-lg-5">

                    <form method="post" action="/register">

                        {{ form.hidden_tag() }}

                        <div class="form-group mb-3">
                            <div class="input-group input-group-alternative">
                                <div class="input-group-prepend">
                                    <span class="input-group-text"><i class="ni ni-single-02"></i></span>
                                </div>
                                {% if form.email.errors %}
                                {{ form.email }}
                                <div>
                                    {% for error in form.email.errors %}
                                    <p>{{ error }}</p>
                                    {% endfor %}
                                </div>
                                {% else %}
                                {{ form.email(placeholder="Email",class="form-control",size=30) }}
                                {% endif %}
                            </div>
                        </div>

                        <div class="form-group mb-3">
                            <div class="input-group input-group-alternative">
                                <div class="input-group-prepend">
                                    <span class="input-group-text"><i class="ni ni-single-02"></i></span>
                                </div>
                                
                                {% if form.email.errors %}
                                {{ form.email }}
                                <div>
                                    {% for error in form.email.errors %}
                                    <p>{{ error }}</p>
                                    {% endfor %}
                                </div>
                                {% else %}
                                {{ form.username(placeholder="Username",class="form-control",size=30) }}
                                {% endif %}
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="input-group input-group-alternative">
                                <div class="input-group-prepend">
                                    <span class="input-group-text"><i class="ni ni-lock-circle-open"></i></span>
                                </div>
                                {{ form.password(placeholder="Password",class="form-control",type="password",size=30) }}
                            </div>
                        </div>

                        <div class="text-center">
                            <button type="submit" name="register" class="btn btn-primary my-4">Sign Up</button>
                        </div>
                    </form>
                </div>
            </div>
            <!-- <div class="row mt-3 text-center">
                <div class="col-12">
                    <a href="#" class="text-light"><small>Create new account</small></a>
                </div>
            </div> -->
        </div>
    </div>
</div>

{% endblock content %}

<!-- Specific JS goes HERE -->
{% block javascripts %}{% endblock javascripts %}