From a531c5e12a65ac7c216bb3f91e510c1d31fbb06e Mon Sep 17 00:00:00 2001 From: Andrea Lepori Date: Tue, 21 Jul 2020 21:47:09 +0200 Subject: static files, last improvements --- client/templates/client/approve.html | 2 +- client/templates/client/doc_create.html | 3 ++- client/templates/client/doc_edit.html | 3 ++- client/templates/client/index.html | 18 +++++++++++++++++- client/views.py | 10 ++++++++-- 5 files changed, 30 insertions(+), 6 deletions(-) (limited to 'client') diff --git a/client/templates/client/approve.html b/client/templates/client/approve.html index f440fbe..d24df88 100644 --- a/client/templates/client/approve.html +++ b/client/templates/client/approve.html @@ -24,7 +24,7 @@
-

Per approvare l'utente inserire prima i propri dati personali cliccando il proprio nome in alto a destra.

+

Per approvare l'utente inserire prima i propri dati personali e medici cliccando il proprio nome in alto a destra.

diff --git a/client/templates/client/doc_create.html b/client/templates/client/doc_create.html index 710ba29..82d23ff 100644 --- a/client/templates/client/doc_create.html +++ b/client/templates/client/doc_create.html @@ -117,7 +117,8 @@ $(document).ready(function(){ {% if error %} M.toast({html: '{{ error_text}}', classes: 'orange'}) {% endif %} - }); +}); + function send(id) { var form = document.getElementById('form') var action = document.getElementById('action') diff --git a/client/templates/client/doc_edit.html b/client/templates/client/doc_edit.html index 0048fd5..3c97eee 100644 --- a/client/templates/client/doc_edit.html +++ b/client/templates/client/doc_edit.html @@ -96,7 +96,8 @@ $(document).ready(function(){ {% if error %} M.toast({html: '{{ error_text}}', classes: 'orange'}) {% endif %} - }); +}); + function send(id) { var form = document.getElementById('form') form.submit() diff --git a/client/templates/client/index.html b/client/templates/client/index.html index 0eb244e..2ddbfdc 100644 --- a/client/templates/client/index.html +++ b/client/templates/client/index.html @@ -44,7 +44,19 @@

{% elif doc.0.status == "autosign" %} - checkApprova documento + + checkApprova documento delete Elimina documento edit Modifica documento
@@ -335,15 +347,19 @@ $(document).ready(function(){ $('.collapsible').collapsible(); $('.tap-target').tapTarget(); + $('.modal').modal(); + $('.tooltipped').tooltip(); {% if empty %} $('.tap-target').tapTarget('open'); {% endif %} }); + $('*').click(function(event) { if (this === event.target) { $('.tap-target').tapTarget('close'); } }); + function send(id) { var form = document.getElementById('form') var action = document.getElementById('action') diff --git a/client/views.py b/client/views.py index f215e7e..6cc7a15 100644 --- a/client/views.py +++ b/client/views.py @@ -36,6 +36,9 @@ def index(request): if document.user != request.user: return + if document.status == "ok" or document.status == "archive": + return + if request.POST["action"][0] == 'f': template = get_template('client/approve_doc_pdf.html') context = {'doc': document} @@ -46,8 +49,9 @@ def index(request): return FileResponse(result, as_attachment=True, filename=document.document_type.name+".pdf") elif request.POST["action"][0] == 'a': - document.status = "ok" - document.save() + if document.status == "autosign": + document.status = "ok" + document.save() elif request.POST["action"][0] == 'd': document.delete() elif request.POST["action"][0] == 'e': @@ -73,6 +77,8 @@ def index(request): for i in documents: personal = None medical = None + vac_file = "" + health_file = "" if i.document_type.personal_data: personal = i.personal_data if i.document_type.medical_data: -- cgit v1.2.1