{% extends "users/base.html" %}
{% block title %} Register Page {% endblock title%}
{% block content %}
    <div class="form-content my-3 p-3">
		<div class="container">
            <div class="row justify-content-center">
                <div class="col-lg-7">
                    <div class="card shadow-lg border-0 rounded-lg mt-0 mb-5">
                        <div class="card-header justify-content-center">
                        	<h3 class="font-weight-light my-4 text-center">Create Account</h3>
                        </div>
                        <div class="card-body">
                            <form method="POST">
                                {% csrf_token %}
                                {% if form.errors %}
                                    <div class="alert alert-danger alert-dismissible" role="alert">
                                        <div id="form_errors">
                                            {% for key, value in form.errors.items %}
                                                <strong>{{ value }}</strong>
                                            {% endfor %}
                                        </div>
                                        <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                                            <span aria-hidden="true">&times;</span>
                                        </button>
                                    </div>
                                {% endif %}
                                <div class="form-row">
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label class="small mb-1">First Name</label>
                                            {{ form.first_name }}
                                        </div>
                                    </div>
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label class="small mb-1">Last Name</label>
                                            {{ form.last_name }}
                                        </div>
                                    </div>
                                </div>
                                <div class="form-row">
                                    <div class="col-md-6">
		                                <div class="form-group">
		                                	<label class="small mb-1">Username</label>
		                                    {{ form.username }}
		                                </div>
		                            </div>
                                    <div class="col-md-6">
		                                <div class="form-group">
		                                	<label class="small mb-1">Email</label>
		                                    {{ form.email }}
		                                </div>
		                            </div>
		                        </div>
                                <div class="form-row">
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label class="small mb-1">Password</label>
                                            {{ form.password1 }}
                                            {{ form.errors.password }}
                                        </div>
                                    </div>
                                    <div class="col-md-6">

                                        <div class="form-group">
                                            <label class="small mb-1">Confirm Password</label>
                                            {{ form.password2 }}
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group mt-4 mb-0">
                                    <button type="submit" class="col-md-12 btn btn-dark">Sign Up</button><br><br>
                                </div>
                            </form>
                        </div>
                        <div class="card-footer text-center">
                            <div class="small">
                                <a href="{% url 'login' %}">Have an account? Go to Sign in</a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
	</div>
{% endblock content %}