{% macro manage_navigation(nav) %}
    {% from 'macros.twig' import container_title %}

    {% for name, value in nav %}
        <div class="container manage__navigation">
            {{ container_title(name) }}

            <div class="manage__navigation__links">
                {% for title, link in value %}
                    <a href="{{ link }}" class="manage__navigation__link">{{ title }}</a>
                {% endfor %}
            </div>
        </div>
    {% endfor %}
{% endmacro %}

{% macro permissions_table(lists, infos, readonly) %}
    {% from '_layout/input.twig' import input_checkbox %}

    <div class="permissions">
        {% for list in lists %}
            <div class="permissions__line permissions__line--header">
                <div class="permissions__title">
                    {{ list.title }}
                </div>
                <div class="permissions__choice">
                    Yes
                </div>
                <div class="permissions__choice">
                    No
                </div>
                <div class="permissions__choice">
                    Never
                </div>
            </div>

            {% for perm in list.perms %}
                <div class="permissions__line">
                    <div class="permissions__title">
                        {{ perm.title }}
                    </div>
                    <div class="permissions__choice__wrapper">
                        {{ input_checkbox(perm.name, '', infos[perm.category].checkAllow(perm.value) ?? false, 'permissions__choice permissions__choice--radio permissions__choice--yes', 'yes', true, null, readonly) }}
                    </div>
                    <div class="permissions__choice__wrapper">
                        {{ input_checkbox(perm.name, '', infos[perm.category].checkNeutral(perm.value) ?? true, 'permissions__choice permissions__choice--radio permissions__choice--no', 'no', true, null, readonly) }}
                    </div>
                    <div class="permissions__choice__wrapper">
                        {{ input_checkbox(perm.name, '', infos[perm.category].checkDeny(perm.value) ?? false, 'permissions__choice permissions__choice--radio permissions__choice--never', 'never', true, null, readonly) }}
                    </div>
                </div>
            {% endfor %}
        {% endfor %}
    </div>
{% endmacro %}
