Add game app with group and music video models, views, and templates
This commit is contained in:
parent
d7545ab43c
commit
ba746c9cae
20 changed files with 315 additions and 48 deletions
24
game/templates/game/group_confirm_delete.html
Normal file
24
game/templates/game/group_confirm_delete.html
Normal file
|
@ -0,0 +1,24 @@
|
|||
{% extends "base.html" %}
|
||||
{% load form %}
|
||||
{% block content %}
|
||||
<h1></h1>
|
||||
<dialog open>
|
||||
<article>
|
||||
<header>
|
||||
<p>
|
||||
<i class="ri-group-2-fill"></i> {{ group.name }}
|
||||
</p>
|
||||
</header>
|
||||
<p>
|
||||
Confirmer la supression du groupe <strong>{{ group.name }}</strong> ?
|
||||
</p>
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
<button type="submit">
|
||||
<i class="ri-delete-bin-fill"></i> Confirmer
|
||||
</button>
|
||||
<a href="{{ group.get_absolute_url }}" role="button" class="secondary"><i class="ri-close-line"></i> Annuler</a>
|
||||
</form>
|
||||
</article>
|
||||
</dialog>
|
||||
{% endblock content %}
|
16
game/templates/game/group_detail.html
Normal file
16
game/templates/game/group_detail.html
Normal file
|
@ -0,0 +1,16 @@
|
|||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
<h1>
|
||||
<i class="ri-group-2-fill"></i> {{ group.name }}
|
||||
</h1>
|
||||
<p>
|
||||
<a href="{% url "group_update" pk=group.pk %}"><i class="ri-edit-line"></i> Modifier le groupe</a>
|
||||
</p>
|
||||
<h2>Membres</h2>
|
||||
<ul>
|
||||
<li>
|
||||
{{ group.owner }} <i class="ri-vip-crown-fill"></i>
|
||||
</li>
|
||||
{% for member in group.members.all %}<li>{{ member }}</li>{% endfor %}
|
||||
</ul>
|
||||
{% endblock content %}
|
15
game/templates/game/group_form.html
Normal file
15
game/templates/game/group_form.html
Normal file
|
@ -0,0 +1,15 @@
|
|||
{% extends "base.html" %}
|
||||
{% load form %}
|
||||
{% block content %}
|
||||
{% if group %}
|
||||
<h1>
|
||||
<i class="ri-group-2-fill"></i> {{ group.name }}
|
||||
</h1>
|
||||
<p>
|
||||
<a href="{% url "group_delete" group.pk %}">Supprimer le groupe</a>
|
||||
</p>
|
||||
{% else %}
|
||||
<h1>Créer un groupe</h1>
|
||||
{% endif %}
|
||||
{% form form %}
|
||||
{% endblock content %}
|
19
game/templates/game/home.html
Normal file
19
game/templates/game/home.html
Normal file
|
@ -0,0 +1,19 @@
|
|||
<p>Bienvenue {{ user.username }} !</p>
|
||||
<h2>Mes groupes</h2>
|
||||
<p>
|
||||
<a href="{% url "group_create" %}" role="button"><i class="ri-add-box-fill"></i> Créer un groupe</a>
|
||||
</p>
|
||||
{% if user.owned_group_set.exists or user.group_set.exists %}
|
||||
<ul>
|
||||
{% for group in user.owned_group_set.all %}
|
||||
<li>
|
||||
<a href="{{ group.get_absolute_url }}">{{ group.name }}</a> <i class="ri-vip-crown-fill"></i>
|
||||
</li>
|
||||
{% endfor %}
|
||||
{% for group in user.group_set.all %}
|
||||
<li>
|
||||
<a href="{{ group.get_absolute_url }}">{{ group.name }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
Loading…
Add table
Add a link
Reference in a new issue