{#
/**
 * Copyright © 2003-2024 The Galette Team
 *
 * This file is part of Galette (https://galette.eu).
 *
 * Galette is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Galette is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Galette. If not, see <http://www.gnu.org/licenses/>.
 */
#}
{% extends 'page.html.twig' %}

{% block content %}
    <h2>
        {{ name }} <code>{{ version }} - {{ date }}</code>
        <br/><span class="author">
            {{ _T("By %name")|replace({"%name": author}) }}
        </span>
    </h2>
    {% if module is defined %}
    <dl>
        <dt><strong>{{ _T('Name:') }}</strong></dt>
        <dd>{{ module.name }}</dd>
        <dt><strong>{{ _T('Description:') }}</strong></dt>
        <dd>{{ module.desc }}</dd>
        <dt><strong>{{ _T('Version:') }}</strong></dt>
        <dd>{{ module.version }}</dd>
        <dt><strong>{{ _T('Date:') }}</strong></dt>
        <dd>{{ module.date }}</dd>
        <dt><strong>{{ _T('Author:') }}</strong></dt>
        <dd>{{ module.author }}</dd>
        <dt><strong>{{ _T('Path:') }}</strong></dt>
        <dd>{{ module.root }}</dd>
        <dt><strong>{{ _T('Main route:') }}</strong></dt>
        <dd>{{ module.route }}</dd>
        <dt><strong>{{ _T('ACLs') }}</strong>
        <dd>
            <table>
                <thead>
                    <th>{{ _T('Route') }}</th>
                    <th>{{ _T('ACL') }}</th>
                </thead>
       {% for route, acl in module.acls %}
                <tr>
                    <td><code>{{ route }}</code></td>
                    <td><code>{{ acl }}</code></td>
                </tr>
        {% else %}
                <td colspan="2"><strong>{{ _T('No ACLs!') }}</strong></td>
        {% endfor %}
            </table>
        </dd>
    </dl>

    <h3>{{ _T('Raw information') }}</h3>
    <pre>{{ module|json_encode(constant('JSON_PRETTY_PRINT')) }}</pre>
    {% endif %}
{% endblock %}
