Add game answer functionality with form and view for user responses

This commit is contained in:
Edgar P. Burkhart 2025-06-15 12:40:55 +02:00
parent 6dbb1a54e0
commit d03d3b48d4
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227
9 changed files with 97 additions and 12 deletions

View file

@ -12,7 +12,7 @@
<i class="ri-vip-crown-fill"></i>
</th>
<th>
<i class="ri-mv-line"></i>
<i class="ri-mv-fill"></i>
</th>
</tr>
</thead>

View file

@ -0,0 +1,26 @@
{% extends "base.html" %}
{% block content %}
<h2>Mes réponses</h2>
<form method="post">
{% csrf_token %}
<table>
<thead>
<tr>
<th>
<i class="ri-mv-fill" alt="Musique"></i>
</th>
<th>Réponse</th>
</tr>
</thead>
<tbody>
{% for field in form %}
<tr>
<td>{{ field.label }}</td>
<td>{{ field }}</td>
</tr>
{% endfor %}
</tbody>
</table>
<button type="submit">Valider mes réponses</button>
</form>
{% endblock content %}

View file

@ -10,6 +10,9 @@
href="{% yt_playlist musikgame %}"
role="button"
{% if musikgame.playlist_loading %}aria-busy="true"{% endif %}><i class="ri-youtube-fill"></i> Playlist</a>
<a target="_blank"
href="{% url "game_answer" musikgame.pk %}"
role="button"><i class="ri-play-list-2-fill"></i> Répondre</a>
</p>
{% endif %}
<h2>