diff --git a/gestion/templates/gestion/pintes_user_list.html b/gestion/templates/gestion/pintes_user_list.html
new file mode 100644
index 0000000..d7de296
--- /dev/null
+++ b/gestion/templates/gestion/pintes_user_list.html
@@ -0,0 +1,34 @@
+{% extends 'base.html' %}
+{% block entete %}Gestion des produits{% endblock %}
+{% block navbar%}
+
+{% endblock %}
+{% block content %}
+
+
+ Liste des utilisateurs n'ayant pas rendu leur pinte
+
+
+
+
+
+ Utilisateur |
+ Profil |
+ Nombre de pintes non rendues |
+
+
+
+ {% for user in users %}
+
+ {{ user }} |
+ Profil |
+ {{ user.pintes_owned_currently.count }} |
+
+ {% endfor %}
+
+
+
+
+{% endblock %}
diff --git a/gestion/templates/gestion/products_index.html b/gestion/templates/gestion/products_index.html
index 7df35e8..e0d2ac2 100644
--- a/gestion/templates/gestion/products_index.html
+++ b/gestion/templates/gestion/products_index.html
@@ -74,6 +74,9 @@
{% if perms.gestion.view_pinte %}
Lister les pintes
{% endif %}
+ {% if perms.auth.view_user %}
+ Lister les utilisateurs n'ayant pas rendu leurs pintes
+ {% endif %}
{% endblock %}
diff --git a/gestion/urls.py b/gestion/urls.py
index ffce4b8..bacf61f 100644
--- a/gestion/urls.py
+++ b/gestion/urls.py
@@ -37,6 +37,7 @@ urlpatterns = [
path('releasePintes', views.release_pintes, name="releasePintes"),
path('pintesList', views.pintes_list, name="pintesList"),
path('release/', views.release, name="release"),
+ path('pintesUserList', views.pintes_user_list, name="pintesUserList"),
path('products-autocomplete', views.ProductsAutocomplete.as_view(), name="products-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"),
diff --git a/gestion/views.py b/gestion/views.py
index f19d30a..6eea6ca 100644
--- a/gestion/views.py
+++ b/gestion/views.py
@@ -980,4 +980,12 @@ def release_pintes(request):
def pintes_list(request):
free_pintes = Pinte.objects.filter(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})
\ No newline at end of file
+ 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})
\ No newline at end of file
diff --git a/users/templates/users/profile.html b/users/templates/users/profile.html
index d5ab3c3..d1ec3d8 100644
--- a/users/templates/users/profile.html
+++ b/users/templates/users/profile.html
@@ -42,7 +42,8 @@
Groupe(s) : {{user.groups.all|join:", "}}
Position au classement : {{user.profile.rank}}
- Quantité d'alcool ingérée : {{user.profile.alcohol | floatformat:"-2"}} kg
+ Quantité d'alcool ingérée : {{user.profile.alcohol | floatformat:"-2"}} kg
+ Nombre de pinte(s) non rendue(s) : {{ user.pintes_owned_currently.count }}