{% load i18n aldryn_forms_tags %}

{% if field %}
    {% comment %}
    {# available conditions #}
    {% if field.field.required %} required{% endif %}
    {% if field.errors %} error{% endif %}
    {% endcomment %}

    <label for="{{ field.id_for_label }}">
        {{ field.label }}
        {% if field.field.required %}
            <abbr title="{% trans "Required field" %}">*</abbr>
        {% endif %}
    </label>

    {% render_form_widget field class=instance.custom_classes %}

    {% if field.errors %}
        <ul class="errormessages">
            {% for error in field.errors %}
                <li>{{ error }}</li>
            {% endfor %}
        </ul>
    {% endif %}

    {% if field.help_text %}
        <p class="help-text">{{ field.help_text }}</p>
    {% endif %}
{% endif %}
