Refactor group detail and musikgame detail templates for improved owner visibility and styling; update CSS for music count display
This commit is contained in:
parent
43ba52f31e
commit
78e5be580b
5 changed files with 64 additions and 49 deletions
|
@ -2,7 +2,12 @@
|
|||
{% load form %}
|
||||
{% block content %}
|
||||
<h1>
|
||||
<i class="ri-group-2-fill"></i> {{ group.name }}
|
||||
{% if group.owner == user %}
|
||||
<i class="ri-vip-crown-fill owner"></i>
|
||||
{% else %}
|
||||
<i class="ri-group-2-fill"></i>
|
||||
{% endif %}
|
||||
{{ group.name }}
|
||||
</h1>
|
||||
{% if group.owner == user %}
|
||||
<p>
|
||||
|
@ -21,9 +26,11 @@
|
|||
<thead>
|
||||
<th>Date</th>
|
||||
<th>Joueurs</th>
|
||||
<th>
|
||||
<i class="ri-delete-bin-fill"></i>
|
||||
</th>
|
||||
{% if group.owner == user %}
|
||||
<th>
|
||||
<i class="ri-delete-bin-fill"></i>
|
||||
</th>
|
||||
{% endif %}
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for game in group.musikgame_set.all %}
|
||||
|
@ -32,9 +39,11 @@
|
|||
<a href="{% url "game_detail" pk=game.pk %}">{{ game.date }}</a>
|
||||
</td>
|
||||
<td>{{ game.players.all|join:", " }}</td>
|
||||
<td>
|
||||
<a href="{% url "group_remove_game" pk=game.pk %}"><i class="ri-close-fill" alt="Supprimer"></i></a>
|
||||
</td>
|
||||
{% if group.owner == user %}
|
||||
<td>
|
||||
<a href="{% url "group_remove_game" pk=game.pk %}"><i class="ri-close-fill" alt="Supprimer"></i></a>
|
||||
</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
|
@ -43,11 +52,6 @@
|
|||
<h2>
|
||||
<i class="ri-group-2-fill"></i> Membres
|
||||
</h2>
|
||||
{% if group.owner == user %}
|
||||
<p>
|
||||
<a href="{% url "group_edit_members" pk=group.pk %}" role="button"><i class="ri-user-add-fill"></i> Modifier les membres</a>
|
||||
</p>
|
||||
{% endif %}
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
|
@ -58,9 +62,11 @@
|
|||
<th>
|
||||
<i class="ri-mv-line"></i>
|
||||
</th>
|
||||
<th>
|
||||
<i class="ri-delete-bin-fill"></i>
|
||||
</th>
|
||||
{% if group.owner == user %}
|
||||
<th>
|
||||
<i class="ri-delete-bin-fill"></i>
|
||||
</th>
|
||||
{% endif %}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
@ -70,35 +76,39 @@
|
|||
<i class="ri-vip-crown-fill owner"></i>
|
||||
</td>
|
||||
<td>{{ owner_count }}</td>
|
||||
<td></td>
|
||||
{% if group.owner == user %}<td></td>{% endif %}
|
||||
</tr>
|
||||
{% for member in members.all %}
|
||||
<tr>
|
||||
<td>{{ member }}</td>
|
||||
<td></td>
|
||||
<td>{{ member.count }}</td>
|
||||
<td>
|
||||
<a href="{% url "group_remove_member" pk=group.pk user_pk=member.pk %}">
|
||||
<i class="ri-close-fill" alt="Supprimer"></i>
|
||||
</a>
|
||||
</td>
|
||||
{% if group.owner == user %}
|
||||
<td>
|
||||
<a href="{% url "group_remove_member" pk=group.pk user_pk=member.pk %}">
|
||||
<i class="ri-close-fill" alt="Supprimer"></i>
|
||||
</a>
|
||||
</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<form method="post" action="{% url "group_add_member" pk=group.pk %}">
|
||||
{% csrf_token %}
|
||||
<fieldset role="group">
|
||||
<input type="string"
|
||||
name="username"
|
||||
id="username"
|
||||
placeholder="Membre"
|
||||
required>
|
||||
<button type="submit">Ajouter</button>
|
||||
</fieldset>
|
||||
</form>
|
||||
{% if group.owner == user %}
|
||||
<form method="post" action="{% url "group_add_member" pk=group.pk %}">
|
||||
{% csrf_token %}
|
||||
<fieldset role="group">
|
||||
<input type="string"
|
||||
name="username"
|
||||
id="username"
|
||||
placeholder="Membre"
|
||||
required>
|
||||
<button type="submit">Ajouter</button>
|
||||
</fieldset>
|
||||
</form>
|
||||
{% endif %}
|
||||
<h2>
|
||||
<i class="ri-music-2-fill"></i> Mes musiques ({{ musics.count }})
|
||||
<i class="ri-music-2-fill"></i> Mes musiques <span class="music-count">{{ musics.count }}</span>
|
||||
</h2>
|
||||
<details>
|
||||
<summary role="button">
|
||||
|
|
|
@ -13,9 +13,7 @@
|
|||
<h2>
|
||||
<i class="ri-group-2-fill"></i> Joueurs
|
||||
</h2>
|
||||
<ul>
|
||||
{% for member in musikgame.players.all %}<li>{{ member }}</li>{% endfor %}
|
||||
</ul>
|
||||
<p>{{ musikgame.players.all|join:", " }}</p>
|
||||
<h2>
|
||||
<i class="ri-music-2-fill"></i> Musiques
|
||||
</h2>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue