navbar.html.twig 6.4 KB

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