From 0de1f0a309c62a9e6dd9eb48e38b32c552e09c6c Mon Sep 17 00:00:00 2001 From: Andrea Lepori Date: Mon, 24 Jul 2023 18:31:02 +0200 Subject: create new persons and edit --- accounts/templates/accounts/user_edit.html | 592 +++++++++++++++++++++++++++++ 1 file changed, 592 insertions(+) create mode 100644 accounts/templates/accounts/user_edit.html (limited to 'accounts/templates') diff --git a/accounts/templates/accounts/user_edit.html b/accounts/templates/accounts/user_edit.html new file mode 100644 index 0000000..21e3ed8 --- /dev/null +++ b/accounts/templates/accounts/user_edit.html @@ -0,0 +1,592 @@ +{% extends 'registration/base_client.html' %} +{% load static %} + +{% block title %}Modifica persona{% endblock %} + +{% block breadcrumb %} + Persona +{% endblock %} + +{% block content %} +
+
+
Continua l'attivazione
+

Usa questo pulsante per tornare alla home e continuare il processo d'attivazione

+
+
+ +
+
+
+
+
+
+ + + + {% csrf_token %} +
+
+ + + +
+
+ + + +
+
+ + + +
+
+
+
+ + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+
+
+
+
+ +
+
+
+
+
+
Persona di contatto in caso di necessità
+
+
+
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + +
+
+
+
+
Assicurazione
+
+
+
+
+ + + +
+
+ + + +
+
+ + + +
+
+
+
+ È sostenitore REGA   + +
+
+
+
+
Medico di famiglia
+
+
+ + + +
+
+ + + +
+
+ + + +
+
+
+
+
Scheda medica personale
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ Deve assumere regolarmente medicamenti   + +
+
+
+
+

In caso dovesse assumere farmaci, avvisare comunque i capi

+
+
+
+
+ + +
+
+ Informazioni particolari sullo stato di salute: (postumi di operazioni, incidenti, malattie, disturbi fisici)   + +
+
+ + +
+
+
+
+
Allegati
+
+
+
+
+ Certificato di vacinazione +
+
+ file_uploadFile + +
+
+ +
+
+ {% if vac_certificate != ''%} + file_downloadDownload + deleteElimina + {% endif %} +
+
+
+
+
+
+ Tessera cassa malati +
+
+ file_uploadFile + +
+
+ +
+
+ {% if health_care_certificate != ''%} + file_downloadDownload + deleteElimina + {% endif %} +
+
+
+
+ +
+
+
+
+{% endblock %} + +{% block script %} +function send(id) { + $('#form1').trigger('reinitialize.areYouSure'); + var form = document.getElementById('form1'); + var action = document.getElementById('action'); + action.setAttribute('value', id); + $(':disabled').each(function(e) { + $(this).removeAttr('disabled'); + }) + form.submit(); +} + +function delete_vac() { + var action = document.getElementById('delete_vac'); + var text = document.getElementById('vac_file'); + action.setAttribute('value', 'vac'); + text.setAttribute('value', ''); +} + +function delete_health() { + var action = document.getElementById('delete_health'); + var text = document.getElementById('health_care_file'); + action.setAttribute('value', 'health'); + text.setAttribute('value', ''); +} + +var elem = $('.tabs') +var options = { + yearRange:100, + format:'dd mmmm yyyy', + i18n: { + months: [ 'gennaio', 'febbraio', 'marzo', 'aprile', 'maggio', 'giugno', 'luglio', 'agosto', 'settembre', 'ottobre', 'novembre', 'dicembre' ], + monthsShort: [ 'gen', 'feb', 'mar', 'apr', 'mag', 'giu', 'lug', 'ago', 'set', 'ott', 'nov', 'dic' ], + weekdays: [ 'domenica', 'lunedì', 'martedì', 'mercoledì', 'giovedì', 'venerdì', 'sabato' ], + weekdaysShort: [ 'dom', 'lun', 'mar', 'mer', 'gio', 'ven', 'sab' ], + weekdaysAbbrev: [ 'D', 'L', 'M', 'M', 'G', 'V', 'S' ], + today: 'Oggi', + clear: 'Cancella', + close: 'Chiudi', + firstDay: 1, + format: 'dddd d mmmm yyyy', + formatSubmit: 'yyyy/mm/dd', + labelMonthNext: 'Mese successivo', + labelMonthPrev: 'Mese precedente', + labelMonthSelect: 'Seleziona un mese', + labelYearSelect: 'Seleziona un anno' + } +} + +$(document).ready(function() { + $('input#sickness, input#vaccine, input#allergy, input#drugs, input#misc').characterCounter(); + $('.datepicker').datepicker(options); + $('select').formSelect(); + $('.tap-target').tapTarget(); + {% for error in errors %} + M.toast({html: '{{ error }}', classes: 'orange'}) + {% endfor %} + {% if ok_message %} + M.toast({html: '{{ ok_message }}', classes: 'green'}) + {% endif %} + {% if home_tooltip %} + $('.tap-target').tapTarget('open'); + {% endif %} + document.getElementById("vac_certificate").onchange = function() { + for (i=0; i < this.files.length; i++) { + if(this.files[i].size > 1048576*10) { + M.toast({html: 'Il file è troppo grande. Grandezza massima 10MB', classes: 'orange'}); + this.value = ""; + break; + } + } + }; + + document.getElementById("health_care_certificate").onchange = function() { + for (i=0; i < this.files.length; i++) { + if(this.files[i].size > 1048576*10) { + M.toast({html: 'Il file è troppo grande. Grandezza massima 10MB', classes: 'orange'}); + this.value = ""; + break; + } + } + }; + +}); + +/*! + * jQuery Plugin: Are-You-Sure (Dirty Form Detection) + * https://github.com/codedance/jquery.AreYouSure/ + * + * Copyright (c) 2012-2014, Chris Dance and PaperCut Software http://www.papercut.com/ + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * Author: chris.dance@papercut.com + * Version: 1.9.0 + * Date: 13th August 2014 + */ +(function($) { + + $.fn.areYouSure = function(options) { + + var settings = $.extend( + { + 'message' : 'You have unsaved changes!', + 'dirtyClass' : 'dirty', + 'change' : null, + 'silent' : false, + 'addRemoveFieldsMarksDirty' : false, + 'fieldEvents' : 'change keyup propertychange input', + 'fieldSelector': ":input:not(input[type=submit]):not(input[type=button])" + }, options); + + var getValue = function($field) { + if ($field.hasClass('ays-ignore') + || $field.hasClass('aysIgnore') + || $field.attr('data-ays-ignore') + || $field.attr('name') === undefined) { + return null; + } + + if ($field.is(':disabled')) { + return 'ays-disabled'; + } + + var val; + var type = $field.attr('type'); + if ($field.is('select')) { + type = 'select'; + } + + switch (type) { + case 'checkbox': + case 'radio': + val = $field.is(':checked'); + break; + case 'select': + val = ''; + $field.find('option').each(function(o) { + var $option = $(this); + if ($option.is(':selected')) { + val += $option.val(); + } + }); + break; + default: + val = $field.val(); + } + + return val; + }; + + var storeOrigValue = function($field) { + $field.data('ays-orig', getValue($field)); + }; + + var checkForm = function(evt) { + + var isFieldDirty = function($field) { + var origValue = $field.data('ays-orig'); + if (undefined === origValue) { + return false; + } + return (getValue($field) != origValue); + }; + + var $form = ($(this).is('form')) + ? $(this) + : $(this).parents('form'); + + // Test on the target first as it's the most likely to be dirty + if (isFieldDirty($(evt.target))) { + setDirtyStatus($form, true); + return; + } + + $fields = $form.find(settings.fieldSelector); + + if (settings.addRemoveFieldsMarksDirty) { + // Check if field count has changed + var origCount = $form.data("ays-orig-field-count"); + if (origCount != $fields.length) { + setDirtyStatus($form, true); + return; + } + } + + // Brute force - check each field + var isDirty = false; + $fields.each(function() { + var $field = $(this); + if (isFieldDirty($field)) { + isDirty = true; + return false; // break + } + }); + + setDirtyStatus($form, isDirty); + }; + + var initForm = function($form) { + var fields = $form.find(settings.fieldSelector); + $(fields).each(function() { storeOrigValue($(this)); }); + $(fields).unbind(settings.fieldEvents, checkForm); + $(fields).bind(settings.fieldEvents, checkForm); + $form.data("ays-orig-field-count", $(fields).length); + setDirtyStatus($form, false); + }; + + var setDirtyStatus = function($form, isDirty) { + var changed = isDirty != $form.hasClass(settings.dirtyClass); + $form.toggleClass(settings.dirtyClass, isDirty); + + // Fire change event if required + if (changed) { + if (settings.change) settings.change.call($form, $form); + + if (isDirty) $form.trigger('dirty.areYouSure', [$form]); + if (!isDirty) $form.trigger('clean.areYouSure', [$form]); + $form.trigger('change.areYouSure', [$form]); + } + }; + + var rescan = function() { + var $form = $(this); + var fields = $form.find(settings.fieldSelector); + $(fields).each(function() { + var $field = $(this); + if (!$field.data('ays-orig')) { + storeOrigValue($field); + $field.bind(settings.fieldEvents, checkForm); + } + }); + // Check for changes while we're here + $form.trigger('checkform.areYouSure'); + }; + + var reinitialize = function() { + initForm($(this)); + } + + if (!settings.silent && !window.aysUnloadSet) { + window.aysUnloadSet = true; + $(window).bind('beforeunload', function() { + $dirtyForms = $("form").filter('.' + settings.dirtyClass); + if ($dirtyForms.length == 0) { + return; + } + // Prevent multiple prompts - seen on Chrome and IE + if (navigator.userAgent.toLowerCase().match(/msie|chrome/)) { + if (window.aysHasPrompted) { + return; + } + window.aysHasPrompted = true; + window.setTimeout(function() {window.aysHasPrompted = false;}, 900); + } + return settings.message; + }); + } + + return this.each(function(elem) { + if (!$(this).is('form')) { + return; + } + var $form = $(this); + + $form.submit(function() { + $form.removeClass(settings.dirtyClass); + }); + $form.bind('reset', function() { setDirtyStatus($form, false); }); + // Add a custom events + $form.bind('rescan.areYouSure', rescan); + $form.bind('reinitialize.areYouSure', reinitialize); + $form.bind('checkform.areYouSure', checkForm); + initForm($form); + }); + }; +})(jQuery); +$('form').areYouSure(); + +{% endblock %} \ No newline at end of file -- cgit v1.2.1