navbar.html.twig 7.4 KB

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