{% extends "index.html" %}

{% block content %}

{% if not paginator %} 
    {% set paginator = section %}
{% endif %}

{% set path_array = current_path | split(pat="/") %}
{% set taxonomy = path_array[1] %}
{% set category = path_array[2] %}
{% if path_array | length < 3%}
{% set category = "All" %}
{% endif %}

<div class="mt-16 mx-auto max-w-screen-lg px-6 lg:px-8">
    {% include "partials/filter_bar.html" %}
    <div class="text-center main-title px-0 md:w-full">
        <div class="my-4 flex flex-col items-start">
            <h2 class="tracking-tight text-left text-3xl lg:text-5xl fw-500 leading-snug font-normal">
            {{category | replace(from='-', to=' ' ) | title}}
            </h2>
            <div class="text-xl text-gray-800">
                {{ paginator.total_pages ~ " People"}}
            </div>
        </div>

        <hr/>

        <div>
            <div class="mx-auto mt-4 grid max-w-2xl grid-cols-1 gap-x-4 gap-y-8 sm:grid-cols-2 lg:mx-0 lg:max-w-none lg:grid-cols-3 xl:grid-cols-4">
                {%- for page in paginator.pages %} 
                    {% include "partials/person_card.html" %} 
                {%- endfor %}
            </div>
            <hr class="mt-6" />
            <p class="text-center text-sm mt-2 mb-16">
              {% if paginator.previous %}
              <a
                class="border-transparent"
                aria-label="First page"
                href="{{ paginator.first }}"
                >{% include "partials/icons/svgPrevPageIcon.html" %}{% include
                "partials/icons/svgPrevPageIcon.html" %}</a
              >
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
              <a
                class="border-transparent"
                aria-label="Previous page"
                href="{{ paginator.previous }}"
                >{% include "partials/icons/svgPrevPageIcon.html" %}</a
              >
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {% else %} {%
              include "partials/icons/svgFirstPageIcon.html" %}{% include
              "partials/icons/svgFirstPageIcon.html" %}
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {% include
              "partials/icons/svgFirstPageIcon.html" %}
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {% endif %} {% if
              paginator.next %}
              <a
                class="border-transparent"
                aria-label="Next page"
                href="{{ paginator.next }}"
                >{% include "partials/icons/svgNextPageIcon.html" %}</a
              >
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
              <a
                class="border-transparent"
                aria-label="Last page"
                href="{{ paginator.last }}"
                >{% include "partials/icons/svgNextPageIcon.html" %}{% include
                "partials/icons/svgNextPageIcon.html" %}</a
              >
              {% else %} {% include "partials/icons/svgLastPageIcon.html" %}
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {% include
              "partials/icons/svgLastPageIcon.html" %}{% include
              "partials/icons/svgLastPageIcon.html" %} {% endif %}
            </p>
        </div>
    </div>

</div>

{% endblock content %}


