navbar.html.twig 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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. <li class="nav-item">
  15. <a class="nav-link
  16. {% if app.request.attributes.get('_route') == 'prochaines_sorties' %}active{% endif %}"
  17. href="{{ path('prochaines_sorties') }}">Prochaines sorties</a>
  18. </li>
  19. <li class="nav-item">
  20. <a class="nav-link
  21. {% if app.request.attributes.get('_route') == 'app_page_show' %}active{% endif %}"
  22. href="{{path('app_page_show', {'name': 'about'}) }}">A propos</a>
  23. </li>
  24. </ul>
  25. {% endif %}
  26. {% if is_granted('IS_AUTHENTICATED_REMEMBERED') %}
  27. <ul class="navbar-nav me-auto mb-2 mb-lg-0">
  28. <li class="nav-item">
  29. <a class="nav-link
  30. {% if app.request.attributes.get('_route') == 'videothequepersonnelle_maliste' %}active{% endif %}"
  31. href="{{ path('videothequepersonnelle_maliste') }}">Ma liste à voir</a>
  32. </li>
  33. <li class="nav-item">
  34. <a class="nav-link
  35. {% if app.request.attributes.get('_route') == 'videotheque_liste' %}active{% endif %}"
  36. href="{{ path('videotheque_liste') }}">Films</a>
  37. </li>
  38. <li class="nav-item">
  39. <a class="nav-link
  40. {% if app.request.attributes.get('_route') == 'prochaines_sorties' %}active{% endif %}"
  41. href="{{ path('prochaines_sorties') }}">Prochaines sorties</a>
  42. </li>
  43. <li class="nav-item">
  44. <a class="nav-link
  45. {% if app.request.attributes.get('_route') == 'realisateur_liste' %}active{% endif %}"
  46. href="{{ path('realisateur_liste') }}">Réalisateurs</a>
  47. </li>
  48. {% if is_granted('ROLE_MODERATEUR') %}
  49. <ul class="navbar-nav">
  50. <li class="nav-item dropdown">
  51. <a class="nav-link dropdown-toggle" href="#" id="navbarDropdownAdmin" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  52. Administration
  53. </a>
  54. <div class="dropdown-menu" aria-labelledby="navbarDropdown">
  55. {% if is_granted('ROLE_ADMIN') %}
  56. <a class="dropdown-item" href="{{ path('admin_index') }}">Utilisateurs</a>
  57. <div class="dropdown-divider"></div>
  58. {% endif %}
  59. <a class="dropdown-item" href="{{ path('genre_liste') }}">Liste des genres</a>
  60. </div>
  61. </li>
  62. </ul>
  63. {% endif %}
  64. <li class="nav-item">
  65. <a class="nav-link
  66. {% if app.request.attributes.get('_route') == 'app_page_show' %}active{% endif %}"
  67. href="{{path('app_page_show', {'name': 'about'}) }}">A propos</a>
  68. </li>
  69. </ul>
  70. {% endif %}
  71. <ul class="navbar-nav">
  72. <li class="nav-item">
  73. <form class="me-auto" action="{{ path('search_recherche') }}">
  74. <div class="input-group">
  75. <input class="form-control mr-sm-2" name="q" type="text" placeholder="Rechercher" aria-label="Rechercher">
  76. <button class="btn btn-outline-success my-2 my-sm-0" type="submit">Go</button>
  77. </div>
  78. </form>
  79. </li>
  80. </ul>
  81. <ul class="navbar-nav">
  82. <li class="nav-item">
  83. <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>
  84. <li>
  85. </ul>
  86. {% if is_granted('IS_AUTHENTICATED_REMEMBERED') %}
  87. <ul class="navbar-nav">
  88. <li class="nav-item dropdown">
  89. <a class="nav-link dropdown-toggle" href="#" id="navbarHelpDropdown" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  90. <i class="fa fa-question-circle fa-lg"></i>
  91. </a>
  92. <div class="dropdown-menu dropdown-menu-end p-4" aria-labelledby="navbarHelpDropdown" style="width: 400px;">
  93. <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>
  94. <p><i class="fa fa-eye fa-lg text-success"></i> : Film qu'on a vu</p>
  95. <p><i class="fa fa-eye-slash fa-lg text-secondary"></i> : Film qu'on n'a pas vu</p>
  96. </div>
  97. </li>
  98. </ul>
  99. {% endif %}
  100. <ul class="navbar-nav">
  101. <li class="nav-item dropdown">
  102. <a class="nav-link dropdown-toggle" href="#" id="navbarBellDropdown" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  103. <i class="fa fa-bell fa-lg"></i>
  104. </a>
  105. <div class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarBellDropdown" style="width: 400px;">
  106. <div class="list-group px-4 py-3">
  107. {{ afficheNouveautes() | raw }}
  108. </div>
  109. </div>
  110. </li>
  111. </ul>
  112. {#{% if is_granted('IS_AUTHENTICATED_REMEMBERED') %}#}
  113. {#{% endif %}#}
  114. {% if not is_granted('IS_AUTHENTICATED_REMEMBERED') %}
  115. <ul class="navbar-nav">
  116. <li class="nav-item"><a class="nav-link" href="{{ path('app_login') }}">Se connecter</a></li>
  117. </ul>
  118. {% else %}
  119. <ul class="navbar-nav">
  120. <li class="nav-item dropdown">
  121. <a class="nav-link dropdown-toggle" href="#" id="navbarUserDropdown" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  122. {{ app.user.nomComplet }}
  123. </a>
  124. <div class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarUserDropdown">
  125. <a class="dropdown-item" href="{{ path('user_profil') }}"><i class="fa fa-user"></i> Profil</a>
  126. <a class="dropdown-item" href="{{ path('user_preferences') }}"><i class="fa fa-cog"></i> Préférences</a>
  127. <div class="dropdown-divider"></div>
  128. <a class="dropdown-item" href="{{ path('app_logout') }}"><i class="fa fa-sign-out"></i> Se déconnecter</a>
  129. </div>
  130. </li>
  131. </ul>
  132. {% endif %}
  133. </div>
  134. </nav>