navbar.html.twig 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
  2. <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
  3. <span class="navbar-toggler-icon"></span>
  4. </button>
  5. <a class="navbar-brand" href="{{ path('videotheque_liste') }}">Videothèque</a>
  6. <div class="collapse navbar-collapse" id="navbarSupportedContent">
  7. {% if not is_granted('IS_AUTHENTICATED_REMEMBERED') %}
  8. <ul class="navbar-nav me-auto mb-2 mb-lg-0">
  9. <li class="nav-item">
  10. <a class="nav-link
  11. {% if app.request.attributes.get('_route') == 'videotheque_liste' %}active{% endif %}"
  12. href="{{ path('videotheque_liste') }}">Liste des films</a>
  13. </li>
  14. </ul>
  15. {% endif %}
  16. {% if is_granted('IS_AUTHENTICATED_REMEMBERED') %}
  17. <ul class="navbar-nav me-auto mb-2 mb-lg-0">
  18. <li class="nav-item">
  19. <a class="nav-link
  20. {% if app.request.attributes.get('_route') == 'videothequepersonnelle_maliste' %}active{% endif %}"
  21. href="{{ path('videothequepersonnelle_maliste') }}">Ma liste à voir</a>
  22. </li>
  23. <li class="nav-item">
  24. <a class="nav-link
  25. {% if app.request.attributes.get('_route') == 'videotheque_liste' %}active{% endif %}"
  26. href="{{ path('videotheque_liste') }}">Films</a>
  27. </li>
  28. <li class="nav-item">
  29. <a class="nav-link
  30. {% if app.request.attributes.get('_route') == 'realisateur_liste' %}active{% endif %}"
  31. href="{{ path('realisateur_liste') }}">Réalisateurs</a>
  32. </li>
  33. {% if is_granted('ROLE_MODERATEUR') %}
  34. <ul class="navbar-nav">
  35. <li class="nav-item dropdown">
  36. <a class="nav-link dropdown-toggle" href="#" id="navbarDropdownAdmin" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  37. Administration
  38. </a>
  39. <div class="dropdown-menu" aria-labelledby="navbarDropdown">
  40. {% if is_granted('ROLE_ADMIN') %}
  41. <a class="dropdown-item" href="{{ path('admin_index') }}">Utilisateurs</a>
  42. <div class="dropdown-divider"></div>
  43. {% endif %}
  44. <a class="dropdown-item" href="{{ path('genre_liste') }}">Liste des genres</a>
  45. </div>
  46. </li>
  47. </ul>
  48. {% endif %}
  49. </ul>
  50. {% endif %}
  51. <ul class="navbar-nav">
  52. <li class="nav-item">
  53. <a href="#" class="nav-link" data-bs-toggle="modal" data-bs-target="#modalWindow"><i class="fa fa-info-circle fa-lg text-light nav-link" aria-hidden="true"></i></a>
  54. <li>
  55. </ul>
  56. <ul class="navbar-nav">
  57. <li class="nav-item dropdown">
  58. <a class="nav-link dropdown-toggle" href="#" id="navbarHelpDropdown" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  59. <i class="fa fa-question-circle fa-lg"></i>
  60. </a>
  61. {% if is_granted('IS_AUTHENTICATED_REMEMBERED') %}
  62. <div class="dropdown-menu dropdown-menu-end p-4" aria-labelledby="navbarHelpDropdown" style="width: 400px;">
  63. <p><i class="fa fa-bookmark fa-lg text-primary"></i> : Films que l'on souhaite voir. On les retrouve dans "Liste de mes films"</p>
  64. <p><i class="fa fa-eye fa-lg text-success"></i> : Film qu'on a vu</p>
  65. <p><i class="fa fa-eye-slash fa-lg text-secondary"></i> : Film qu'on n'a pas vu</p>
  66. </div>
  67. {% endif %}
  68. </li>
  69. </ul>
  70. <ul class="navbar-nav">
  71. <li class="nav-item dropdown">
  72. <a class="nav-link dropdown-toggle" href="#" id="navbarBellDropdown" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  73. <i class="fa fa-bell fa-lg"></i>
  74. </a>
  75. <div class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarBellDropdown" style="width: 400px;">
  76. <div class="list-group px-4 py-3">
  77. {{ afficheNouveautes() | raw }}
  78. </div>
  79. </div>
  80. </li>
  81. </ul>
  82. {#{% if is_granted('IS_AUTHENTICATED_REMEMBERED') %}#}
  83. {#{% endif %}#}
  84. {% if not is_granted('IS_AUTHENTICATED_REMEMBERED') %}
  85. <ul class="navbar-nav">
  86. <li class="nav-item"><a class="nav-link" href="{{ path('app_login') }}">Se connecter</a></li>
  87. </ul>
  88. {% else %}
  89. <ul class="navbar-nav">
  90. <li class="nav-item dropdown">
  91. <a class="nav-link dropdown-toggle" href="#" id="navbarUserDropdown" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  92. {{ app.user.nomComplet }}
  93. </a>
  94. <div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarUserDropdown">
  95. <a class="dropdown-item" href="{{ path('user_profil') }}">Profil</a>
  96. <div class="dropdown-divider"></div>
  97. <a class="dropdown-item" href="{{ path('app_logout') }}">Se déconnecter</a>
  98. </div>
  99. </li>
  100. </ul>
  101. {% endif %}
  102. </div>
  103. </nav>