{% extends 'templates/main-layout.twig' %}

{% block content %}

    <div class="container">
        {% include "templates/partials/flash.twig" %}

        <div class="row">
            <div class="col-md-offset-4 col-md-4">
                <div class="login-panel panel panel-{{ errors ? 'danger' : 'default' }}">
                    <div class="panel-heading">
                        <h3 class="panel-title">Sign up</h3>
                    </div>
                    <div class="panel-body">
                        <form action="{{ path_for('auth.signup') }}" method="post">
                            <fieldset>
                                <div class="form-group{{ errors.firstName ? ' has-error' : '' }}">
                                    <label class="control-label" for="firstName">First Name</label>
                                    <input name="firstName" type="text" class="form-control" id="firstName" placeholder="First Name" value="{{ old.firstName }}" autofocus>
                                    {% if errors.firstName %}
                                        <span class="help-block">{{ errors.firstName | first }}</span>
                                    {% endif %}
                                </div>
                                <div class="form-group{{ errors.lastName ? ' has-error' : '' }}">
                                    <label class="control-label" for="lastName">Last Name</label>
                                    <input name="lastName" type="text" class="form-control" id="lastName" placeholder="Last Name" value="{{ old.lastName }}">
                                    {% if errors.lastName %}
                                        <span class="help-block">{{ errors.lastName | first }}</span>
                                    {% endif %}
                                </div>
                                <div class="form-group{{ errors.email ? ' has-error' : '' }}">
                                    <label class="control-label" for="email">E-Mail-Address</label>
                                    <input name="email" type="text" class="form-control" id="email" placeholder="E-Mail-Address" value="{{ old.email }}">
                                    {% if errors.email %}
                                        <span class="help-block">{{ errors.email | first }}</span>
                                    {% endif %}
                                </div>
                                <div class="form-group{{ errors.password ? ' has-error' : '' }}">
                                    <label class="control-label" for="password">Password</label>
                                    <input name="password" type="password" class="form-control" id="password" placeholder="Password" value="{{ old.password }}">
                                    {% if errors.password %}
                                        <span class="help-block">{{ errors.password | first }}</span>
                                    {% endif %}
                                </div>
                                <button type="submit" class="btn btn-lg btn-success btn-block">Create account</button>
                                {{ csrf.field | raw }}
                            </fieldset>
                        </form>
                    </div>
                    <div class="panel-footer">
                        <p>Already have account? <a href="{{ path_for('auth.signin') }}">Sign in</a></p>
                    </div>
                </div>
            </div>
        </div>
    </div>

{% endblock %}