{% extends 'simpel_pages/base.html' %}
{% load i18n pages_tags %}

{% block breadcrumb-items %}
  <li class="breadcrumb-item"><a href="{% current_homepage %}">{% trans "Home" %}</a></li>
  <li class="breadcrumb-item"><a href="{% url 'serve_category' %}">{% trans "Category" %}</a></li>
  {% for item in object.get_ancestors %}
    <li class="breadcrumb-item">
      <a href="{{ item.get_absolute_url }}">{{ item|truncatechars:60 }}</a>
    </li>
  {% endfor %}
  <li class="breadcrumb-item active" aria-current="page">{{ object }}</li>
{% endblock breadcrumb-items %}

{% block main_content %}
<h1>{{ object|title }}</h1>
{% if object.description %}
  <div>{{ object.description|safe }}</div>
{% endif %}
<div class="py-2">
  <strong>{% trans "Back to" %}</strong>:
  <a href="{% url 'serve_category' %}">{% trans "Category Index" %}</a>
</div>
<div class="my-3 border-bottom"></div>
<div>
  {% if object_list.count %}
    <div class="row">
      {% for page in object_list %}
        <div class="col-lg-6">
          {% include 'simpel_pages/includes/page.html' with page=page %}
        </div>
      {% endfor %}
    </div>
  {% else %}
    {% include 'simpel_pages/includes/no_results.html' %}
  {% endif %}
  {% if is_paginated %}
    {% include 'simpel_pages/includes/pagination.html' %}
  {% endif %}
</div>
{% endblock %}
