navbar.html.twig 7.6 KB

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