{% extends 'account/base.html' %}
{% load static %}
{% load crispy_forms_tags %}
{% load socialaccount %}
{% block title %}Register{% endblock title %}
{% block content %}
    <body>
        
        <div class="account-pages my-5 pt-sm-5">
            <div class="container">
                <div class="row justify-content-center">
                    <div class="col-md-8 col-lg-6 col-xl-5">
                        <div class="card overflow-hidden">
                            <div class="bg-primary bg-soft">
                                <div class="row">
                                    <div class="col-7">
                                        <div class="text-primary p-4">
                                            <h5 class="text-primary">Free Register</h5>
                                            <p>Get your free Skote account now.</p>
                                        </div>
                                    </div>
                                    <div class="col-5 align-self-end">
                                        <img src="{% static 'images/profile-img.png' %}" alt="" class="img-fluid">
                                    </div>
                                </div>
                            </div>
                            <div class="card-body pt-0"> 
                                <div>
                                    <a href="{% url 'dashboard' %}">
                                        <div class="avatar-md profile-user-wid mb-4">
                                            <span class="avatar-title rounded-circle bg-light">
                                                <img src="{% static 'images/logo.svg' %}" alt="" class="rounded-circle" height="34">
                                            </span>
                                        </div>
                                    </a>
                                </div>
                                <div class="p-2">
                                    <form class="needs-validation" novalidate action="" method="POST" enctype="multipart/form-data">
                                        
                                        {% for message in messages %}
                                                <div class="alert {{ message.tags }} mb-4" role="alert">
                                                    <strong>{{ message }}</strong>
                                                </div>
                                        {% endfor %} 
                                        {% if field.help_text %}
                                            <div class="alert alert-danger mb-4" role="alert">
                                                    <strong>{{ field.help_text }}</strong>
                                                </div>
                                        {% endif %}
                                        
                                        {% for error in errors  %}
                                            <div class="alert alert-danger mb-4" role="alert">
                                                    <strong>{{ error }}</strong>
                                                </div>
                                        {% endfor %}
                                        {% csrf_token %}
                                        {{ form|crispy }}
                                        <div class="mt-4 d-grid">
                                            <button class="btn btn-primary waves-effect waves-light" type="submit">Register</button>
                                        </div>

                                        <div class="mt-4 text-center">
                                            <h5 class="font-size-14 mb-3">Sign up using</h5>
            
                                            <ul class="list-inline">
                                                <li class="list-inline-item">
                                                    <a href="{% provider_login_url 'facebook' %}" class="social-list-item bg-primary text-white border-primary">
                                                        <i class="mdi mdi-facebook"></i>
                                                    </a>
                                                </li>
                                                
                                                <li class="list-inline-item">
                                                    <a href="{% provider_login_url 'google' %}" class="social-list-item bg-danger text-white border-danger">
                                                        <i class="mdi mdi-google"></i>
                                                    </a>
                                                </li>
                                            </ul>
                                        </div>
                
                                        <div class="mt-4 text-center">
                                            <p class="mb-0">By registering you agree to the Skote <a href="#" class="text-primary">Terms of Use</a></p>
                                        </div>
                                    </form>
                                </div>
            
                            </div>
                        </div>
                        <div class="mt-5 text-center">
                            
                            <div>
                                <p>Already have an account ? <a href="{% url 'account_login' %}" class="fw-medium text-primary"> Login</a> </p>
                                <p>© <script>document.write(new Date().getFullYear())</script> Skote. Crafted with <i class="mdi mdi-heart text-danger"></i> by Themesbrand</p>
                            </div>
                        </div>

                    </div>
                </div>
            </div>
        </div>
{% endblock content %}