{% load widget_tweaks base %}

<div class="form-group row {{ classes }}" {% if hide %}style="display: none;"{% endif %}>
    <label class="col-{{ label_rows|default:3 }} col-form-label">{{ label|default:input.label }}:</label>
    <div class="col-{{ input_rows|default:6 }}">
        {% if input %}
            {% 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 %}

            <div class="input-group date">
                {% render_field input class+=form_classes_with_validation placeholder+=placeholder autocomplete+="off" %}
                <div class="input-group-append">
                    <span class="input-group-text"><i class="la la-calendar-check-o glyphicon-th"></i></span>
                </div>
            </div>

            {% if help_text %}
            <span class="form-text text-muted">{{ help_text }}</span>
            {% endif %}
            {% include "backoffice/includes/help_field.html" with form=form form_field=input valid_feedback=valid_feedback mutex_text=mutex_text only %}
        {% endif %}
    </div>
</div>