Enhance group detail view: add conditional buttons for game and member removal based on group ownership

This commit is contained in:
Edgar P. Burkhart 2025-06-14 12:27:24 +02:00
parent 7e54c6e0ad
commit 637b497362
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227

View file

@ -26,7 +26,7 @@
{% csrf_token %} {% csrf_token %}
<table class="striped"> <table class="striped">
<thead> <thead>
<th></th> {% if group.owner == user %}<th></th>{% endif %}
<th>Date</th> <th>Date</th>
<th>Joueurs</th> <th>Joueurs</th>
</thead> </thead>
@ -46,9 +46,11 @@
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>
{% if group.owner == user %}
<button type="submit" formaction="{% url "group_remove_game" pk=group.pk %}"> <button type="submit" formaction="{% url "group_remove_game" pk=group.pk %}">
<i class="ri-delete-bin-fill"></i> Supprimer les parties sélectionnées <i class="ri-delete-bin-fill"></i> Supprimer les parties sélectionnées
</button> </button>
{% endif %}
</form> </form>
{% endif %} {% endif %}
<h2> <h2>
@ -92,7 +94,7 @@
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>
{% if musics %} {% if group.owner == user %}
<button type="submit" <button type="submit"
formaction="{% url "group_remove_member" pk=group.pk %}"> formaction="{% url "group_remove_member" pk=group.pk %}">
<i class="ri-delete-bin-fill"></i> Supprimer les membres sélectionnés <i class="ri-delete-bin-fill"></i> Supprimer les membres sélectionnés