Add collapsible section for music list in group detail template

This commit is contained in:
Edgar P. Burkhart 2025-06-13 23:26:54 +02:00
parent e64bb8b95a
commit f211b9af50
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227

View file

@ -57,40 +57,45 @@
<h2> <h2>
<i class="ri-music-2-fill"></i> Mes musiques ({{ musics.count }}) <i class="ri-music-2-fill"></i> Mes musiques ({{ musics.count }})
</h2> </h2>
<table class="striped"> <details>
<thead> <summary role="button">
<tr> <i class="ri-music-2-fill"></i> Liste des musiques
<th>Musique</th> </summary>
<th>ID</th> <table class="striped">
<th> <thead>
<i class="ri-history-fill"></i>
</th>
<th>
<i class="ri-delete-bin-fill"></i>
</th>
</tr>
</thead>
<tbody>
{% for music in musics %}
<tr> <tr>
<th>{{ music.title }}</th> <th>Musique</th>
<td> <th>ID</th>
<a href="https://youtu.be/{{ music.yt_id }}">{{ music.yt_id }}</a> <th>
</td> <i class="ri-history-fill"></i>
<td> </th>
<input type="checkbox" disabled {% if music.blacklisted %}checked{% endif %} <th>
<i class="ri-delete-bin-fill"></i>
</th>
</tr>
</thead>
<tbody>
{% for music in musics %}
<tr>
<th>{{ music.title }}</th>
<td>
<a href="https://youtu.be/{{ music.yt_id }}">{{ music.yt_id }}</a>
</td> </td>
<td> <td>
<a href="{% url "group_remove_music" pk=music.pk %}"><i class="ri-close-fill" alt="Supprimer"></i></a> <input type="checkbox" disabled {% if music.blacklisted %}checked{% endif %}
</td> </td>
</tr> <td>
{% empty %} <a href="{% url "group_remove_music" pk=music.pk %}"><i class="ri-close-fill" alt="Supprimer"></i></a>
<tr> </td>
<td colspan="2">Aucune musique.</td> </tr>
</tr> {% empty %}
{% endfor %} <tr>
</tbody> <td colspan="2">Aucune musique.</td>
</table> </tr>
{% endfor %}
</tbody>
</table>
</details>
<form method="post" action="{% url "group_add_music" pk=group.pk %}"> <form method="post" action="{% url "group_add_music" pk=group.pk %}">
{% csrf_token %} {% csrf_token %}
<fieldset role="group"> <fieldset role="group">