<!DOCTYPE html>

{% load static %}

<html lang="fr">

    <head>
        <title>{% block title %}Grasse Mat'{% endblock title %}</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width"/>
        
        {% block head %}{% endblock head %}
    </head>

    <!-- To remove -->
    <div id="mq-test"></div>

    <body>
        <header id="principal-header">
            <nav id="website-navigation-box">
                {{ request.user }}
                <ul>
                    <li><a href="{% url "admin_home" %}">Administration</a></li>

                    <li><a href="{% url "handling_home" %}">Gestion</a></li>

                    {% for module_name, module_infos in BULB_ADDITIONAL_ADMIN_MODULES.items %}
                        <li><a href="{% url module_infos.home_view_url_name %}">{{ module_infos.printed_name }}</a></li>
                    {% endfor %}

                    <li><a href="{% url "admin_login" %}">Connexion</a></li> <!-- TODO : remove grasse mat links -->

                    <li>
                        <form action="{% url "admin_logout" %}" method="post" novalidate>
                            {% csrf_token %}

                            <input type="hidden" name="next" value="{{ request.path }}"/>

                            <input type="submit" value="Déconnexion"/>
                        </form>
                    </li>
                </ul>
            </nav>

            <h1>Administration Grasse Mat'</h1>

            <hr/>

            <nav id="administration-navigation-box">
                <a href="{% url "admin_home" %}">Administration</a>
                {% block administration_part_name %}{% endblock administration_part_name %}
            </nav>

            <hr/>
        </header>

        <main id="principal-main">{% block content %}No content.{% endblock content %}</main>

        {% if messages %}
            <ul id="messages-box">
                {% for message in messages %}
                    <li {% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
                {% endfor %}
            </ul>
        {% endif %}

        {% block scripts %}{% endblock scripts %}
    </body>

</html>