mirror of
https://github.com/nanoy42/coope
synced 2024-11-26 06:32:27 +00:00
Merge branch 'suivi_pinte' into dev
This commit is contained in:
commit
729434c1fb
5 changed files with 49 additions and 2 deletions
34
gestion/templates/gestion/pintes_user_list.html
Normal file
34
gestion/templates/gestion/pintes_user_list.html
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
{% extends 'base.html' %}
|
||||||
|
{% block entete %}Gestion des produits{% endblock %}
|
||||||
|
{% block navbar%}
|
||||||
|
<ul>
|
||||||
|
<li><a href="#first">Liste des utilisateurs n'ayant pas rendu leur pinte</a></li>
|
||||||
|
</ul>
|
||||||
|
{% endblock %}
|
||||||
|
{% block content %}
|
||||||
|
<section id="first" class="main">
|
||||||
|
<header class="major">
|
||||||
|
<h2>Liste des utilisateurs n'ayant pas rendu leur pinte</h2>
|
||||||
|
</header>
|
||||||
|
<div class="table-wrapper">
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Utilisateur</th>
|
||||||
|
<th>Profil</th>
|
||||||
|
<th>Nombre de pintes non rendues</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{% for user in users %}
|
||||||
|
<tr>
|
||||||
|
<td>{{ user }}</td>
|
||||||
|
<td><a href="{% url 'users:profile' user.pk %}" class="button small">Profil</a></td>
|
||||||
|
<td>{{ user.pintes_owned_currently.count }}</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
{% endblock %}
|
|
@ -74,6 +74,9 @@
|
||||||
{% if perms.gestion.view_pinte %}
|
{% if perms.gestion.view_pinte %}
|
||||||
<li><a href="{% url 'gestion:pintesList' %}">Lister les pintes</a></li>
|
<li><a href="{% url 'gestion:pintesList' %}">Lister les pintes</a></li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if perms.auth.view_user %}
|
||||||
|
<li><a href="{% url 'gestion:pintesUserList' %}">Lister les utilisateurs n'ayant pas rendu leurs pintes</a></li>
|
||||||
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
</section>
|
</section>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -37,6 +37,7 @@ urlpatterns = [
|
||||||
path('releasePintes', views.release_pintes, name="releasePintes"),
|
path('releasePintes', views.release_pintes, name="releasePintes"),
|
||||||
path('pintesList', views.pintes_list, name="pintesList"),
|
path('pintesList', views.pintes_list, name="pintesList"),
|
||||||
path('release/<int:pinte_pk>', views.release, name="release"),
|
path('release/<int:pinte_pk>', views.release, name="release"),
|
||||||
|
path('pintesUserList', views.pintes_user_list, name="pintesUserList"),
|
||||||
path('products-autocomplete', views.ProductsAutocomplete.as_view(), name="products-autocomplete"),
|
path('products-autocomplete', views.ProductsAutocomplete.as_view(), name="products-autocomplete"),
|
||||||
path('kegs-positive-autocomplete', views.KegPositiveAutocomplete.as_view(), name="kegs-positive-autocomplete"),
|
path('kegs-positive-autocomplete', views.KegPositiveAutocomplete.as_view(), name="kegs-positive-autocomplete"),
|
||||||
path('kegs-active-autocomplete', views.KegActiveAutocomplete.as_view(), name="kegs-active-autocomplete"),
|
path('kegs-active-autocomplete', views.KegActiveAutocomplete.as_view(), name="kegs-active-autocomplete"),
|
||||||
|
|
|
@ -981,3 +981,11 @@ def pintes_list(request):
|
||||||
free_pintes = Pinte.objects.filter(current_owner=None)
|
free_pintes = Pinte.objects.filter(current_owner=None)
|
||||||
taken_pintes = Pinte.objects.exclude(current_owner=None)
|
taken_pintes = Pinte.objects.exclude(current_owner=None)
|
||||||
return render(request, "gestion/pintes_list.html", {"free_pintes": free_pintes, "taken_pintes": taken_pintes})
|
return render(request, "gestion/pintes_list.html", {"free_pintes": free_pintes, "taken_pintes": taken_pintes})
|
||||||
|
|
||||||
|
@active_required
|
||||||
|
@login_required
|
||||||
|
@permission_required('auth.view_user')
|
||||||
|
def pintes_user_list(request):
|
||||||
|
pks = [x.pk for x in User.objects.all() if x.profile.nb_pintes > 0]
|
||||||
|
users = User.objects.filter(pk__in=pks)
|
||||||
|
return render(request, "gestion/pintes_user_list.html", {"users": users})
|
|
@ -42,7 +42,8 @@
|
||||||
<li><b>Groupe(s) : </b>{{user.groups.all|join:", "}}</li>
|
<li><b>Groupe(s) : </b>{{user.groups.all|join:", "}}</li>
|
||||||
<li>
|
<li>
|
||||||
<b>Position au classement : </b>{{user.profile.rank}}<span class="tabulation">
|
<b>Position au classement : </b>{{user.profile.rank}}<span class="tabulation">
|
||||||
<b>Quantité d'alcool ingérée : </b>{{user.profile.alcohol | floatformat:"-2"}} kg</span>
|
<b>Quantité d'alcool ingérée : </b>{{user.profile.alcohol | floatformat:"-2"}} kg</span><span class="tabulation">
|
||||||
|
<b>Nombre de pinte(s) non rendue(s) : </b> {{ user.pintes_owned_currently.count }} </span>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue