From 3a175662da52cc770d52e46a9abe2cd782aa2142 Mon Sep 17 00:00:00 2001 From: Andrea Lepori Date: Mon, 20 Jul 2020 23:53:03 +0200 Subject: search users, show attachments, fancy pass reset --- accounts/templates/accounts/index.html | 19 +++++++++++++------ accounts/views.py | 4 ++-- 2 files changed, 15 insertions(+), 8 deletions(-) (limited to 'accounts') diff --git a/accounts/templates/accounts/index.html b/accounts/templates/accounts/index.html index a6e6edd..01240ad 100644 --- a/accounts/templates/accounts/index.html +++ b/accounts/templates/accounts/index.html @@ -51,11 +51,12 @@ {% endblock%} {% block content %} +
- +
@@ -130,6 +131,7 @@ save
+
@@ -323,6 +325,7 @@ {% block script %} function send(id) { + $('#form').trigger('reinitialize.areYouSure'); var form = document.getElementById('form'); var action = document.getElementById('action'); action.setAttribute('value', id); @@ -364,17 +367,21 @@ var options = { labelMonthSelect: 'Seleziona un mese', labelYearSelect: 'Seleziona un anno' }} + var instance = M.Tabs.init(elem, options); + document.addEventListener('DOMContentLoaded', function() { -var elems = document.querySelectorAll('.datepicker'); -var instances = M.Datepicker.init(elems, options); + var elems = document.querySelectorAll('.datepicker'); + var instances = M.Datepicker.init(elems, options); }); + document.addEventListener('DOMContentLoaded', function() { -var elems = document.querySelectorAll('select'); -var instances = M.FormSelect.init(elems, options); + var elems = document.querySelectorAll('select'); + var instances = M.FormSelect.init(elems, options); }); + $(document).ready(function() { -$('input#sickness, input#vaccine, input#allergy, input#drugs, input#misc').characterCounter(); + $('input#sickness, input#vaccine, input#allergy, input#drugs, input#misc').characterCounter(); }); /*! diff --git a/accounts/views.py b/accounts/views.py index 24e1b96..369e173 100644 --- a/accounts/views.py +++ b/accounts/views.py @@ -99,11 +99,11 @@ def personal(request): medic.save() if request.POST["delete_vac"] == 'vac': - medic.vac_certificate.delete() + medic.vac_certificate = None medic.save() if request.POST["delete_health"] == 'health': - medic.health_care_certificate.delete() + medic.health_care_certificate = None medic.save() if len(request.user.groups.values_list('name', flat=True)) == 0: -- cgit v1.2.1