{% load wagtailadmin_tags i18n %}
<div class="field {{ field|fieldtype }} {{ field|widgettype }} {{ field_classes }}" {% if include_contentpath|default_if_none:True %}data-contentpath="{{ field.name }}"{% endif %}>
    {% if show_label|default_if_none:True %}{{ field.label_tag }}{% endif %}
    <div class="field-content">
        <div class="input">
            {% if icon %}
                {% icon name=icon %}
            {% endif %}
            {% block form_field %}
                {{ field|render_with_errors }}
            {% endblock %}

            {# This span only used on rare occasions by certain types of input #}
            <span></span>
        </div>
        {% if show_help_text|default_if_none:True and field.help_text %}
            <p class="help">{{ field.help_text }}</p>
        {% endif %}

        {% if field|has_unrendered_errors %}
            <p class="error-message">
                {% for error in field.errors %}
                    <span>{{ error|escape }}</span>
                {% endfor %}
            </p>
        {% endif %}
    </div>

    {% if show_add_comment_button %}
        <div class="field-comment-control">
            <button type="button" data-component="add-comment-button" data-comment-add class="u-hidden" aria-label="{% trans 'Add comment' %}">
                <svg class="icon icon-comment-add initial icon-default" aria-hidden="true"><use href="#icon-comment-add"></use></svg>
                <svg class="icon icon-comment-add initial icon-reversed" aria-hidden="true"><use href="#icon-comment-add-reversed"></use></svg>
            </button>
        </div>
    {% endif %}
</div>
