navbar.html.twig 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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. <ul class="navbar-nav">
  63. <li class="nav-item">
  64. <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>
  65. <li>
  66. </ul>
  67. {% if is_granted('IS_AUTHENTICATED_REMEMBERED') %}
  68. <ul class="navbar-nav">
  69. <li class="nav-item dropdown">
  70. <a class="nav-link dropdown-toggle" href="#" id="navbarHelpDropdown" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  71. <i class="fa fa-question-circle fa-lg"></i>
  72. </a>
  73. <div class="dropdown-menu dropdown-menu-end p-4" aria-labelledby="navbarHelpDropdown" style="width: 400px;">
  74. <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>
  75. <p><i class="fa fa-eye fa-lg text-success"></i> : Film qu'on a vu</p>
  76. <p><i class="fa fa-eye-slash fa-lg text-secondary"></i> : Film qu'on n'a pas vu</p>
  77. </div>
  78. </li>
  79. </ul>
  80. {% endif %}
  81. <ul class="navbar-nav">
  82. <li class="nav-item dropdown">
  83. <a class="nav-link dropdown-toggle" href="#" id="navbarBellDropdown" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  84. <i class="fa fa-bell fa-lg"></i>
  85. </a>
  86. <div class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarBellDropdown" style="width: 400px;">
  87. <div class="list-group px-4 py-3">
  88. {{ afficheNouveautes() | raw }}
  89. </div>
  90. </div>
  91. </li>
  92. </ul>
  93. {% if not is_granted('IS_AUTHENTICATED_REMEMBERED') %}
  94. <ul class="navbar-nav">
  95. <li class="nav-item"><a class="nav-link" href="{{ path('app_login') }}">Se connecter</a></li>
  96. </ul>
  97. {% else %}
  98. <ul class="navbar-nav">
  99. <li class="nav-item dropdown">
  100. <a class="nav-link dropdown-toggle" href="#" id="navbarUserDropdown" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  101. {{ app.user.nomComplet }}
  102. </a>
  103. <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarUserDropdown">
  104. <li><a class="dropdown-item" href="{{ path('user_profil') }}"><i class="fa fa-user"></i> Profil</a></li>
  105. <li><a class="dropdown-item" href="{{ path('user_preferences') }}"><i class="fa fa-cog"></i> Préférences</a></li>
  106. <li><hr class="dropdown-divider"></li>
  107. <li><a class="dropdown-item" href="{{ path('app_logout') }}"><i class="fa fa-sign-out"></i> Se déconnecter</a></li>
  108. </ul>
  109. </li>
  110. </ul>
  111. {% endif %}
  112. </div>
  113. </nav>