{% load idm_tags i18n %}
{% comment %}
Context variables:
    system - System instance,
    total_count - count of all inconsistencies,
    we_have_system_dont - roles, that we have, but system - dont,
    system_have_we_dont - roles, that system have, but we - dont,
    missed_logins - logins from system, that are not represented in our db.
{% endcomment %}

{% blocktrans with system_name=system.get_name %}Система "{{ system_name }}" заблокирована, так как выявлено большое количество расхождений{% endblocktrans %}: {{ total_count }}
{% if we_have_system_dont %}
    {% trans "В IDM есть, в системе отсутствуют роли" %}:
        {% for subject, nodes in we_have_system_dont %}{{ subject|who }} ({{ subject|ident }})
            {% for node in nodes %}{{ node.humanize }}
            {% endfor %}
        {% endfor %}{% endif %}

{% if system_has_we_dont %}
    {% trans "В системе есть, в IDM отсутствуют роли" %}:
        {% for subject, nodes in system_has_we_dont %}{{ subject|who }} ({{ subject|ident }})
            {% for node in nodes %}{{ node.humanize }}
            {% endfor %}
        {% endfor %}{% endif %}

{% if unknown_roles %}
    {% trans "В системе есть, в IDM отсутствуют роли, выданные на неизвестные IDM узлы дерева ролей:" %}
    {% for subject, inconsistencies in unknown_roles %}
        {{ subject|who }} ({{ subject|ident }})
            {% for inconsistency in inconsistencies %}{{ inconsistency.as_report|safe }}
            {% endfor %}
    {% endfor %}
{% endif %}

{% if unknown_usernames %}
    {% trans "Неизвестные IDM пользователи" %}:
        {{ unknown_usernames|join:", " }}
{% endif %}

{% if unknown_groups %}
    {% trans "Неизвестные IDM идентификаторы групп" %}:
        {{ unknown_groups|join:", " }}
{% endif %}
