{% comment %}
# SPDX-License-Identifier: AGPL-3.0-or-later
{% endcomment %}

{% load i18n %}
{% load extras %}

{% block internal_zone_warning %}
  {% for component in firewall %}
    {% if not component.is_external %}
      <div class="alert alert-info d-flex align-items-center" role="alert">
        <div class="me-2">
          {% icon 'info-circle' %}
          <span class="visually-hidden">{% trans "Info:" %}</span>
        </div>
        <div>
          <div>
            {% blocktrans trimmed with service_name=component.name %}
              <em>{{ service_name }}</em> is available only on internal networks
              or when the client is connected to {{ box_name }} through VPN.
            {% endblocktrans %}
          </div>
          <div>
            {% with interfaces=component.get_internal_interfaces %}
              {% if not interfaces %}
                {% blocktrans trimmed %}
                  Currently there are no network interfaces configured as
                  internal.
                {% endblocktrans %}
              {% else %}
                {% blocktrans trimmed with interface_list=interfaces|join:", " %}
                  Currently the following network interfaces are configured as
                  internal: {{ interface_list }}
                {% endblocktrans %}
              {% endif %}
            {% endwith %}
          </div>
        </div>
      </div>
    {% endif %}
  {% endfor %}
{% endblock %}
