templates/base.html.twig line 50

Open in your IDE?
  1. <!DOCTYPE html>
  2. <html lang="fr">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>{% block title %}Bienvenue{% endblock %}</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1">
  7. <link rel="preconnect" href="https://fonts.googleapis.com">
  8. <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
  9. <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">
  10. {{ encore_entry_link_tags('stylesheets') }}
  11. {% block stylesheets %}{% endblock %}
  12. </head>
  13. <body>
  14. {% set currentUserRoleModifier = null %}
  15. {% if app.user %}
  16. {% if 'ROLE_ADMIN' in app.user.roles or 'ROLE_ADMIN_READ_ONLY' in app.user.roles %}
  17. {% set currentUserRoleModifier = 'is-admin' %}
  18. {% include('_partials/nav/admin.html.twig') %}
  19. {% elseif 'ROLE_COMPANY' in app.user.roles %}
  20. {% set currentUserRoleModifier = 'is-company' %}
  21. {% include('_partials/nav/company.html.twig') %}
  22. {% else %}
  23. {% include('_partials/nav/user.html.twig') %}
  24. {% endif %}
  25. {% else %}
  26. {% include('_partials/nav/main.html.twig') %}
  27. {% endif %}
  28. {% if app.user %}
  29. <div class="current-logged-in-user-role {{ currentUserRoleModifier }}">
  30. Connecté en tant
  31. {% if 'ROLE_ADMIN' in app.user.roles %}
  32. qu'administrateur
  33. {% elseif 'ROLE_ADMIN_READ_ONLY' in app.user.roles %}
  34. qu'agent de la DEAL
  35. {% elseif 'ROLE_COMPANY' in app.user.roles %}
  36. qu'élagueur
  37. {% else %}
  38. qu'utilisateur
  39. {% endif %}
  40. </div>
  41. {% endif %}
  42. {% include '_partials/message.html.twig' %}
  43. {% include '_partials/message-popup.html.twig' %}
  44. {% block body %}{% endblock %}
  45. {% include('_partials/footer.html.twig') %}
  46. {{ encore_entry_script_tags('scripts') }}
  47. {% block javascripts %}{% endblock %}
  48. <script>
  49. const googleApiKey = '{{ GOOGLE_API_KEY }}'
  50. let onlyRead = false
  51. {% if app.user and 'ROLE_ADMIN_READ_ONLY' in app.user.roles %}
  52. onlyRead = true
  53. {% endif %}
  54. </script>
  55. </body>
  56. </html>