aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--server/templates/server/doc_list.html20
-rw-r--r--server/templates/server/doc_type.html20
-rw-r--r--server/templates/server/index.html14
-rw-r--r--server/templates/server/user_list.html8
-rw-r--r--server/views.py21
5 files changed, 29 insertions, 54 deletions
diff --git a/server/templates/server/doc_list.html b/server/templates/server/doc_list.html
index fb201d5..3953905 100644
--- a/server/templates/server/doc_list.html
+++ b/server/templates/server/doc_list.html
@@ -145,25 +145,19 @@
<br>
<br>
{% endif %}
- <ul class="collapsible">
+ <ul class="collection">
{% if doc.0.status == 'ok' or doc.0.status == 'archive' %}
- <li>
- <div class="collapsible-header">
- <i class="material-icons">confirmation_number</i>{{doc.0.code}}
- </div>
+ <li class="collection-item">
+ <i class="material-icons left">confirmation_number</i>{{doc.0.code}}
</li>
{% endif %}
{% if doc.0.document_type.custom_group %}
- <li>
- <div class="collapsible-header">
- <i class="material-icons">group_work</i>{{doc.0.group.name}}
- </div>
+ <li class="collection-item">
+ <i class="material-icons left">group_work</i>{{doc.0.group.name}}
</li>
{% endif %}
- <li>
- <div class="collapsible-header">
- <i class="material-icons">send</i>{{doc.0.compilation_date}}
- </div>
+ <li class="collection-item">
+ <i class="material-icons left">send</i>{{doc.0.compilation_date}}
</li>
</ul>
<ul class="collapsible">
diff --git a/server/templates/server/doc_type.html b/server/templates/server/doc_type.html
index 82adf83..d102664 100644
--- a/server/templates/server/doc_type.html
+++ b/server/templates/server/doc_type.html
@@ -160,26 +160,20 @@
<span class="new badge red lighten-1" data-badge-caption="">{{doctype.2}}</span>
</div>
<div class="collapsible-body"><span>
- <ul class="collapsible">
+ <ul class="collection">
{% if not doctype.0.group_private %}
- <li>
- <div class="collapsible-header">
- <i class="material-icons">group_work</i>{{doctype.0.group.name}}
- </div>
+ <li class="collection-item">
+ <i class="material-icons left">group_work</i>{{doctype.0.group.name}}
</li>
{% endif %}
{% if doctype.0.personal_data %}
- <li>
- <div class="collapsible-header">
- <i class="material-icons">person</i>Dati personali
- </div>
+ <li class="collection-item">
+ <i class="material-icons left">person</i>Dati personali
</li>
{% endif %}
{% if doctype.0.medical_data %}
- <li>
- <div class="collapsible-header">
- <i class="material-icons">healing</i>Dati medici
- </div>
+ <li class="collection-item">
+ <i class="material-icons left">healing</i>Dati medici
</li>
{% endif %}
</ul>
diff --git a/server/templates/server/index.html b/server/templates/server/index.html
index a049f4f..57cfc83 100644
--- a/server/templates/server/index.html
+++ b/server/templates/server/index.html
@@ -18,8 +18,6 @@
<th>Username</th>
<th>Nome</th>
<th>Cognome</th>
- <th>Codice</th>
- <th>Stato</th>
</tr>
{% for user in users %}
<tr>
@@ -40,22 +38,20 @@
<div class="col l6 s12">
<div class="card large">
<div class="card-content">
- <ul class="collapsible">
+ <ul class="collection">
{% for doctype in docs %}
- <li>
- <div class="collapsible-header">
+ <li class="collection-item">
{% if not doctype.0.enabled %}
- <i class="material-icons">visibility_off</i>
+ <i class="material-icons left">visibility_off</i>
{% endif %}
{% if not doctype.0.group_private %}
- <i class="material-icons">public</i>
+ <i class="material-icons left">public</i>
{% endif %}
{% if doctype.0.auto_sign %}
- <i class="material-icons">assignment_turned_in</i>
+ <i class="material-icons left">assignment_turned_in</i>
{% endif %}
{{doctype.0.name}}
<span class="new badge red lighten-1" data-badge-caption="">{{doctype.1}}</span>
- </div>
{% endfor %}
</ul>
</div>
diff --git a/server/templates/server/user_list.html b/server/templates/server/user_list.html
index 1010bd4..26e4b11 100644
--- a/server/templates/server/user_list.html
+++ b/server/templates/server/user_list.html
@@ -67,11 +67,9 @@
<a class="waves-effect waves-light btn red lighten-1 modal-trigger" href="#modal{{user.0.id}}"><i class="material-icons left">remove_circle_outline</i>Deapprova utente</a>
<br><br>
{% endif %}
- <ul class="collapsible">
- <li>
- <div class="collapsible-header">
- <i class="material-icons">confirmation_number</i>U{{user.1.code}}
- </div>
+ <ul class="collection">
+ <li class="collection-item">
+ <i class="material-icons left">confirmation_number</i>U{{user.1.code}}
</li>
</ul>
<ul class="collapsible">
diff --git a/server/views.py b/server/views.py
index e4b70ff..c634e6b 100644
--- a/server/views.py
+++ b/server/views.py
@@ -17,29 +17,21 @@ import pdfkit
from io import BytesIO
import os, base64
-# Create your views here.
-
@staff_member_required
def index(request):
context = {}
parent_group = request.user.groups.values_list('name', flat=True)[
0]
- users = User.objects.filter(groups__name=parent_group)
+ users = User.objects.filter(groups__name=parent_group).order_by("id")
users_out = []
+
for user in users:
- code = ""
- if len(UserCode.objects.filter(user=user)) > 0:
- code = 'U' + str(UserCode.objects.filter(user=user)[0].code)
- status = ""
- if user.is_staff:
- status = "Staff"
- elif user.has_perm("client.approved"):
- status = "Attivo"
- else:
- status = "In attesa"
+ if not user.has_perm("client.approved") and not user.is_staff:
+ continue
+
users_out.append([user.username, user.first_name,
- user.last_name, code, status])
+ user.last_name])
parent_group = request.user.groups.values_list('name', flat=True)[
0]
@@ -168,6 +160,7 @@ def ulist(request):
content_type = ContentType.objects.get_for_model(Document)
permission = Permission.objects.get(content_type=content_type, codename="approved")
user.user_permissions.remove(permission)
+ return HttpResponseRedirect("ulist")
users = User.objects.filter(groups__name=parent_group).order_by("first_name")
out = []