{#- Catalogue of subordinate organisations on an authority's home page (docs/stage2.md «Каталог подведомственных организаций»). Expects (set by blocks/portal-home.html): p_kids (site.children), p_auths (children of kind authority), p_kinds (list of [kind, count] for the other children, in display order). Subordinate authorities are cards with the number of organisations below them; organisations are compact rows grouped by kind, with a jump list when there are several groups. -#} {% set groups_n = p_kinds|length + (1 if p_auths else 0) %}

{{ t('portal.catalogue') }}

{% if groups_n > 1 %} {% endif %}
{% if p_auths %}

{% set icon = 'authority' %}{% set icon_cls = '' %}{% include "blocks/icon.html" %}{{ t('portal.kinds.authority') }}{{ p_auths|length }}

{% endif %} {% for k in p_kinds %} {% set members = p_kids|selectattr('kind', 'eq', k[0])|list %}

{% set icon = k[0] %}{% set icon_cls = '' %}{% include "blocks/icon.html" %}{% if k[0] in ['school', 'kindergarten', 'college'] %}{{ t('portal.kinds.' ~ k[0]) }}{% else %}{{ members[0].kind_label }}{% endif %}{{ k[1] }}

{% endfor %} {% if not p_kids %} {% set empty_text = t('portal.empty') %}{% include "blocks/empty-state.html" %} {% endif %}