{% load i18n %}
<div class="modal-content" id="htmx-modal-content">
<div class="modal-header">
    <h5 class="modal-title">
        {% if context_type == "endpoint" %}
            {% blocktrans %}Combined Filters for Endpoint: {{ object.name }}{% endblocktrans %}
            <br>
            <small class="text-muted">
                {% trans "Endpoint:" %} {{ object.endpoint }} |
                {% trans "Sync:" %} {{ sync.name }} (ID: {{ sync.pk }})
            </small>
        {% elif context_type == "endpoint_all" %}
            {% blocktrans %}All Filters for Endpoint: {{ object.name }}{% endblocktrans %}
            <br>
            <small class="text-muted">
                {% trans "Endpoint:" %} {{ object.endpoint }}
            </small>
        {% else %}
            {% blocktrans %}Combined Expressions - {{ object.name }}{% endblocktrans %}
            <small class="text-muted">(ID: {{ object.pk }})</small>
        {% endif %}
    </h5>
    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
    <div class="row mb-3">
        <div class="col-12">
            <div class="card">
                <h5 class="card-header">
                    {% if context_type == "endpoint" or context_type == "endpoint_all" %}
                        {% trans "Combined Filters" %}: {{ object.endpoint }}
                    {% else %}
                        {% trans "Merged Filter Expressions for filter type" %}: {{ object.filter_type|upper }}
                    {% endif %}
                </h5>
                <div class="card-body">
                    {% if is_empty %}
                        <div class="alert alert-info" role="alert">
                            <i class="mdi mdi-information"></i>
                            {% if context_type == "endpoint" %}
                                {% trans "No filters are applied to this endpoint in this sync." %}
                            {% elif context_type == "endpoint_all" %}
                                {% trans "No filters are using this endpoint." %}
                            {% else %}
                                {% trans "No expressions defined for this filter." %}
                            {% endif %}
                        </div>
                    {% else %}
                        <pre>{{ combined_expressions | json }}</pre>
                    {% endif %}
                </div>
            </div>
      </div>
    </div>
</div>

<div class="modal-footer">
</div>
</div>
