{% extends "wedding/blocks/base.html" %}
{% load static %}

{% block title %}
Account Creation
{% endblock %}

{% block content %}
<div id="create_user" class="container-fluid text-center page-container">
    <h1 class="page-header">Account Creation</h1>

    {% if form.errors %}
        {% for field in form %}
            {% for error in field.errors %}
                <div class="alert alert-danger">
                    <strong>{{ error|escape }}</strong>
                </div>
            {% endfor %}
        {% endfor %}
        {% for error in form.non_field_errors %}
            <div class="alert alert-danger">
                <strong>{{ error|escape }}</strong>
            </div>
        {% endfor %}
    {% endif %}

    <div class="row">
        <div class="col-sm-12 base-font text-center">
            <div align="center">
                <p class="account-create-text">
                    Please fill in the information below.
                    <br><br>
                    Note that only one account may be created per RSVP, so
                    please use an email/password combination that you're
                    comfortable sharing with all members of your RSVP party so
                    that they may access the site's features.
                </p>
                    <form method="post" action="{% url 'create-account' %}">
                    {% csrf_token %}
                    <table>
                    <tr>
                        <td class="login-box">{{ form.email_address.label_tag }}</td>
                        <td class="login-box">{{ form.email_address }}</td>
                    </tr>
                    <tr>
                        <td class="login-box">{{ form.first_name.label_tag }}</td>
                        <td class="login-box">{{ form.first_name }}</td>
                    </tr>
                    <tr>
                        <td class="login-box">{{ form.last_name.label_tag }}</td>
                        <td class="login-box">{{ form.last_name }}</td>
                    </tr>
                    <tr>
                        <td class="login-box">{{ form.invite_street1.label_tag }}</td>
                        <td class="login-box">{{ form.invite_street1 }}</td>
                    </tr>
                    <tr>
                        <td class="login-box">{{ form.invite_street2.label_tag }}</td>
                        <td class="login-box">{{ form.invite_street2 }}</td>
                    </tr>
                    <tr>
                        <td class="login-box">{{ form.invite_city.label_tag }}</td>
                        <td class="login-box">{{ form.invite_city }}</td>
                    </tr>
                    <tr>
                        <td class="login-box">{{ form.invite_state.label_tag }}</td>
                        <td class="login-box">{{ form.invite_state }}</td>
                    </tr>
                    <tr>
                        <td class="login-box">{{ form.invite_zip.label_tag }}</td>
                        <td class="login-box">{{ form.invite_zip }}</td>
                    </tr>
                    <tr>
                        <td class="login-box">{{ form.password1.label_tag }}</td>
                        <td class="login-box">{{ form.password1 }}</td>
                    </tr>
                    <tr>
                        <td class="login-box">{{ form.password2.label_tag }}</td>
                        <td class="login-box">{{ form.password2 }}</td>
                    </tr>
                    </table>

                    <input type="submit" class="login-button" value="Create Account" />
                    </form>
            </div>
        </div>
    </div>
</div>

{% endblock %}
