base.html.twig 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. <ul class="navbar-nav mr-auto">
  18. <li class="nav-item">
  19. <a class="nav-link" href="{{ path('videothequepersonnelle_maliste') }}">Ma liste de films<span class="sr-only">(current)</span></a>
  20. </li>
  21. <li class="nav-item">
  22. <a class="nav-link" href="{{ path('videotheque_liste') }}">Liste des films<span class="sr-only">(current)</span></a>
  23. </li>
  24. <li class="nav-item">
  25. <a class="nav-link" href="{{ path('realisateur_liste') }}">Liste des réalisateurs<span class="sr-only">(current)</span></a>
  26. </li>
  27. {% if is_granted('ROLE_ADMIN') %}
  28. <ul class="navbar-nav">
  29. <li class="nav-item dropdown">
  30. <a class="nav-link dropdown-toggle" href="#" id="navbarDropdownAdmin" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  31. Administration
  32. </a>
  33. <div class="dropdown-menu" aria-labelledby="navbarDropdown">
  34. <a class="dropdown-item" href="{{ path('admin_index') }}">Utilisateurs</a>
  35. <div class="dropdown-divider"></div>
  36. <a class="dropdown-item" href="{{ path('genre_liste') }}">Liste des genres</a>
  37. <div class="dropdown-divider"></div>
  38. <a class="dropdown-item" href="{{ path('admin_resettokens') }}">Reset Tokens</a>
  39. </div>
  40. </li>
  41. </ul>
  42. {% endif %}
  43. </ul>
  44. {% if not is_granted('IS_AUTHENTICATED_REMEMBERED') %}
  45. <ul class="navbar-nav">
  46. <li class="nav-item"><a class="nav-link" href="{{ path('login') }}">Se connecter</a></li>
  47. </ul>
  48. {% else %}
  49. <ul class="navbar-nav">
  50. <li class="nav-item dropdown">
  51. <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  52. {{ app.user.username }}
  53. </a>
  54. <div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown">
  55. <a class="dropdown-item" href="{{ path('user_profil') }}">Profil</a>
  56. <div class="dropdown-divider"></div>
  57. <a class="dropdown-item" href="{{ path('logout') }}">Se déconnecter</a>
  58. </div>
  59. </li>
  60. </ul>
  61. {% endif %}
  62. {#<form class="form-inline my-2 my-lg-0">
  63. <input class="form-control mr-sm-2" type="text" placeholder="Search" aria-label="Search">
  64. <button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
  65. </form>#}
  66. </div>
  67. </nav>
  68. <div class="container-fluid">
  69. <header>
  70. <h1>{% block titre %}{% endblock %}</h1>
  71. </header>
  72. <main role="main">
  73. <div>
  74. {% for message in app.flashes('success') %}
  75. <div class="alert alert-success alert-dismissible fade show" role="alert">
  76. <strong>Cool</strong> {{ message }}
  77. <button type="button" class="close" data-dismiss="alert" aria-label="Close">
  78. <span aria-hidden="true">&times;</span>
  79. </button>
  80. </div>
  81. {% endfor %}
  82. {% block body %}{% endblock %}
  83. </div>
  84. </main>
  85. <footer>
  86. {% block footer %}
  87. {% endblock %}
  88. </footer>
  89. </div>
  90. <script src="{{ asset('build/app.js') }}"></script>
  91. {% block javascripts %}{% endblock %}
  92. </body>
  93. </html>