From 6491760abc0b776f646df671cecf5d97bbc0de79 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Wed, 11 Oct 2023 16:23:45 +0200 Subject: [PATCH] add admin user list --- idhub/admin/views.py | 7 +++++++ idhub/templates/idhub/admin_people.html | 26 +++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/idhub/admin/views.py b/idhub/admin/views.py index 5d66788..1d1497b 100644 --- a/idhub/admin/views.py +++ b/idhub/admin/views.py @@ -2,6 +2,7 @@ import logging from django.utils.translation import gettext_lazy as _ from django.views.generic.base import TemplateView +from django.contrib.auth.models import User from django.urls import reverse_lazy from django.contrib import messages from idhub.mixins import AdminView @@ -44,6 +45,12 @@ class AdminPeopleView(People): subtitle = _('People list') icon = 'bi bi-person' + def get_context_data(self, **kwargs): + context = super().get_context_data(**kwargs) + context.update({ + 'users': User.objects.filter(), + }) + return context class AdminPeopleRegisterView(People): template_name = "idhub/admin_people_register.html" diff --git a/idhub/templates/idhub/admin_people.html b/idhub/templates/idhub/admin_people.html index db4eecd..9c6327a 100644 --- a/idhub/templates/idhub/admin_people.html +++ b/idhub/templates/idhub/admin_people.html @@ -2,4 +2,30 @@ {% load i18n %} {% block content %} +
+ + + + + + + + + + + + + {% for user in users %} + + + + + + + + + {% endfor %} + +
{{ user.last_name }}{{ user.first_name }}{{ user.username }}{{ user.get_membership }}{{ user.get_role }}{% trans 'View' %}
+
{% endblock %}