{% if canRegister %}
    <h3>Register</h3>

    {{ form_ajax('onRegister') }}

        <div class="form-group">
            <label for="registerName">Full Name</label>
            <input
                name="name"
                type="text"
                class="form-control"
                id="registerName"
                placeholder="Enter your full name" />
        </div>

        <div class="form-group">
            <label for="registerEmail">Email</label>
            <input
                name="email"
                type="email"
                class="form-control"
                id="registerEmail"
                placeholder="Enter your email" />
        </div>

        {% if loginAttribute == "username" %}
            <div class="form-group">
                <label for="registerUsername">Username</label>
                <input
                    name="username"
                    type="text"
                    class="form-control"
                    id="registerUsername"
                    placeholder="Enter your username" />
            </div>
        {% endif %}

        <div class="form-group">
            <label for="registerPassword">Password</label>
            <input
                name="password"
                type="password"
                class="form-control"
                id="registerPassword"
                placeholder="Choose a password" />
        </div>

        <button type="submit" class="btn btn-default">Register</button>

    {{ form_close() }}
{% else %}
    <!-- Registration is disabled. -->
{% endif %}
