navbar.html.twig 7.0 KB

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