Browse Source

Changement de thème avec bouton

François Drouhard 9 months ago
parent
commit
23ed98468e

+ 12 - 1
templates/navbar.html.twig

@@ -1,4 +1,4 @@
-<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
+<nav class="navbar navbar-expand-lg bg-dark fixed-top" data-bs-theme="dark">
     <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
     <span class="navbar-toggler-icon"></span>
     </button>
@@ -86,6 +86,17 @@
             <a href="#" class="nav-link me-3" data-bs-toggle="modal" data-bs-target="#modalWindow"><i class="fa fa-info-circle fa-lg text-light" aria-hidden="true"></i></a>
         <li>
     </ul>
+    <ul class="navbar-nav">
+        <li class="nav-item dropdown">
+            <a class="nav-link dropdown-toggle" href="#" id="navbarColorDropdown" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
+                <i class="fa fa-tint fa-lg"></i>
+            </a>
+            <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarColorDropdown">
+                <li><a href="#" class="dropdown-item" data-bs-theme-value="light">Light</a></li>
+                <li><a href="#" class="dropdown-item" data-bs-theme-value="dark">Dark</a></li>
+            </ul>
+        </li>
+    </ul>
     {% if is_granted('IS_AUTHENTICATED_REMEMBERED') %}
     <ul class="navbar-nav">
         <li class="nav-item dropdown">

+ 6 - 10
templates/videotheque/liste_tableaux.html.twig

@@ -87,18 +87,14 @@
 
 				</td>
 				<td>
-					{% if film.genres is defined %}
-						{% for genre in film.genres %}
-							<a href="{{ path("videotheque_listepargenre", {"id": genre.id}) }}"><span class="badge bg-secondary">{{ genre.name }}</span></a>
-						{% endfor %}
-					{% endif %}
+					{% for genre in film.genres %}
+						<a href="{{ path("videotheque_listepargenre", {"id": genre.id}) }}"><span class="badge bg-secondary rounded-pill">{{ genre.name }}</span></a>
+					{% endfor %}
 				</td>
 				<td>
-				{% if film.realisateurs is defined %}
-					{%  for realisateur in film.realisateurs %}
-						<a href="{{ path('videotheque_listeparreal', {"id": realisateur.id}) }}"><span class="badge bg-info">{{ realisateur.nomComplet }}</span></a>
-					{%  endfor %}
-				{% endif %}
+					{% for realisateur in film.realisateurs %}
+						<a href="{{ path('videotheque_listeparreal', {"id": realisateur.id}) }}"><span class="badge bg-info rounded-pill text-dark">{{ realisateur.nomComplet }}</span></a>
+					{% endfor %}
 				</td>
 				<td>
 					{% if film.note > 0 %}

+ 2 - 2
templates/videotheque/voirfilm.html.twig

@@ -86,13 +86,13 @@
                         <dt class="col-4">Réalisateur(s)</dt>
                         <dd class="col-8">
                         {% for realisateur in film.realisateurs %}
-                            <a href="{{ path('videotheque_listeparreal', {'id': realisateur.id}) }}"><span class="badge bg-info">{{ realisateur.nomComplet }}</span></a>
+                            <a href="{{ path('videotheque_listeparreal', {'id': realisateur.id}) }}"><span class="badge bg-info text-dark">{{ realisateur.nomComplet }}</span></a>
                         {% endfor %}
                         </dd>
                         <dt class="col-4">Genre</dt>
                         <dd class="col-8">
                         {% for genre in film.genres %}
-                            <a href="{{ path('videotheque_listepargenre', {'id': genre.id}) }}"><span class="badge bg-info">{{ genre.name }}</span></a>
+                            <a href="{{ path('videotheque_listepargenre', {'id': genre.id}) }}"><span class="badge bg-info text-dark">{{ genre.name }}</span></a>
                         {% endfor %}
                         </dd>
                         {% if film.lien is not null %}