{% extends '::layout.html.twig' %}

{% block title %}
    Contact
{% endblock %}

{% block head %}
    <script src="{{ asset('js/jqBootstrapValidation.js') }}"></script>
    <script src="{{ asset('js/contact_me.js') }}"></script>

    <!-- Custom styles for login/register/contact/upload template -->
    <link href="{{ asset('css/forms.css') }}" rel="stylesheet">
{% endblock %}

{% block activeHome %}
    class=""
{% endblock %}
{% block activeWhatsOpenData %}
    class=""
{% endblock %}
{% block activeLegalInformation %}
    class=""
{% endblock %}
{% block activeContact %}
    class="active"
{% endblock %}

{% block content %}
    <div class="container">

        {% for label, flashes in app.session.flashbag.all %}
            {% for flash in flashes %}
                <div class="alert alert-success">
                    {{ flash }}
                </div>
            {% endfor %}
        {% endfor %}

        <form action="{{ path("contact") }}" class="form-signin" role="form" id="contact" method="POST">

            <h2 class="form-signin-heading">Contact form</h2>

            {{ form_widget(form.fullName, { 'attr': {
            'id' : 'full_name',
            'name' : 'full_name',
            'class' : 'form-control',
            'placeholder' : 'Full name',
            'autofocus' : ''
            } }) }}

            {% if form_errors(form.fullName) %}
                <div class="alert alert-danger">{{ form_errors(form.fullName) }}</div>
            {% endif %}

            {{ form_widget(form.email, { 'attr': {
            'id' : 'email',
            'name' : 'email',
            'class' : 'form-control',
            'placeholder' : 'Email address'
            } }) }}

            {% if form_errors(form.email) %}
                <div class="alert alert-danger">{{ form_errors(form.email) }}</div>
            {% endif %}

            {{ form_widget(form.subject, { 'attr': {
            'id' : 'subject',
            'name' : 'subject',
            'class' : 'form-control',
            'placeholder' : 'Subject',
            } }) }}

            {% if form_errors(form.subject) %}
                <div class="alert alert-danger">{{ form_errors(form.subject) }}</div>
            {% endif %}

            {{ form_widget(form.message, { 'attr': {
            'id' : 'message',
            'name' : 'message',
            'class' : 'form-control',
            'placeholder' : 'Message',
            'rows' : 10
            } }) }}

            {% if form_errors(form.message) %}
                <div class="alert alert-danger">{{ form_errors(form.message) }}</div>
            {% endif %}

            <button class="btn btn-lg btn-primary btn-block" type="submit">Send</button>

            {{ form_rest(form) }}
        </form>

        <div style="margin-bottom: 20px"></div>
        <center><span class="label label-warning">All form fields are required.</span></center>

    </div> <!-- /container -->
{% endblock %}