From 58f3293762b098ae0f4668fe2118aa7198f162ca Mon Sep 17 00:00:00 2001 From: Andrea Lepori Date: Thu, 19 Aug 2021 22:19:58 +0200 Subject: remove some for loops user db query instead --- server/templates/server/data_request.html | 10 ++- server/templates/server/doc_type.html | 2 +- server/templates/server/user_list.html | 101 +++++++++++++++--------------- 3 files changed, 61 insertions(+), 52 deletions(-) (limited to 'server/templates') diff --git a/server/templates/server/data_request.html b/server/templates/server/data_request.html index fbbcbc0..7728cd9 100644 --- a/server/templates/server/data_request.html +++ b/server/templates/server/data_request.html @@ -29,7 +29,7 @@
Invia - Copia risultato + Copia risultato
@@ -38,6 +38,12 @@ {% endblock %} {% block script %} +$(document).ready(function(){ + {% if error %} + M.toast({html: '{{ error }}', classes: 'orange'}) + {% endif %} +}); + document.addEventListener('DOMContentLoaded', function() { var elems = document.querySelectorAll('select'); var options = {}; @@ -45,6 +51,8 @@ document.addEventListener('DOMContentLoaded', function() { }); function copy() { + M.toast({html: 'Valore copiato!', classes: 'green'}) + var copyText = document.getElementById("data"); copyText.select(); copyText.setSelectionRange(0, 99999); /*For mobile devices*/ diff --git a/server/templates/server/doc_type.html b/server/templates/server/doc_type.html index 1ef1433..047a15a 100644 --- a/server/templates/server/doc_type.html +++ b/server/templates/server/doc_type.html @@ -146,7 +146,7 @@
edit Modifica tipo - file_download Scarica CSV + file_download Scarica CSV {% if doctype.0.medical_data %} file_download Scarica CSV (con dati medici) {% endif %} diff --git a/server/templates/server/user_list.html b/server/templates/server/user_list.html index aa2f43e..a14daea 100644 --- a/server/templates/server/user_list.html +++ b/server/templates/server/user_list.html @@ -18,6 +18,7 @@ {% endblock %} {% block content %} +{% load app_filter %}
{% csrf_token %} @@ -25,43 +26,43 @@ {% for user in users %}
  • - {% if user.0.is_staff %} + {% if user.user.is_staff %} star - {% elif user.6 %} + {% elif "capi" in user.user|user_groups %} star_border {% endif %} - {{user.0.first_name}} {{user.0.last_name}} + {{user.user.first_name}} {{user.user.last_name}}
    - {% if not user.0.is_staff %} -
    - +
    - +
    - +
    @@ -190,7 +191,7 @@ È sostenitore REGA   @@ -201,15 +202,15 @@
    Medico di famiglia
    - +
    - +
    - +
  • @@ -218,45 +219,45 @@
    Scheda medica personale
    - +
    - +
    - +
    - +
    Deve assumere regolarmente medicamenti  
    - +
    Informazioni particolari sullo stato di salute: (postumi di operazioni, incidenti, malattie, disturbi fisici)  
    - +
    @@ -270,7 +271,7 @@
    - {% if user.4 %}{% endif %} + {% if user.medic.health_care_certificate %}{% endif %}
    @@ -279,7 +280,7 @@
    - {% if user.5 %}{% endif %} + {% if user.medic.vac_certificate %}{% endif %}
    @@ -292,7 +293,7 @@