base.html.twig 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8" />
  5. <title>{% block title %}VideoPotes{% endblock %}</title>
  6. <link rel="stylesheet" href="{{ asset('build/app.css') }}">
  7. {% block stylesheets %}{% endblock %}
  8. <link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}" />
  9. </head>
  10. <body style="padding-top:5rem;">
  11. <nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top">
  12. <a class="navbar-brand" href="{{ path('videotheque_liste') }}">Videothèque</a>
  13. <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="/" aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation">
  14. <span class="navbar-toggler-icon"></span>
  15. </button>
  16. <div class="collapse navbar-collapse" id="navbarsExampleDefault">
  17. {% if is_granted('IS_AUTHENTICATED_REMEMBERED') %}
  18. <ul class="navbar-nav mr-auto">
  19. <li class="nav-item">
  20. <a class="nav-link" href="{{ path('videothequepersonnelle_maliste') }}">Ma liste de films<span class="sr-only">(current)</span></a>
  21. </li>
  22. <li class="nav-item">
  23. <a class="nav-link" href="{{ path('videotheque_liste') }}">Liste des films<span class="sr-only">(current)</span></a>
  24. </li>
  25. <li class="nav-item">
  26. <a class="nav-link" href="{{ path('realisateur_liste') }}">Liste des réalisateurs<span class="sr-only">(current)</span></a>
  27. </li>
  28. {% if is_granted('ROLE_ADMIN') %}
  29. <ul class="navbar-nav">
  30. <li class="nav-item dropdown">
  31. <a class="nav-link dropdown-toggle" href="#" id="navbarDropdownAdmin" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  32. Administration
  33. </a>
  34. <div class="dropdown-menu" aria-labelledby="navbarDropdown">
  35. <a class="dropdown-item" href="{{ path('admin_index') }}">Utilisateurs</a>
  36. <div class="dropdown-divider"></div>
  37. <a class="dropdown-item" href="{{ path('genre_liste') }}">Liste des genres</a>
  38. {#<div class="dropdown-divider"></div>
  39. <a class="dropdown-item" href="{{ path('admin_resettokens') }}">Reset Tokens</a>
  40. #}
  41. </div>
  42. </li>
  43. </ul>
  44. {% endif %}
  45. </ul>
  46. <form class="form-inline my-2 my-lg-0" action="{{ path('search_recherche') }}">
  47. <input class="form-control mr-sm-2" name="q" type="text" placeholder="Rechercher" aria-label="Rechercher">
  48. <button class="btn btn-outline-success my-2 my-sm-0" type="submit">Go</button>
  49. </form>
  50. {% endif %}
  51. {% if not is_granted('IS_AUTHENTICATED_REMEMBERED') %}
  52. <ul class="navbar-nav">
  53. <li class="nav-item"><a class="nav-link" href="{{ path('login') }}">Se connecter</a></li>
  54. </ul>
  55. {% else %}
  56. <ul class="navbar-nav">
  57. <li class="nav-item dropdown">
  58. <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  59. {{ app.user.nomComplet }}
  60. </a>
  61. <div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown">
  62. <a class="dropdown-item" href="{{ path('user_profil') }}">Profil</a>
  63. <div class="dropdown-divider"></div>
  64. <a class="dropdown-item" href="{{ path('logout') }}">Se déconnecter</a>
  65. </div>
  66. </li>
  67. </ul>
  68. {% endif %}
  69. </div>
  70. </nav>
  71. <div class="container-fluid">
  72. <header>
  73. <h1>{% block titre %}{% endblock %}</h1>
  74. </header>
  75. <main role="main">
  76. <div>
  77. {% for message in app.flashes('success') %}
  78. <div class="alert alert-success alert-dismissible fade show" role="alert">
  79. <strong>Cool</strong> {{ message }}
  80. <button type="button" class="close" data-dismiss="alert" aria-label="Close">
  81. <span aria-hidden="true">&times;</span>
  82. </button>
  83. </div>
  84. {% endfor %}
  85. {% for message in app.flashes('warning') %}
  86. <div class="alert alert-warning alert-dismissible fade show" role="alert">
  87. <strong>Attention</strong> {{ message }}
  88. <button type="button" class="close" data-dismiss="alert" aria-label="Close">
  89. <span aria-hidden="true">&times;</span>
  90. </button>
  91. </div>
  92. {% endfor %}
  93. {% block body %}{% endblock %}
  94. </div>
  95. </main>
  96. <footer class="footer">
  97. <div class="container text-center">
  98. <span class="text-muted small">Cette application est développée en Symfony 3.4 - Code disponible sur <a target="_blank" href="https://gogs.fdlibre.eu/sangfroid/films">Gogs</a></span>
  99. </div>
  100. {% block footer %}
  101. {% endblock %}
  102. </footer>
  103. </div>
  104. <script src="{{ asset('build/app.js') }}"></script>
  105. {% block javascripts %}{% endblock %}
  106. </body>
  107. </html>