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

{% block title %} Profile {% endblock title %}

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

{% block content %}

<div class="position-absolute w-100 min-height-300 top-0"
    style="background-image: url('{{ config.ASSETS_ROOT }}/img/profile-layout-header.jpg'); background-position-y: 50%;">
    <span class="mask bg-primary opacity-6"></span>
</div>


<main class="main-content position-relative border-radius-lg ">

    <div class="container-fluid py-4">
        <div class="row">
            <div class="col-md-8">
                <div class="card">
                    <div class="card-header pb-0">
                        <div class="d-flex align-items-center">
                            <p class="mb-0">Add Profile</p>
                        </div>
                    </div>
                    <div class="card-body">
                        <p class="text-uppercase text-sm">User Information</p>
                        <!-- Registration form in profile.html -->
                        {% if registration_successful %}
                            <div class="alert alert-success" role="alert">
                                Registration successful!
                            </div>
                        {% endif %}
                        <form method="post" action="/register">
                            <div class="row">
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <label for="example-text-input" class="form-control-label">Username</label>
                                        <input class="form-control" name="username" type="text" placeholder="Username">
                                    </div>
                                </div>
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <label for="example-text-input" class="form-control-label">Email address</label>
                                        <input class="form-control" name="email" type="email"
                                            placeholder="Email Address">
                                    </div>
                                </div>
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <label for="example-text-input" class="form-control-label">Password</label>
                                        <input class="form-control" name="password" type="password"
                                            placeholder="Password">
                                    </div>
                                </div>
                            </div>
                            <button type="submit" class="btn btn-success">Register</button>
                            {% if fieldsEmpty %}
                            <div class="alert alert-danger mt-3" role="alert">
                                User already exists. Please choose a different username or email.
                            </div>
                            {% endif %}

                            {% if message %}
                            <div class="alert alert-danger mt-3" role="alert">
                                {{message}}
                            </div>
                            {% endif %}
                        </form>

                    </div>
                </div>
            </div>
        </div>

        {% include "includes/footer.html" %}

    </div>

</main>

{% endblock content %}

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