{% extends "base.html" %}
<!DOCTYPE html>
{% block head %}
    {{ super() }}
    <link rel="stylesheet" type= "text/css" href= "{{ url_for('static', filename='styles/general.css') }}">
    <link rel="stylesheet" type= "text/css" href= "{{ url_for('static', filename='styles/security/register.css') }}">
{% endblock %}
{% block title %}Register{% endblock %}

{% block headline %}Register{% endblock %}

{% block content %}
    <form class="form" action="" method="post" id="registerform">
        <div class="form_wrapper">
            {% if data: %}
            <div class="credentials">
                <div class="manual_input">
                    <p class="input_hint">Name:</p>
                    <input class="input_field" type="text" name="name" value="{{ data["name"] }}">
                </div>
                <div class="manual_input">
                    <p class="input_hint">Surname:</p>
                    <input class="input_field" type="text" name="surname" value="{{ data["surname"] }}">
                </div>
                <div class="manual_input">
                    <p class="input_hint">Email:</p>
                    <input class="input_field" type="text" name="email" value="{{ data["email"] }}" placeholder="name@example.com">
                </div>
            </div>
            <div class="password">
                <div class="manual_input">
                    <p class="input_hint">Password:</p>
                    <input class="input_field" type="password" name="password">
                </div>
                <div class="manual_input">
                    <p class="input_hint">Retype Password:</p>
                    <input class="input_field" type="password" name="password_re">
                </div>
            </div>
            {% else: %}
            <div class="credentials">
                <div class="manual_input">
                    <p class="input_hint">Name:</p>
                    <input class="input_field" type="text" name="name">
                </div>
                <div class="manual_input">
                    <p class="input_hint">Surname:</p>
                    <input class="input_field" type="text" name="surname">
                </div>
                <div class="manual_input">
                    <p class="input_hint">Email:</p>
                    <input class="input_field" type="text" name="email" placeholder="name@example.com">
                </div>
            </div>
            <div class="password">
                <div class="manual_input">
                    <p class="input_hint">Password:</p>
                    <input class="input_field" type="password" name="password">
                </div>
                <div class="manual_input">
                    <p class="input_hint">Retype Password:</p>
                    <input class="input_field" type="password" name="password_re">
                </div>
            </div>
            {% endif %}
        </div>
        <div class="text_links">
            <p>Allready have an account? </p><a class="text_link" href="{{ url_for('sec.login') }}">Login!</a>
        </div>
        <div class="buttons">
            <input class="button" type="submit" name="register" value="Register" form=registerform>
            <input class="secondary_button" type="submit" name="use_as_guest" value="Use as Guest" form=registerform>
        </div>
    </form>
{% endblock %}
