Affichage titre dans modale lecture son

This commit is contained in:
Claude Paroz 2025-11-07 18:35:35 +01:00
parent 5b77299f71
commit 1a89634ec4
2 changed files with 5 additions and 1 deletions

View file

@ -15,6 +15,9 @@ window.addEventListener('DOMContentLoaded', () => {
const soundModal = document.getElementById('modal_sound');
soundModal.querySelector("audio").src = ev.target.dataset.path;
soundModal.querySelector("#download-link").href = ev.target.dataset.path;
soundModal.querySelector("#song-title").textContent = (
`${ev.target.closest("tr").querySelector(".titre_chant").textContent} - ${ev.target.ariaLabel}`
);
const myModal = new bootstrap.Modal(soundModal);
myModal.show();
});

View file

@ -8,7 +8,7 @@
{% if perms.beesgospel.change_chant %}<th scope="col" class="boutons"></th>{% endif %}</tr>
{% for chant in object_list %}
<tr class="editable">
<td>{{ chant.titre }}</td>
<td class="titre_chant">{{ chant.titre }}</td>
<td>{% for doc in chant.chantdoc_set.all %}
{% if doc.fichier_son %}
<img src="{{ doc.fichier.path|icon_url }}" title="{{ doc.titre }}" class="icon fichier_son" data-bs-toggle="tooltip" data-path="{{ doc.fichier.url }}">
@ -49,6 +49,7 @@
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<h2 id="song-title"></h2>
<div id="homeaudio" class="d-flex justify-content-center mt-5">
<div class="text-start">
<audio controls src=""></audio>