<div class="contact container">

    <h1>{{ page.title }}</h1>

    {% if section.settings.text != blank %}
        <div class="contact-info" style="margin-bottom: 25px;">
            <p>{{ section.settings.text }}</p>
        </div>
    {% endif %}

    {% form 'contact' %}
        {% if form.posted_successfully? %} <h2>{{ 'general.contact.success' | t }}</h2> {% endif %}

        {{ form.errors | default_errors }}

        <label class="h5" for="ContactFormName">{{ 'general.contact.name' | t }}</label>
        <input class="font-body" type="text" id="ContactFormName" name="contact[name]">

        <label class="h5" for="ContactFormEmail">{{ 'general.contact.email' | t }}</label>
        <input class="font-body" type="email" id="ContactFormEmail" name="contact[email]">

        <label class="h5" for="ContactFormPhone">{{ 'general.contact.phone' | t }}</label>
        <input class="font-body" type="tel" id="ContactFormPhone" name="contact[phone]">

        {% if section.settings.field_name_1 != blank %}
            <label class="h5">{{ section.settings.field_label_1 }}</label>
            <input class="font-body" type="text" name="contact[{{ section.settings.field_name_1 }}]">
        {% endif %}

        {% if section.settings.field_name_2 != blank %}
            <label class="h5">{{ section.settings.field_label_2 }}</label>
            <input class="font-body" type="text" name="contact[{{ section.settings.field_name_2 }}]">
        {% endif %}

        {% if section.settings.field_name_3 != blank %}
            <label class="h5">{{ section.settings.field_label_3 }}</label>
            <input class="font-body" type="text" name="contact[{{ section.settings.field_name_3 }}]">
        {% endif %}

        <label class="h5" for="ContactFormMessage">{{ 'general.contact.message' | t }}</label>
        <textarea class="font-body" rows="10" id="ContactFormMessage" name="contact[body]"></textarea>

        <input type="submit" value="{{ 'general.contact.submit' | t }}" class="btn">
    {% endform %}

</div>

{% schema %}
{
    "name": "t:sections.page-contact.name",
    "settings": [
        {
            "type": "richtext",
            "id": "text",
            "label": "t:sections.page-contact.settings.text"
        },
        {
            "type": "header",
            "content": "t:sections.page-contact.settings.header_1"
        },
        {
            "type": "text",
            "id": "field_name_1",
            "label": "t:sections.page-contact.settings.name"
        },
        {
            "type": "text",
            "id": "field_label_1",
            "label": "t:sections.page-contact.settings.label"
        },
        {
            "type": "header",
            "content": "t:sections.page-contact.settings.header_2"
        },
        {
            "type": "text",
            "id": "field_name_2",
            "label": "t:sections.page-contact.settings.name"
        },
        {
            "type": "text",
            "id": "field_label_2",
            "label": "t:sections.page-contact.settings.label"
        },
        {
            "type": "header",
            "content": "t:sections.page-contact.settings.header_3"
        },
        {
            "type": "text",
            "id": "field_name_3",
            "label": "t:sections.page-contact.settings.name"
        },
        {
            "type": "text",
            "id": "field_label_3",
            "label": "t:sections.page-contact.settings.label"
        }
    ]
}
{% endschema %}