From 619e0e0f5263875b753334483d9b896194e9a61d Mon Sep 17 00:00:00 2001 From: Andrea Lepori Date: Fri, 19 Jun 2020 15:05:59 +0200 Subject: More data for users --- server/templates/server/approve_user.html | 14 ++------- server/templates/server/index.html | 14 ++------- server/templates/server/user_list.html | 14 ++------- server/views.py | 50 +++++++++++++++++++++++++++---- 4 files changed, 53 insertions(+), 39 deletions(-) (limited to 'server') diff --git a/server/templates/server/approve_user.html b/server/templates/server/approve_user.html index ae9dc8b..126c0b9 100644 --- a/server/templates/server/approve_user.html +++ b/server/templates/server/approve_user.html @@ -3,17 +3,9 @@ {% block title %}Admin - Approva Utente{% endblock %} {% block nav %} - + Home + Admin + Approva Utente {% endblock %} {% block content %} diff --git a/server/templates/server/index.html b/server/templates/server/index.html index 4790a1d..37a553b 100644 --- a/server/templates/server/index.html +++ b/server/templates/server/index.html @@ -3,21 +3,13 @@ {% block title %}Admin{% endblock %} {% block nav %} - + Admin {% endblock %} {% block content %}
-
+

@@ -45,7 +37,7 @@

-
+

I am a very simple card. I am good at containing small bits of information. diff --git a/server/templates/server/user_list.html b/server/templates/server/user_list.html index daf7303..3837619 100644 --- a/server/templates/server/user_list.html +++ b/server/templates/server/user_list.html @@ -3,17 +3,9 @@ {% block title %}Admin - Lista Utenti{% endblock %} {% block nav %} -

+ Home + Admin + Lista Utenti {% endblock %} {% block content %} diff --git a/server/views.py b/server/views.py index ab94fd6..aa2dc3a 100644 --- a/server/views.py +++ b/server/views.py @@ -18,7 +18,7 @@ def index(request): code = 'U' + str(UserCode.objects.filter(user=user)[0].code) status = "" if user.is_staff: - status = "Capo" + status = "Staff" elif user.has_perm("client.approved"): status = "Attivo" else: @@ -83,17 +83,55 @@ def ulist(request): out = [] for user in users: code = "" - if len(UserCode.objects.filter(user=user)) > 0: - code = 'U' + str(UserCode.objects.filter(user=user)[0].code) + parent_name = "" + via = "" + cap = "" + country = "" + nationality = "" + born_date = "" + home_phone = "" + phone = "" + school = "" + year = "" status = "" if user.is_staff: - status = "Capo" + status = "Staff" elif user.has_perm("approved"): status = "Attivo" else: status = "In attesa" - out.append([user.username, user.first_name, - user.last_name, code, status]) + if len(UserCode.objects.filter(user=user)) > 0: + usercode = UserCode.objects.filter(user=user)[0] + code = 'U' + str(usercode.code) + parent_name = usercode.parent_name + via = usercode.via + cap = usercode.cap + country = usercode.country + nationality = usercode.nationality + born_date = usercode.born_date + home_phone = usercode.home_phone + phone = usercode.phone + school = usercode.school + year = usercode.year + else: + status = "Non registrato" + out.append([ + status, + user.username, + user.first_name, + user.last_name, + born_date, + parent_name, + user.email, + phone, + home_phone, + via, + cap, + country, + nationality, + school, + year, + code]) context = {'users': out} return render(request, 'server/user_list.html', context) else: -- cgit v1.2.1