aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorAndrea Lepori <alepori@student.ethz.ch>2020-06-19 15:05:59 +0200
committerAndrea Lepori <alepori@student.ethz.ch>2020-06-19 15:05:59 +0200
commit619e0e0f5263875b753334483d9b896194e9a61d (patch)
tree861b970de54b77ad715aa9d4177eaaad384c198a /server
parentinitial commit (diff)
downloadscout-subs-619e0e0f5263875b753334483d9b896194e9a61d.tar.gz
scout-subs-619e0e0f5263875b753334483d9b896194e9a61d.zip
More data for users
Diffstat (limited to '')
-rw-r--r--server/templates/server/approve_user.html14
-rw-r--r--server/templates/server/index.html14
-rw-r--r--server/templates/server/user_list.html14
-rw-r--r--server/views.py50
4 files changed, 53 insertions, 39 deletions
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 %}
-<nav>
- <div class="nav-wrapper">
- <a style="margin-left: 10px;" href="{% url 'index' %}" class="breadcrumb">Home</a>
- <a href="{% url 'server'%}" class="breadcrumb">Admin</a>
- <a href="#!" class="breadcrumb">Approva Utente</a>
- <ul class="right hide-on-med-and-down">
- <li>{{ user.username}}</li>
- <li><a href="{% url 'logout' %}"><i class="material-icons">exit_to_app</i></a></li>
- </ul>
- </div>
-</nav>
+ <a style="margin-left: 10px;" href="{% url 'index' %}" class="breadcrumb">Home</a>
+ <a href="{% url 'server'%}" class="breadcrumb hide-on-med-and-down">Admin</a>
+ <a href="#!" class="breadcrumb hide-on-med-and-down">Approva Utente</a>
{% 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 %}
-<nav>
- <div class="nav-wrapper">
<a style="margin-left: 10px;" href="{% url 'index' %}" class="breadcrumb">Home</a>
- <a href="#!" class="breadcrumb">Admin</a>
- <ul class="right hide-on-med-and-down">
- <li>{{ user.username}}</li>
- <li><a href="{% url 'logout' %}"><i class="material-icons">exit_to_app</i></a></li>
- </ul>
- </div>
-</nav>
+ <a href="#!" class="breadcrumb hide-on-med-and-down">Admin</a>
{% endblock %}
{% block content %}
<div class="row">
- <div class="col s6">
+ <div class="col l6 s12">
<div class="card large">
<div class="card-content">
<p>
@@ -45,7 +37,7 @@
</div>
</div>
</div>
- <div class="col s6">
+ <div class="col l6 s12">
<div class="card large">
<div class="card-content">
<p>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 %}
-<nav>
- <div class="nav-wrapper">
- <a style="margin-left: 10px;" href="{% url 'index' %}" class="breadcrumb">Home</a>
- <a href="{% url 'server'%}" class="breadcrumb">Admin</a>
- <a href="#!" class="breadcrumb">Lista Utenti</a>
- <ul class="right hide-on-med-and-down">
- <li>{{ user.username}}</li>
- <li><a href="{% url 'logout' %}"><i class="material-icons">exit_to_app</i></a></li>
- </ul>
- </div>
-</nav>
+ <a style="margin-left: 10px;" href="{% url 'index' %}" class="breadcrumb">Home</a>
+ <a href="{% url 'server'%}" class="breadcrumb hide-on-med-and-down">Admin</a>
+ <a href="#!" class="breadcrumb hide-on-med-and-down">Lista Utenti</a>
{% 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: