{% extends "richie/fullwidth.html" %}
{% load cms_tags i18n pagination_tags %}

{% block subheader_content %}
<div class="subheader__container">
    <h1 class="subheader__title">{{ current_page.get_title }}</h1>
</div>
{% endblock subheader_content %}


{% block content %}
<div class="organization-list">
    <div class="organization-list__content">
        {% if current_page.publisher_is_draft %}
            {% autopaginate current_page.get_child_pages 100 as object_list %}
        {% else %}
            {% autopaginate current_page.get_child_pages.published.distinct 100 as object_list %}
        {% endif %}
        {% for page in object_list %}
            {% if page.organization %}
                {% include "courses/cms/fragment_organization_glimpse.html" with organization=page.organization organization_variant="card" %}
            {% endif %}
        {% empty %}
            <p class="organization-list__empty">{% trans "No organization yet" %}</p>
        {% endfor %}
    </div>
</div>
{% endblock content %}
