<div class="{{ form_group_class }}">
    {% if check %}
        <div class="form-check">
            {{ field }}
            {% if show_label %}
                <label for="{{ field.id_for_label }}" class="form-check-label {% ifequal show_label 'sr-only' %}sr-only{% endifequal %}">{{ field.label }}</label>
            {% endif %}
        </div>
    {% else %}
        {% if show_label %}
            <label {% ifequal show_label 'sr-only' %}class="sr-only"{% endifequal %} for="{{ field.id_for_label }}">{{ field.label }}</label>
        {% endif %}
        {% if addon_before or addon_after %}
            <div class="input-group">
                {% if addon_before %}
                    <div class="input-group-prepend">
                        <span class="input-group-text">{{ addon_before }}</span>
                    </div>
                {% endif %}
                {{ field }}
                {% if addon_after %}
                    <div class="input-group-append">
                        <span class="input-group-text">{{ addon_after }}</span>
                    </div>
                {% endif %}
            </div>
        {% else %}
            {{ field }}
        {% endif %}
    {% endif %}
    {% if field.help_text %}
        <small class="form-text text-muted">{{ field.help_text }}</small>
    {% endif %}
    {% for error in field.errors %}
        <small class="form-text text-danger">{{ error }}</small>
    {% endfor %}
</div>
