{% extends "layout.html" %}
{% block content %}
<div class="{{ theme.userInputDivClass }}" style="{{ theme.userInputFormColor }}">
    <form method="POST" action="">
        {{ form.hidden_tag() }}
        <fieldset class="form-group">
            <legend class="border-bottom mb-4">{{ title }}</legend> 
            <div class="form-group">
            {% for item in form %}
            <div class="form-group">
                {% if item.id == "submit" %}
                {% elif item.id == "submit_to_element" %}
                {% elif item.id == "csrf_token" %}
                {% else %} 
                    {{ item.label(class="form-control-label") }}
                    {% if item.errors %}
                        {{ item(class="form-control form-control-lg is-invalid") }}
                        <div class="invalid-feedback">
                            {% for error in item.errors %}
                                <span>{{ error }}</span>
                            {% endfor %}
                        </div>
                    {% else %}
                        {{ item(class="form-control form-control-lg") }}
                    {% endif %}
                {% endif %}
            </div>
            {% endfor %}
        </fieldset>
        <!-- Submit Button -->
        <div class="form-group">
            {{ form.submit(class="btn btn-outline-success") }}
            {{ form.submit_to_element(class="btn btn-outline-info") }}
            <a type="button" class="btn btn-secondary" href="{{ url_for('company.select_company') }}">Back to company selection</a>
        </div>
    </form>
</div>
{% endblock content %}

