Pārlūkot izejas kodu

Merge branch 'develop' into features/background

François Drouhard 2 gadi atpakaļ
vecāks
revīzija
385e088691

+ 2 - 2
assets/controllers/collapser-controller.js

@@ -4,10 +4,10 @@ export default class extends Controller {
     static targets = ['collapse', 'button']
     connect() {
         this.collapseTarget.addEventListener ('hide.bs.collapse', () => {
-            this.buttonTarget.innerHTML = '<i class="fa fa-chevron-circle-right fa-lg"></i>';
+            this.buttonTarget.classList.remove("fa-rotate-90");
         });
         this.collapseTarget.addEventListener ('show.bs.collapse', () => {
-            this.buttonTarget.innerHTML = '<i class="fa fa-chevron-circle-down fa-lg"></i>';
+            this.buttonTarget.classList.add("fa-rotate-90");
         })
     }
 }

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

@@ -24,7 +24,7 @@
                         {{ form_label(form.genres, 'Genres') }}
                     </div>
                     <div class="card-body">
-                        <button id="add_genre" class="btn btn-link add-another-collection-widget mb-3" data-path="{{ path('videotheque_ajax_genres') }}" data-list-selector="#genre-fields-list">Ajouter un genre</button>
+                        <button type="button" id="add_genre" class="btn btn-link add-another-collection-widget mb-3" data-path="{{ path('videotheque_ajax_genres') }}" data-list-selector="#genre-fields-list">Ajouter un genre</button>
                         <ul id="genre-fields-list"
                             data-prototype="{{ form_widget(form.genres.vars.prototype)|e }}"
                             data-widget-tags="{{ '<li class="list-group-item"></li>'|e }}"
@@ -48,7 +48,7 @@
                         {{ form_label(form.realisateurs, 'Réalisateurs') }}
                     </div>
                     <div class="card-body">
-                        <a href="#" id="add_realisateur" class="btn btn-link add-another-collection-widget mb-3" data-path="{{ path('videotheque_ajax_realisateurs') }}" data-list-selector="#realisateur-fields-list">Ajouter un réalisateur</a>
+                        <button type="button" id="add_realisateur" class="btn btn-link add-another-collection-widget mb-3" data-path="{{ path('videotheque_ajax_realisateurs') }}" data-list-selector="#realisateur-fields-list">Ajouter un réalisateur</button>
                         <ul id="realisateur-fields-list"
                             data-prototype="{{ form_widget(form.realisateurs.vars.prototype)|e }}"
                             data-widget-tags="{{ '<li class="list-group-item"></li>'|e }}"

+ 4 - 2
templates/videotheque/liste_tableaux.html.twig

@@ -58,7 +58,8 @@
 								{% set follow_icone = "fa fa-bookmark-o text-secondary fa-lg" %}
 								{% set follow_texte = "Ajouter ce film à votre liste à voir" %}
 							{% endif %}
-							<a href="#" data-fonction="switch"
+							<a href="#" type="button"
+										data-fonction="switch"
 										data-icone-actif="fa fa-bookmark fa-lg"
 										data-icone-inactif="fa fa-bookmark-o text-secondary fa-lg"
 										data-path="{{ path('maliste_modifier_a_voir') }}"
@@ -74,7 +75,8 @@
 							{% else %}
 								{% set vu_icone = '<i class="fa fa-eye-slash fa-lg text-secondary"></i>' %}
 							{% endif %}				
-							<a href="#" data-fonction="switch"
+							<a href="#"	type="button"
+										data-fonction="switch"
 										data-path="{{ path('maliste_modifier_vus') }}"
 										data-content="{{ film.id }}"
 										data-icone-actif = "fa fa-eye fa-lg text-success"

+ 5 - 3
templates/videotheque/liste_vignettes.html.twig

@@ -52,7 +52,8 @@
 							{% else %}
 								{% set vu_icone = '<i class="fa fa-eye-slash fa-lg text-secondary"></i>' %}
 							{% endif %}				
-							<button     class="btn"
+							<button     type="button"
+										class="btn"
 										data-fonction="switch"
 										data-path="{{ path('maliste_modifier_vus') }}"
 										data-content="{{ film.id }}"
@@ -69,7 +70,8 @@
 								{% set follow_icone = "fa fa-bookmark-o text-secondary fa-lg" %}
 								{% set follow_texte = "Ajouter ce film à votre liste à voir" %}
 							{% endif %}
-							<button		class="btn text-primary"
+							<button		type="button"
+										class="btn text-primary"
 										data-fonction="switch"
 										data-icone-actif="fa fa-bookmark fa-lg"
 										data-icone-inactif="fa fa-bookmark-o text-secondary fa-lg"
@@ -82,7 +84,7 @@
 						</div>
 					{% endif %}
 					<div class="">
-						<button class="btn text-primary" data-collapser-target="button" data-bs-toggle="collapse" data-bs-target="#collapse-id-{{ film.id }}"><i class="fa fa-chevron-circle-right fa-lg"></i></button>
+						<button class="btn text-primary" data-bs-toggle="collapse" data-bs-target="#collapse-id-{{ film.id }}"><i data-collapser-target="button" class="fa fa-chevron-circle-right fa-lg"></i></button>
 					</div>
 				</div>
 			</div>

+ 14 - 11
templates/videotheque/voirfilm.html.twig

@@ -10,20 +10,23 @@
             {% set follow_icone = "fa fa-bookmark-o text-secondary" %}
             {% set follow_texte = "Ajouter ce film à votre liste à voir" %}
         {% endif %}
-        <a href="#" data-fonction="switch"
-                    data-icone-actif="fa fa-bookmark"
-                    data-icone-inactif="fa fa-bookmark-o text-secondary"
-                    data-path="{{ path('maliste_modifier_a_voir') }}"
-                    data-bs-toggle="tooltip"
-                    title="{{ follow_texte }}"
-                    data-content="{{ film.id }}">
+        <a href="#"
+            type="button"
+            data-fonction="switch"
+            data-icone-actif="fa fa-bookmark"
+            data-icone-inactif="fa fa-bookmark-o text-secondary"
+            data-path="{{ path('maliste_modifier_a_voir') }}"
+            data-bs-toggle="tooltip"
+            title="{{ follow_texte }}"
+            data-content="{{ film.id }}">
             <i class="{{ follow_icone }}"></i></a>
         {% if film.usersWhoSeen.contains(app.user) %}
             {% set vu_icone = '<i class="fa fa-eye text-success"></i>' %}
         {% else %}
             {% set vu_icone = '<i class="fa fa-eye-slash text-secondary"></i>' %}
         {% endif %}				
-        <a href="#" data-fonction="switch"
+        <a href="#" type="button"
+                    data-fonction="switch"
                     data-path="{{ path('maliste_modifier_vus') }}"
                     data-content="{{ film.id }}"
                     data-icone-actif = "fa fa-eye text-success"
@@ -145,12 +148,12 @@
                 <div class="card-header">
                     <h5>Commentaires</h5>
                 </div>
-                <div class="card-body">
+                <div class="card-body" data-controller="collapser">
                     {% if is_granted('IS_AUTHENTICATED_REMEMBERED') %}
                             <p>
-                                <a data-bs-toggle="collapse" role="button" href="#collapseCommentaire" aria-expanded="false" aria-controls="collapseCommentaire">Commenter <i class="fa fa-chevron-down"></i></a>
+                                <a data-bs-toggle="collapse" role="button" href="#collapseCommentaire" aria-expanded="false" aria-controls="collapseCommentaire">Commenter <i data-collapser-target="button" class="fa fa-chevron-right"></i></a>
                             </p>
-                            <div class="collapse" id="collapseCommentaire">
+                            <div class="collapse" id="collapseCommentaire" data-collapser-target="collapse">
                             {{ include('videotheque/form_commentaire.html.twig') }}
                             </div>
                     {% endif %}