Refactor music video model and views: rename user to owner, add title field, and implement music management in group detail view
This commit is contained in:
parent
8ed39c78b8
commit
4e28311b1c
11 changed files with 272 additions and 8 deletions
|
@ -1,4 +1,5 @@
|
|||
{% extends "base.html" %}
|
||||
{% load form %}
|
||||
{% block content %}
|
||||
<h1>
|
||||
<i class="ri-group-2-fill"></i> {{ group.name }}
|
||||
|
@ -12,8 +13,50 @@
|
|||
</p>
|
||||
<ul>
|
||||
<li>
|
||||
{{ group.owner }} <i class="ri-vip-crown-fill"></i>
|
||||
{{ group.owner }} ({{ owner_count }}) <i class="ri-vip-crown-fill"></i>
|
||||
</li>
|
||||
{% for member in group.members.all %}<li>{{ member }}</li>{% endfor %}
|
||||
{% for member in members.all %}<li>{{ member }} ({{ member.count }})</li>{% endfor %}
|
||||
</ul>
|
||||
{% endblock content %}
|
||||
<h2>Mes musiques ({{ musics.count }})</h2>
|
||||
<table class="striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Musique</th>
|
||||
<th>ID</th>
|
||||
<th>
|
||||
<i class="ri-history-fill"></i>
|
||||
</th>
|
||||
<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>
|
||||
<input type="checkbox" disabled {% if music.blacklisted %}checked{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<a href="{% url "group_remove_music" pk=music.pk %}"><i class="ri-close-fill" alt="Supprimer"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
{% empty %}
|
||||
<tr>
|
||||
<td colspan="2">Aucune musique.</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<form method="post" action="{% url "group_add_music" pk=group.pk %}">
|
||||
{% csrf_token %}
|
||||
<fieldset role="group">
|
||||
<input type="string" name="yt_id" id="yt_id" placeholder="Musique" required>
|
||||
<button type="submit">Ajouter</button>
|
||||
</fieldset>
|
||||
</form>
|
||||
{% endblock content %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue