navbar.html.twig 6.4 KB

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