{% load widget_tweaks base %}

<div class="form-group row {{ classes }}">
    <label class="col-{{ label_rows|default:3 }} col-form-label">{{ input.label }}:</label>
    <div class="input-group col-{{ input_rows|default:6 }}">
        {% assign_variable "form-control" as form_classes %}

        {% if not placeholder %}
            {% assign_variable input.label as placeholder %}
        {% endif %}

        {% if input_classes %}
        {% add_string form_classes " " input_classes as form_classes %}
        {% endif %}

        {% if form.is_bound %}
            {% if errors %}
                {% assign_variable "is-invalid" as validation_class %}
            {% else %}
                {% assign_variable "is-valid" as validation_class %}
            {% endif %}
        {% else %}
            {% assign_variable "" as validation_class %}
        {% endif %}
        {% add_string form_classes " " validation_class as form_classes_with_validation %}

        {% render_field input class+=form_classes_with_validation placeholder+=placeholder %}

        {% include "backoffice/includes/help_field.html" with form=form form_field=form.contact valid_feedback=valid_feedback mutex_text=mutex_text only %}
        {% if create_url and pk %}
        <div class="input-group-append">
            <a href="{% url create_url user_pk=pk %}" class="input-group-text">
                <i class="la la-plus"></i>
            </a>
        </div>
        {% endif %}
    </div>
</div>