{#  -*- coding: utf-8 -*- #}
{% extends 'base.tmpl' %}

{% block content %}
<h1>{{ title|e }}</h1>
{% if cat_items %}
    {% if items %}
        <h2>{{ messages("Categories") }}</h2>
    {% endif %}
    {% for text, full_name, path, link, indent_levels, indent_change_before, indent_change_after in cat_hierarchy %}
        {% for i in range(indent_change_before) %}
            <ul class="list-inline">
        {% endfor %}
        <li class="list-inline-item"><a class="reference badge badge-secondary" href="{{ link }}">{{ text|e }}</a>
        {% if indent_change_after <= 0 %}
            </li>
        {% endif %}
        {% for i in range(-indent_change_after) %}
            </ul>
            {% if i + 1 < indent_levels|length %}
                </li>
            {% endif %}
        {% endfor %}
    {% endfor %}
    {% if items %}
        <h2>{{ messages("Tags") }}</h2>
    {% endif %}
{% endif %}
{% if items %}
    <ul class="list-inline">
    {% for text, link in items %}
        {% if text not in hidden_tags %}
            <li class="list-inline-item"><a class="reference badge badge-secondary" href="{{ link }}">{{ text|e }}</a></li>
        {% endif %}
    {% endfor %}
    </ul>
{% endif %}
{% endblock %}
