base.html.twig 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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;padding-bottom:4rem;">
  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. {% if app.request.attributes.get('_route') == 'videothequepersonnelle_maliste' %}active{% endif %}">
  21. <a class="nav-link" href="{{ path('videothequepersonnelle_maliste') }}">Ma liste de films<span class="sr-only">(current)</span></a>
  22. </li>
  23. <li class="nav-item
  24. {% if app.request.attributes.get('_route') == 'videotheque_liste' %}active{% endif %}">
  25. <a class="nav-link" href="{{ path('videotheque_liste') }}">Liste des films<span class="sr-only">(current)</span></a>
  26. </li>
  27. <li class="nav-item
  28. {% if app.request.attributes.get('_route') == 'realisateur_liste' %}active{% endif %}">
  29. <a class="nav-link" href="{{ path('realisateur_liste') }}">Liste des réalisateurs<span class="sr-only">(current)</span></a>
  30. </li>
  31. {% if is_granted('ROLE_MODERATEUR') %}
  32. <ul class="navbar-nav">
  33. <li class="nav-item dropdown">
  34. <a class="nav-link dropdown-toggle" href="#" id="navbarDropdownAdmin" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  35. Administration
  36. </a>
  37. <div class="dropdown-menu" aria-labelledby="navbarDropdown">
  38. {% if is_granted('ROLE_ADMIN') %}
  39. <a class="dropdown-item" href="{{ path('admin_index') }}">Utilisateurs</a>
  40. <div class="dropdown-divider"></div>
  41. {% endif %}
  42. <a class="dropdown-item" href="{{ path('genre_liste') }}">Liste des genres</a>
  43. {#<div class="dropdown-divider"></div>
  44. <a class="dropdown-item" href="{{ path('admin_resettokens') }}">Reset Tokens</a>
  45. #}
  46. </div>
  47. </li>
  48. </ul>
  49. {% endif %}
  50. </ul>
  51. <form class="form-inline my-2 my-lg-0" action="{{ path('search_recherche') }}">
  52. <input class="form-control mr-sm-2" name="q" type="text" placeholder="Rechercher" aria-label="Rechercher">
  53. <button class="btn btn-outline-success my-2 my-sm-0" type="submit">Go</button>
  54. </form>
  55. {% endif %}
  56. {% if not is_granted('IS_AUTHENTICATED_REMEMBERED') %}
  57. <ul class="navbar-nav">
  58. <li class="nav-item"><a class="nav-link" href="{{ path('login') }}">Se connecter</a></li>
  59. </ul>
  60. {% else %}
  61. <ul class="navbar-nav">
  62. <li class="nav-item dropdown">
  63. <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  64. {{ app.user.nomComplet }}
  65. </a>
  66. <div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown">
  67. <a class="dropdown-item" href="{{ path('user_profil') }}">Profil</a>
  68. <div class="dropdown-divider"></div>
  69. <a class="dropdown-item" href="{{ path('logout') }}">Se déconnecter</a>
  70. </div>
  71. </li>
  72. </ul>
  73. {% endif %}
  74. </div>
  75. </nav>
  76. <div class="container-fluid">
  77. <header>
  78. <div class="row">
  79. <div class="col-8">
  80. <h1>{% block titre %}{% endblock %}</h1>
  81. </div>
  82. <div class="col-4">
  83. <div class="text-right">
  84. <a data-toggle="collapse" role="button" href="#collapseAide" aria-expanded="false" aria-controls="collapseAide">Aide <i class="fa fa-chevron-down"></i></a>
  85. </div>
  86. <div class="card collapse" id="collapseAide">
  87. <div class="card-body">
  88. <p><i class="fa fa-star text-primary"></i> : Films que l'on souhaite voir. On les retrouve dans "Liste de mes films"</p>
  89. <p><i class="badge badge-secondary">Pas vu</i><i class="badge badge-success">Vu</i> : Film qu'on a vu</p>
  90. <p><i class="badge badge-danger">Pas vu</i><i class="badge badge-secondary">Vu</i> : Film qu'on n'a pas vu</p>
  91. </div>
  92. </div>
  93. </div>
  94. </div>
  95. </header>
  96. <main role="main">
  97. {% block body %}{% endblock %}
  98. </main>
  99. <footer class="footer">
  100. <div class="text-center fixed-bottom bg-white">
  101. <span class="text-muted small">Cette application est développée en Symfony 3.4 - Code source disponible sur <a target="_blank" href="https://gogs.fdlibre.eu/sangfroid/films">Gogs</a><br>Licence <a target="_blank" href="http://www.wtfpl.net">WTFLP</a></span>
  102. </div>
  103. {% block footer %}
  104. {% endblock %}
  105. </footer>
  106. </div>
  107. {% for type, messages in app.session.flashBag.all %}
  108. {% for message in messages %}
  109. {% if type == 'error' %}{% set type = 'danger' %} {% endif %}
  110. <div data-toggle="notify" data-message="{{ message }}" data-type="{{ type }}"></div>
  111. {% endfor %}
  112. {% endfor %}
  113. <script src="{{ asset('build/app.js') }}"></script>
  114. {% block javascripts %}{% endblock %}
  115. </body>
  116. </html>