{% extends 'manage/users/master.twig' %}
{% from 'macros.twig' import container_title %}
{% from 'manage/macros.twig' import permissions_table %}

{% block manage_content %}
    <div class="container container--lazy">
        {{ container_title('<i class="fas fa-calculator fa-fw"></i> Permission Calculator') }}

        Remove this when the permission manager exists.

        {% if calculated_perms is defined %}
            <table border="1">
                <tr>
                    <th style="padding: 2px 5px;">Category</th>
                    <th style="padding: 2px 5px;">Allow</th>
                    <th style="padding: 2px 5px;">Deny</th>
                </tr>
                {% for key, value in calculated_perms %}
                <tr>
                    <th style="padding: 2px 5px;">{{ key }}</th>
                    <td style="padding: 2px 5px;"><code>{{ value.allow }}</code></td>
                    <td style="padding: 2px 5px;"><code>{{ value.deny }}</code></td>
                </tr>
                {% endfor %}
            </table>
        {% endif %}

        <form method="post" action="">
            {{ permissions_table(perms_lists, perms_infos) }}
            <button class="input__button">Calculate</button>
        </form>
    </div>
{% endblock %}
