<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<title>{% block title %}Bienvenue{% endblock %}</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Raleway:ital,wght@0,400;0,600;0,700;0,800;0,900;1,400;1,600;1,700;1,800;1,900&display=swap" rel="stylesheet">
{{ encore_entry_link_tags('stylesheets') }}
{% block stylesheets %}{% endblock %}
</head>
<body>
{% set currentUserRoleModifier = null %}
{% if app.user %}
{% if 'ROLE_ADMIN' in app.user.roles or 'ROLE_ADMIN_READ_ONLY' in app.user.roles %}
{% set currentUserRoleModifier = 'is-admin' %}
{% include('_partials/nav/admin.html.twig') %}
{% elseif 'ROLE_COMPANY' in app.user.roles %}
{% set currentUserRoleModifier = 'is-company' %}
{% include('_partials/nav/company.html.twig') %}
{% else %}
{% include('_partials/nav/user.html.twig') %}
{% endif %}
{% else %}
{% include('_partials/nav/main.html.twig') %}
{% endif %}
{% if app.user %}
<div class="current-logged-in-user-role {{ currentUserRoleModifier }}">
Connecté en tant
{% if 'ROLE_ADMIN' in app.user.roles %}
qu'administrateur
{% elseif 'ROLE_ADMIN_READ_ONLY' in app.user.roles %}
qu'agent de la DEAL
{% elseif 'ROLE_COMPANY' in app.user.roles %}
qu'élagueur
{% else %}
qu'utilisateur
{% endif %}
</div>
{% endif %}
{% include '_partials/message.html.twig' %}
{% include '_partials/message-popup.html.twig' %}
{% block body %}{% endblock %}
{% include('_partials/footer.html.twig') %}
{{ encore_entry_script_tags('scripts') }}
{% block javascripts %}{% endblock %}
<script>
const googleApiKey = '{{ GOOGLE_API_KEY }}'
let onlyRead = false
{% if app.user and 'ROLE_ADMIN_READ_ONLY' in app.user.roles %}
onlyRead = true
{% endif %}
</script>
</body>
</html>