{% extends base %}
{% from 'macro.html' import breadcrumbs with context %}
{% block content %}

<div class="row">
    <div class="span8">
        {{- breadcrumbs() }}
        <h1>{{ page_title }}</h1>
        <div id="chapters-list">
            {% include "includes/chapters_excerpts.html" %}
        </div>
        {% if chapters %}
            <!-- Пагинация: начало вывода -->
                  <div id="chapters-pagination" class="pagination center">
                      {% if page_obj.has_previous() %}
                          <a class="btn" href="{{ modified_url(page=page_obj.number - 1) }}">← Назад</a>
                      {% endif %}
                      <span class="btn btn-primary">
                          {{ page_obj.number }} / {{ page_obj.num_pages }}
                      </span>
                      {% if page_obj.has_next() %}
                          <a class="btn" href="{{ modified_url(page=page_obj.number + 1) }}">Вперед →</a>
                      {% endif %}
                    </div>
               <!-- Пагинация: конец вывода -->
        {% endif %}
        {{- breadcrumbs() }}
    </div>
</div>
{% endblock %}
