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

{% block title %} S'inscrire {% endblock %} 

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

{% block content %}

    <main>
        <section class="vh-lg-100 mt-5 mt-lg-0 bg-soft d-flex align-items-center">
            <div class="container">
                <p class="text-center">
                    CLIASO INSTAGRAM AUTOMATION
                </p>
                <div class="row justify-content-center form-bg-image" data-background-lg="{{ config.ASSETS_ROOT }}/img/illustrations/signup.svg">
                    <div class="col-12 d-flex align-items-center justify-content-center">
                        <div class="bg-white shadow-lg border-0 rounded border-light p-4 p-lg-5 w-100 fmxw-500">
                            <div class="text-center text-md-center mb-4 mt-md-0">
                                <h1 class="mb-0 h3">
                                    CLIASO - Inscription
                                </h1>
                                <br />
                                <p>
                                    {% if msg %}
                                        {{ msg | safe }}
                                    {% else %}
                                        Ajoutez vos informations
                                    {% endif %}                                     
                                </p> 
                            </div>
                            
                            {% if success %}

                                <div class="d-grid">
                                    <a href="{{ url_for('authentication_blueprint.login') }}" 
                                       class="btn btn-gray-800">Se connecter</a>
                                </div>

                            {% else %}

                                <form method="post" action="" class="mt-4">
                                    
                                    {{ form.hidden_tag() }}

                                    <div class="form-group mb-4">
                                        <label for="email">Nom d'utilisateur</label>
                                        <div class="input-group">
                                            <span class="input-group-text" id="basic-addon1">
                                                <span class="fas fa-user-circle"></span>
                                            </span>
                                            {{ form.username(placeholder="Nom d'utilisateur", class="form-control") }}
                                        </div>  
                                    </div>

                                    <!-- Form -->
                                    <div class="form-group mb-4">
                                        <label for="email">Email</label>
                                        <div class="input-group">
                                            <span class="input-group-text" id="basic-addon1">
                                                <span class="fas fa-envelope"></span>
                                            </span>
                                            {{ form.email(placeholder="Email", class="input form-control", type="email") }}
                                        </div>  
                                    </div>
                                    <!-- End of Form -->
                                    <div class="form-group">
                                        <!-- Form -->
                                        <div class="form-group mb-4">
                                            <label for="password">Mot de passe</label>
                                            <div class="input-group">
                                                <span class="input-group-text" id="basic-addon2">
                                                    <span class="fas fa-unlock-alt"></span>
                                                </span>
                                                {{ form.password(placeholder="Mot de passe", class="form-control", type="password") }}
                                            </div>  
                                        </div>
                                        <!-- End of Form -->
                                        <div class="mb-4">
                                            <div class="form-check">
                                                <input class="form-check-input" type="checkbox" value="" id="remember" required>
                                                <label class="form-check-label fw-normal mb-0" for="remember">
                                                    J'accepte les <a href="#" class="fw-bold">termes et conditions</a>
                                                </label>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="d-grid">
                                        <button type="submit" name="register" class="btn btn-gray-800">S'inscrire</button>
                                    </div>
                                </form>
                                <br />
                                <div class="d-flex justify-content-center align-items-center mt-4">
                                    <span class="fw-normal">
                                        Vous avez déjà un compte? 
                                        <a href="{{ url_for('authentication_blueprint.login') }}" class="fw-bold">Se connecter</a>
                                    </span>
                                </div>
                            
                            {% endif %}

                        </div>
                    </div>
                </div>
            </div>
        </section>
    </main>

{% endblock content %}

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