{# Template for an "all-in-one" index. #}
{%- extends "layout.html" %}
{% set title = _('Index') %}
{% macro indexentries(firstname, links) %}
{%- if links -%}
{%- if links[0][0] %}{% endif -%}
{{ firstname|e }}
{%- if links[0][0] %}{% endif -%}
{%- for ismain, link in links[1:] -%}
, {% if ismain %}{% endif -%}
[{{ loop.index }}]
{%- if ismain %}{% endif -%}
{%- endfor %}
{%- else %}
{{ firstname|e }}
{%- endif %}
{% endmacro %}
{% block body %}
{{ _('Index') }}
{% for key, dummy in genindexentries -%}
{{ key }}
{% if not loop.last %}| {% endif %}
{%- endfor %}
{%- for key, entries in genindexentries %}
{{ key }}
{%- for column in entries|slice_index(2) if column %}
{%- for entryname, (links, subitems, _) in column %}
- {{ indexentries(entryname, links) }}
{%- if subitems %}
{%- for subentryname, subentrylinks in subitems %}
- {{ indexentries(subentryname, subentrylinks) }}
{%- endfor %}
{%- endif -%}
{%- endfor %}
{%- endfor %}
{% endfor %}
{% endblock %}
{% block sidebarrel %}
{% if split_index %}
{{ _('Index') }}
{% for key, dummy in genindexentries -%}
{{ key }}
{% if not loop.last %}| {% endif %}
{%- endfor %}
{% endif %}
{{ super() }}
{% endblock %}