{% if force_no_user is defined %}
    {% set with_user = ((app.user and force_no_user == false)  ? true : false)  %}
{% else %}
    {% set with_user = (app.user  ? true : false)  %}
{% endif %}


<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">

        <title>
            {% if with_user %}
                {{ 'admin.prefix'|trans({}, 'admin') }}{{ 'site.title'|trans({}, 'www') }} - 
            {% endif %}

            {% block title %}{{ 'site.title'|trans({}, 'www') }}{% endblock %}
        </title>

        <meta name="viewport" content="width=device-width, initial-scale=1" />

        {% block stylesheets %}
            {% if with_user %}
                {{ encore_entry_link_tags('app-with-user') }}
                <link href="{{ asset('build/vendor/datatables.net/v/bs5/jq-3.7.0/dt-2.0.2/datatables.min.css') }}" rel="stylesheet"/>
            {% else %}
                {{ encore_entry_link_tags('app-no-user') }}
            {% endif %}
        {% endblock %}

        {% block javascripts %}
            {% if with_user %}
                {{ encore_entry_script_tags('app-with-user') }}
            {% else %}
                {{ encore_entry_script_tags('app-no-user') }}
            {% endif %}
        {% endblock %}
        
        <link rel="preconnect" href="https://fonts.googleapis.com">
        <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
        {# <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans"> #}
        <link href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap" rel="stylesheet">
        <link href="https://fonts.googleapis.com/css2?family=Inconsolata:wght@200..900&display=swap" rel="stylesheet"
        >
        {% include "@IdeevCookieConsent/cookie_consent_styling.html.twig" %}
        {% include "includes/_favicon.html.twig" %}
    </head>
    <body>
        {{ render_esi(path('ideev_cookie_consent_show_if_cookie_consent_not_set')) }}

        {% if with_user %}

            {# menu #}

            <twig:MainSideBar user="{{app.user}}" />

            <!-- Page content holder -->
            <div class="page-content p-5" id="content">
    
                {% for message in app.flashes('error') %}
                    <div class="row">
                        <div class="alert alert-danger">{{ message }}</div>
                    </div>
                {% endfor %}
            
                {% for message in app.flashes('warning') %}
                    <div class="row">
                        <div class="alert alert-warning">{{ message }}</div>
                    </div>
                {% endfor %}
            
                {% for message in app.flashes('success') %}
                    <div class="row">
                        <div class="alert alert-success">{{ message }}</div>
                    </div>
                {% endfor %}
    
                <h4>{% block page_title %}{{ 'site.title'|trans({}, 'www') }}{% endblock %}</h4>
    
        {% else %}

            {% include "tools/includes/_header.html.twig" %}
            <div class="container">
        
        {% endif %}

        {# body #}

        {% block body %}
            <div class="alert alert-primary">{{ 'www.no-content'|trans({}, 'www') }}</div>
        {% endblock %}

        </div>

        {# footer #}

        {% if with_user %}

            {% block scripts_end_page %}
                <script src="{{ asset('build/vendor/datatables.net/v/bs5/jq-3.7.0/dt-2.0.2/datatables.min.js') }}"></script>
            {% endblock %}

        {% else %}

            {% include "tools/includes/_footer.html.twig" %}

        {% endif %}

    </body>

</html>
