{% load i18n %}

{% if esi_endpoint_status %}
    <div class="row row-cols-1 row-cols-sm-2 row-cols-md-3 row-cols-xl-5">
        <!-- OK Routes -->
        {% translate "OK" as translated_header_green %}
        {% translate "These routes are working as expected." as translated_header_green_explanation %}
        {% include 'esistatus/partials/endpoints.html' with title=translated_header_green status="OK" explanation=translated_header_green_explanation data=esi_endpoint_status.OK with_details=True %}

        <!-- Degraded Routes -->
        {% translate "Degraded" as translated_header_yellow %}
        {% translate "These routes have a good chance of being slow or returning errors." as translated_header_yellow_explanation %}
        {% include 'esistatus/partials/endpoints.html' with title=translated_header_yellow status="Degraded" explanation=translated_header_yellow_explanation data=esi_endpoint_status.Degraded with_details=True %}

        <!-- Down Routes -->
        {% translate "Down" as translated_header_red %}
        {% translate "These routes have a good chance of not responding at all or being completely unavailable." as translated_header_red_explanation %}
        {% include 'esistatus/partials/endpoints.html' with title=translated_header_red status="Down" explanation=translated_header_red_explanation data=esi_endpoint_status.Down with_details=True %}

        <!-- Recovering Routes -->
        {% translate "Recovering" as translated_header_red %}
        {% translate "These routes are recovering from previous issues and might not (yet) work as expected or might be slow." as translated_header_red_explanation %}
        {% include 'esistatus/partials/endpoints.html' with title=translated_header_red status="Recovering" explanation=translated_header_red_explanation data=esi_endpoint_status.Recovering with_details=True %}

        <!-- Unknown Routes -->
        {% translate "Unknown" as translated_header_red %}
        {% translate "These routes have an unknown status." as translated_header_red_explanation %}
        {% include 'esistatus/partials/endpoints.html' with title=translated_header_red status="Unknown" explanation=translated_header_red_explanation data=esi_endpoint_status.Unknown with_details=True %}
    </div>

    {% if compatibility_date %}
        <div class="text-end">
            <p class="small mb-0">
                {% translate "ESI compatibility date" %}:
                <a
                    href="https://esi.evetech.net/meta/compatibility-dates"
                    target="_blank"
                    rel="noopener noreferer"
                >
                    {{ compatibility_date }}
                </a>
            </p>
        </div>
    {% endif %}
{% else %}
    <div class="aa-callout aa-callout-info">
        <p>{% translate "No ESI status data is available at this time." %}</p>
        <p>{% translate "Please try again later." %}</p>
    </div>
{% endif %}
