Add game management features: create MusikGame model, implement game creation and detail views, and update group detail template

This commit is contained in:
Edgar P. Burkhart 2025-06-13 21:06:23 +02:00
parent 19e6eb32c8
commit f7baa91132
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227
10 changed files with 275 additions and 2 deletions

View file

@ -8,8 +8,25 @@
<p>
<a href="{% url "group_update" pk=group.pk %}"><i class="ri-edit-line"></i> Modifier le groupe</a>
</p>
<p>
<a href="{% url "start_game" pk=group.pk %}" role="button"><i class="ri-play-fill"></i> Lancer une partie</a>
</p>
{% endif %}
<h2>Membres</h2>
{% if group.musikgame_set %}
<h2>
<i class="ri-play-circle-fill"></i> Parties
</h2>
<ul>
{% for game in group.musikgame_set.all %}
<li>
<a href="{% url "game_detail" pk=game.pk %}">{{ game.date }}</a>
</li>
{% endfor %}
</ul>
{% endif %}
<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>
@ -21,7 +38,9 @@
</li>
{% for member in members.all %}<li>{{ member }} ({{ member.count }})</li>{% endfor %}
</ul>
<h2>Mes musiques ({{ musics.count }})</h2>
<h2>
<i class="ri-music-2-fill"></i> Mes musiques ({{ musics.count }})
</h2>
<table class="striped">
<thead>
<tr>

View file

@ -0,0 +1,22 @@
{% extends "base.html" %}
{% block content %}
<h1>
<i class="ri-play-circle-fill"></i> {{ musikgame.date }}
</h1>
<h2>
<i class="ri-group-2-fill"></i> Joueurs
</h2>
<ul>
{% for member in musikgame.players.all %}<li>{{ member }}</li>{% endfor %}
</ul>
<h2>
<i class="ri-music-2-fill"></i> Musiques
</h2>
<ol>
{% for music in musikgame.musicgameorder_set.all %}
<li>
<a href="https://youtu.be/{{ music.music_video.yt_id }}">{{ music.music_video.title }}</a>
</li>
{% endfor %}
</ol>
{% endblock content %}

View file

@ -0,0 +1,8 @@
{% extends "base.html" %}
{% load form %}
{% block content %}
<h1>
<i class="ri-group-2-fill"></i> {{ group.name }}
</h1>
{% form form %}
{% endblock content %}