
{% load i18n widget_tweaks %}

<form method="post">

    {% csrf_token %}

    <div class="row">
        <div class="form-group m-b-10 col-md-6 {% if form.subject.errors %}has-error{% endif %}">
            {{ form.subject.label_tag }} <span class="text-danger">*</span>
            {{ form.subject|add_class:"form-control input-lg" }}
            {% if form.subject.errors %}
                <span class="help-block">{{ form.subject.errors }}</span>
            {% endif %}
        </div>

        <div class="form-group m-b-10 col-md-6 {% if form.name.errors %}has-error{% endif %}">
            {{ form.name.label_tag }} <span class="text-danger">*</span>
            {{ form.name|add_class:"form-control input-lg" }}
            {% if form.name.errors %}
                <span class="help-block">{{ form.name.errors }}</span>
            {% endif %}
        </div>
    </div>

    <div class="row">
        <div class="form-group m-b-10 col-md-6 {% if form.email.errors %}has-error{% endif %}">
            {{ form.email.label_tag }}
            {{ form.email|add_class:"form-control input-lg" }}
            {% if form.email.errors %}
                <span class="help-block">{{ form.email.errors }}</span>
            {% endif %}
        </div>

        <div class="form-group m-b-10 col-md-6 {% if form.mobile.errors %}has-error{% endif %}">
            {{ form.mobile.label_tag }}
            {{ form.mobile|add_class:"form-control input-lg" }}
            {% if form.mobile.errors %}
                <span class="help-block">{{ form.mobile.errors }}</span>
            {% endif %}
        </div>
    </div>

    <div class="form-group m-b-10 {% if form.text.errors %}has-error{% endif %}">
        {{ form.text.label_tag }} <span class="text-danger">*</span>
        {{ form.text|add_class:'form-control'|attr:"rows:6" }}
        {% if form.text.errors %}
            <span class="help-block">{{ form.text.errors }}</span>
        {% endif %}
    </div>

    <div class="form-group">
        {{ form.captcha }}
        {% if form.captcha.errors %}
            <p class="text-danger">{{ form.captcha.errors.as_text }}</p>
        {% endif %}
    </div>

    <button class="btn btn-lg btn-success" type="submit">
        <i class="fa fa-envelope"></i>
        {% trans 'Send message' %}
    </button>

</form>
