{% 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="category-list">
  <div class="category-glimpse-list">
    {% 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.category %}
        {% include "courses/cms/fragment_category_glimpse.html" with category=page.category category_variant="glimpse" %}
      {% endif %}
    {% empty %}
      <p class="category-glimpse-list category-glimpse-list--empty">
      {% trans "No categories" %}
      </p>
    {% endfor %}

    {% if object_list %}
        {% include "richie/pagination.html" %}
    {% endif %}

  </div>
</div>
{% endblock content %}
