Przeglądaj źródła

Merge remote-tracking branch 'refs/remotes/origin/master'

mauro 1 rok temu
rodzic
commit
2cb1464876
100 zmienionych plików z 311 dodań i 394 usunięć
  1. BIN
      att/__pycache__/__init__.cpython-311.pyc
  2. BIN
      att/__pycache__/admin.cpython-311.pyc
  3. BIN
      att/__pycache__/apps.cpython-311.pyc
  4. BIN
      att/__pycache__/models.cpython-311.pyc
  5. BIN
      att/__pycache__/views.cpython-311.pyc
  6. 19 0
      att/migrations/0010_alter_attivita_data.py
  7. 19 0
      att/migrations/0011_alter_attivita_data.py
  8. BIN
      att/migrations/__pycache__/0001_initial.cpython-311.pyc
  9. BIN
      att/migrations/__pycache__/0002_attivita_utente.cpython-311.pyc
  10. BIN
      att/migrations/__pycache__/0003_alter_attivita_data.cpython-311.pyc
  11. BIN
      att/migrations/__pycache__/0004_attivita_causale_alter_attivita_data.cpython-311.pyc
  12. BIN
      att/migrations/__pycache__/0005_rename_causale_causale_nome_alter_attivita_data.cpython-311.pyc
  13. BIN
      att/migrations/__pycache__/0006_attivita_valore_causale_schema_alter_attivita_data.cpython-311.pyc
  14. BIN
      att/migrations/__pycache__/0007_alter_attivita_amministratore_alter_attivita_azienda_and_more.cpython-311.pyc
  15. BIN
      att/migrations/__pycache__/0008_alter_attivita_data.cpython-311.pyc
  16. BIN
      att/migrations/__pycache__/0009_alter_attivita_data.cpython-311.pyc
  17. BIN
      att/migrations/__pycache__/__init__.cpython-311.pyc
  18. BIN
      azienda/__pycache__/__init__.cpython-311.pyc
  19. BIN
      azienda/__pycache__/admin.cpython-311.pyc
  20. BIN
      azienda/__pycache__/apps.cpython-311.pyc
  21. BIN
      azienda/__pycache__/models.cpython-311.pyc
  22. BIN
      azienda/__pycache__/urls.cpython-311.pyc
  23. BIN
      azienda/__pycache__/views.cpython-311.pyc
  24. BIN
      azienda/migrations/__pycache__/0001_initial.cpython-311.pyc
  25. BIN
      azienda/migrations/__pycache__/0002_rename_a_assegnazione_azienda.cpython-311.pyc
  26. BIN
      azienda/migrations/__pycache__/0003_azienda_azienda_azi_partita_d03251_idx.cpython-311.pyc
  27. BIN
      azienda/migrations/__pycache__/__init__.cpython-311.pyc
  28. BIN
      config/__pycache__/__init__.cpython-311.pyc
  29. BIN
      config/__pycache__/admin.cpython-311.pyc
  30. BIN
      config/__pycache__/apps.cpython-311.pyc
  31. BIN
      config/__pycache__/models.cpython-311.pyc
  32. BIN
      config/__pycache__/tests.cpython-311.pyc
  33. BIN
      config/__pycache__/views.cpython-311.pyc
  34. 23 0
      config/migrations/0003_config_nota_alter_config_valore.py
  35. BIN
      config/migrations/__pycache__/0001_initial.cpython-311.pyc
  36. BIN
      config/migrations/__pycache__/0002_config_config_conf_indice_39d8cc_idx_and_more.cpython-311.pyc
  37. BIN
      config/migrations/__pycache__/__init__.cpython-311.pyc
  38. BIN
      documento/__pycache__/__init__.cpython-311.pyc
  39. BIN
      documento/__pycache__/admin.cpython-311.pyc
  40. BIN
      documento/__pycache__/apps.cpython-311.pyc
  41. BIN
      documento/__pycache__/forms.cpython-311.pyc
  42. BIN
      documento/__pycache__/managefile.cpython-311.pyc
  43. BIN
      documento/__pycache__/models.cpython-311.pyc
  44. BIN
      documento/__pycache__/tests.cpython-311.pyc
  45. BIN
      documento/__pycache__/urls.cpython-311.pyc
  46. BIN
      documento/__pycache__/views.cpython-311.pyc
  47. BIN
      documento/migrations/__pycache__/0001_initial.cpython-311.pyc
  48. BIN
      documento/migrations/__pycache__/0002_remove_documento_utente.cpython-311.pyc
  49. BIN
      documento/migrations/__pycache__/0003_documento_utente.cpython-311.pyc
  50. BIN
      documento/migrations/__pycache__/0003_remove_documento_dataupload.cpython-311.pyc
  51. BIN
      documento/migrations/__pycache__/0004_documento_utente.cpython-311.pyc
  52. BIN
      documento/migrations/__pycache__/0004_remove_documento_dataupload.cpython-311.pyc
  53. BIN
      documento/migrations/__pycache__/0005_documento_azienda.cpython-311.pyc
  54. BIN
      documento/migrations/__pycache__/0005_remove_documento_utente.cpython-311.pyc
  55. BIN
      documento/migrations/__pycache__/0006_documento_documento_d_documen_a68d7b_idx_and_more.cpython-311.pyc
  56. BIN
      documento/migrations/__pycache__/0007_remove_documento_azienda_documento_dataupload.cpython-311.pyc
  57. BIN
      documento/migrations/__pycache__/0008_alter_documento_utente.cpython-311.pyc
  58. BIN
      documento/migrations/__pycache__/0009_documento_descrizione_alter_documento_crc.cpython-311.pyc
  59. BIN
      documento/migrations/__pycache__/0010_documento_azienda.cpython-311.pyc
  60. BIN
      documento/migrations/__pycache__/__init__.cpython-311.pyc
  61. BIN
      gd/__pycache__/__init__.cpython-311.pyc
  62. BIN
      gd/__pycache__/settings.cpython-311.pyc
  63. BIN
      gd/__pycache__/urls.cpython-311.pyc
  64. BIN
      gd/__pycache__/wsgi.cpython-311.pyc
  65. 1 1
      gd/settings.py
  66. BIN
      login/__pycache__/__init__.cpython-311.pyc
  67. BIN
      login/__pycache__/admin.cpython-311.pyc
  68. BIN
      login/__pycache__/apps.cpython-311.pyc
  69. BIN
      login/__pycache__/forms.cpython-311.pyc
  70. BIN
      login/__pycache__/models.cpython-311.pyc
  71. BIN
      login/__pycache__/tests.cpython-311.pyc
  72. BIN
      login/__pycache__/urls.cpython-311.pyc
  73. BIN
      login/__pycache__/views.cpython-311.pyc
  74. BIN
      login/migrations/__pycache__/__init__.cpython-311.pyc
  75. BIN
      utente/__pycache__/__init__.cpython-311.pyc
  76. BIN
      utente/__pycache__/admin.cpython-311.pyc
  77. BIN
      utente/__pycache__/apps.cpython-311.pyc
  78. BIN
      utente/__pycache__/forms.cpython-311.pyc
  79. BIN
      utente/__pycache__/managefile.cpython-311.pyc
  80. BIN
      utente/__pycache__/models.cpython-311.pyc
  81. BIN
      utente/__pycache__/urls.cpython-311.pyc
  82. BIN
      utente/__pycache__/views.cpython-311.pyc
  83. 0 34
      utente/forms.py~
  84. BIN
      utente/migrations/__pycache__/0001_initial.cpython-311.pyc
  85. BIN
      utente/migrations/__pycache__/0002_initial.cpython-311.pyc
  86. BIN
      utente/migrations/__pycache__/0003_alter_utente_azienda.cpython-311.pyc
  87. BIN
      utente/migrations/__pycache__/0004_utente_utente_uten_codicef_6e44c2_idx_and_more.cpython-311.pyc
  88. BIN
      utente/migrations/__pycache__/0005_utente_mail.cpython-311.pyc
  89. BIN
      utente/migrations/__pycache__/0006_rename_password_utente_pin.cpython-311.pyc
  90. BIN
      utente/migrations/__pycache__/0007_alter_utente_inserimento.cpython-311.pyc
  91. BIN
      utente/migrations/__pycache__/0008_alter_utente_inserimento.cpython-311.pyc
  92. BIN
      utente/migrations/__pycache__/__init__.cpython-311.pyc
  93. 8 1
      utente/templates/utente.download.html
  94. 109 0
      utente/templates/utente.edit.document.html
  95. 23 182
      utente/templates/utente.edit.html
  96. 31 0
      utente/templates/utente.edit.logger.html
  97. 63 0
      utente/templates/utente.edit.profile.html
  98. 0 55
      utente/templates/utente.welcome.html.old
  99. 15 0
      utente/views.py
  100. 0 121
      utente/views.py~

BIN
att/__pycache__/__init__.cpython-311.pyc


BIN
att/__pycache__/admin.cpython-311.pyc


BIN
att/__pycache__/apps.cpython-311.pyc


BIN
att/__pycache__/models.cpython-311.pyc


BIN
att/__pycache__/views.cpython-311.pyc


+ 19 - 0
att/migrations/0010_alter_attivita_data.py

@@ -0,0 +1,19 @@
+# Generated by Django 5.0.7 on 2024-08-09 14:29
+
+import datetime
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('att', '0009_alter_attivita_data'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='attivita',
+            name='data',
+            field=models.DateTimeField(default=datetime.datetime(2024, 8, 9, 16, 29, 40, 228666)),
+        ),
+    ]

+ 19 - 0
att/migrations/0011_alter_attivita_data.py

@@ -0,0 +1,19 @@
+# Generated by Django 5.0.7 on 2024-08-11 09:30
+
+import datetime
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('att', '0010_alter_attivita_data'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='attivita',
+            name='data',
+            field=models.DateTimeField(default=datetime.datetime(2024, 8, 11, 11, 30, 38, 420635)),
+        ),
+    ]

BIN
att/migrations/__pycache__/0001_initial.cpython-311.pyc


BIN
att/migrations/__pycache__/0002_attivita_utente.cpython-311.pyc


BIN
att/migrations/__pycache__/0003_alter_attivita_data.cpython-311.pyc


BIN
att/migrations/__pycache__/0004_attivita_causale_alter_attivita_data.cpython-311.pyc


BIN
att/migrations/__pycache__/0005_rename_causale_causale_nome_alter_attivita_data.cpython-311.pyc


BIN
att/migrations/__pycache__/0006_attivita_valore_causale_schema_alter_attivita_data.cpython-311.pyc


BIN
att/migrations/__pycache__/0007_alter_attivita_amministratore_alter_attivita_azienda_and_more.cpython-311.pyc


BIN
att/migrations/__pycache__/0008_alter_attivita_data.cpython-311.pyc


BIN
att/migrations/__pycache__/0009_alter_attivita_data.cpython-311.pyc


BIN
att/migrations/__pycache__/__init__.cpython-311.pyc


BIN
azienda/__pycache__/__init__.cpython-311.pyc


BIN
azienda/__pycache__/admin.cpython-311.pyc


BIN
azienda/__pycache__/apps.cpython-311.pyc


BIN
azienda/__pycache__/models.cpython-311.pyc


BIN
azienda/__pycache__/urls.cpython-311.pyc


BIN
azienda/__pycache__/views.cpython-311.pyc


BIN
azienda/migrations/__pycache__/0001_initial.cpython-311.pyc


BIN
azienda/migrations/__pycache__/0002_rename_a_assegnazione_azienda.cpython-311.pyc


BIN
azienda/migrations/__pycache__/0003_azienda_azienda_azi_partita_d03251_idx.cpython-311.pyc


BIN
azienda/migrations/__pycache__/__init__.cpython-311.pyc


BIN
config/__pycache__/__init__.cpython-311.pyc


BIN
config/__pycache__/admin.cpython-311.pyc


BIN
config/__pycache__/apps.cpython-311.pyc


BIN
config/__pycache__/models.cpython-311.pyc


BIN
config/__pycache__/tests.cpython-311.pyc


BIN
config/__pycache__/views.cpython-311.pyc


+ 23 - 0
config/migrations/0003_config_nota_alter_config_valore.py

@@ -0,0 +1,23 @@
+# Generated by Django 5.0.7 on 2024-08-09 14:29
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('config', '0002_config_config_conf_indice_39d8cc_idx_and_more'),
+    ]
+
+    operations = [
+        migrations.AddField(
+            model_name='config',
+            name='nota',
+            field=models.CharField(max_length=256, null=True),
+        ),
+        migrations.AlterField(
+            model_name='config',
+            name='valore',
+            field=models.CharField(max_length=128, null=True),
+        ),
+    ]

BIN
config/migrations/__pycache__/0001_initial.cpython-311.pyc


BIN
config/migrations/__pycache__/0002_config_config_conf_indice_39d8cc_idx_and_more.cpython-311.pyc


BIN
config/migrations/__pycache__/__init__.cpython-311.pyc


BIN
documento/__pycache__/__init__.cpython-311.pyc


BIN
documento/__pycache__/admin.cpython-311.pyc


BIN
documento/__pycache__/apps.cpython-311.pyc


BIN
documento/__pycache__/forms.cpython-311.pyc


BIN
documento/__pycache__/managefile.cpython-311.pyc


BIN
documento/__pycache__/models.cpython-311.pyc


BIN
documento/__pycache__/tests.cpython-311.pyc


BIN
documento/__pycache__/urls.cpython-311.pyc


BIN
documento/__pycache__/views.cpython-311.pyc


BIN
documento/migrations/__pycache__/0001_initial.cpython-311.pyc


BIN
documento/migrations/__pycache__/0002_remove_documento_utente.cpython-311.pyc


BIN
documento/migrations/__pycache__/0003_documento_utente.cpython-311.pyc


BIN
documento/migrations/__pycache__/0003_remove_documento_dataupload.cpython-311.pyc


BIN
documento/migrations/__pycache__/0004_documento_utente.cpython-311.pyc


BIN
documento/migrations/__pycache__/0004_remove_documento_dataupload.cpython-311.pyc


BIN
documento/migrations/__pycache__/0005_documento_azienda.cpython-311.pyc


BIN
documento/migrations/__pycache__/0005_remove_documento_utente.cpython-311.pyc


BIN
documento/migrations/__pycache__/0006_documento_documento_d_documen_a68d7b_idx_and_more.cpython-311.pyc


BIN
documento/migrations/__pycache__/0007_remove_documento_azienda_documento_dataupload.cpython-311.pyc


BIN
documento/migrations/__pycache__/0008_alter_documento_utente.cpython-311.pyc


BIN
documento/migrations/__pycache__/0009_documento_descrizione_alter_documento_crc.cpython-311.pyc


BIN
documento/migrations/__pycache__/0010_documento_azienda.cpython-311.pyc


BIN
documento/migrations/__pycache__/__init__.cpython-311.pyc


BIN
gd/__pycache__/__init__.cpython-311.pyc


BIN
gd/__pycache__/settings.cpython-311.pyc


BIN
gd/__pycache__/urls.cpython-311.pyc


BIN
gd/__pycache__/wsgi.cpython-311.pyc


+ 1 - 1
gd/settings.py

@@ -26,7 +26,7 @@ SECRET_KEY = 'django-insecure-dx$w#y$e0%s89^%l7v%6*i%fom(ns-5+#0ul$&u@%#^%9jq7w+
 # SECURITY WARNING: don't run with debug turned on in production!
 DEBUG = True
 
-ALLOWED_HOSTS = ['marchioitalia.it','www.marchioitalia.it',]
+ALLOWED_HOSTS = ['marchioitalia.it','www.marchioitalia.it','127.0.0.1','localhost',]
 
 
 # Application definition

BIN
login/__pycache__/__init__.cpython-311.pyc


BIN
login/__pycache__/admin.cpython-311.pyc


BIN
login/__pycache__/apps.cpython-311.pyc


BIN
login/__pycache__/forms.cpython-311.pyc


BIN
login/__pycache__/models.cpython-311.pyc


BIN
login/__pycache__/tests.cpython-311.pyc


BIN
login/__pycache__/urls.cpython-311.pyc


BIN
login/__pycache__/views.cpython-311.pyc


BIN
login/migrations/__pycache__/__init__.cpython-311.pyc


BIN
utente/__pycache__/__init__.cpython-311.pyc


BIN
utente/__pycache__/admin.cpython-311.pyc


BIN
utente/__pycache__/apps.cpython-311.pyc


BIN
utente/__pycache__/forms.cpython-311.pyc


BIN
utente/__pycache__/managefile.cpython-311.pyc


BIN
utente/__pycache__/models.cpython-311.pyc


BIN
utente/__pycache__/urls.cpython-311.pyc


BIN
utente/__pycache__/views.cpython-311.pyc


+ 0 - 34
utente/forms.py~

@@ -1,34 +0,0 @@
-from django import  forms
-
-class MultipleFileInput(forms.ClearableFileInput):
-    allow_multiple_selected = True
-
-class MultipleFileField(forms.FileField):
-    def __init__(self, *args, **kwargs):
-        kwargs.setdefault("widget", MultipleFileInput())
-        super().__init__(*args, **kwargs)
-
-    def clean(self, data, initial=None):
-        single_file_clean = super().clean
-        if isinstance(data, (list, tuple)):
-            result = [single_file_clean(d, initial) for d in data]
-        else:
-            result = [single_file_clean(data, initial)]
-        return result
-
-class AdminUpload(forms.Form):
-  def __init__(self,*args,**kwargs):
-    forms.Form.__init__(self,*args,**kwargs)
-    self.fields['indice'] = forms.FileField(required=False)
-    self.fields['allegati'] = MultipleFileField(required=False)
-
-class formUtente(forms.Form):
-  def __init__(self,*args,**kwargs):
-    forms.Form.__init__(self,*args,**kwargs)
-    self.fields['codicefiscale'] = forms.CharField(required=True)
-    self.fields['nome'] = forms.CharField(required=True)
-    self.fields['datanascita'] = forms.DateField(required=True) #,input_formats=['%d/%m/%Y',])
-    self.fields['luogonascita'] = forms.CharField(required=False)
-    self.fields['password'] = forms.CharField(required=False)
-    self.fields['mail'] = forms.CharField(required=False)
-    self.fields['CancellaUtente'] = forms.BooleanField(required=False)

BIN
utente/migrations/__pycache__/0001_initial.cpython-311.pyc


BIN
utente/migrations/__pycache__/0002_initial.cpython-311.pyc


BIN
utente/migrations/__pycache__/0003_alter_utente_azienda.cpython-311.pyc


BIN
utente/migrations/__pycache__/0004_utente_utente_uten_codicef_6e44c2_idx_and_more.cpython-311.pyc


BIN
utente/migrations/__pycache__/0005_utente_mail.cpython-311.pyc


BIN
utente/migrations/__pycache__/0006_rename_password_utente_pin.cpython-311.pyc


BIN
utente/migrations/__pycache__/0007_alter_utente_inserimento.cpython-311.pyc


BIN
utente/migrations/__pycache__/0008_alter_utente_inserimento.cpython-311.pyc


BIN
utente/migrations/__pycache__/__init__.cpython-311.pyc


+ 8 - 1
utente/templates/utente.download.html

@@ -22,6 +22,7 @@
     <button class="nav-link" id="messages-tab" data-bs-toggle="tab" data-bs-target="#messages" type="button" role="tab" aria-controls="messages" aria-selected="false">Logging</button>
   </li>
 </ul>
+<! -- end nav tabs -->
 
 <!-- Tab panes -->
 <div class="tab-content">
@@ -128,4 +129,10 @@
 
 {% endblock %}
 
-
+{% block bodybottom %}
+  {% if mailnonvalida %}
+    <div class='text-center h5'>
+           <b>Attenzione, la mail non risulta inserita/corretta. Si prega di correggerla cliccando sul tasto "Profilo".</b>
+    </div>
+  {% endif %}
+{% endblock %}

+ 109 - 0
utente/templates/utente.edit.document.html

@@ -0,0 +1,109 @@
+<div class="tab-pane fade" id="document-pane" role="tabpanel" aria-labelledby="document-tab" tabindex="0">
+   <!-- documenti -->  
+
+   <div class='form-outline mb-3 text-center btn-primary h3'>
+           Elenco Documenti Associati
+   </div>
+   
+   <table class='table table-striped table-hover'>
+    <thead class='thead-dark'>
+      <tr>
+        <th scope='col'>Documento</th>
+        <th scope='col'>Storage</th>
+        <th scope='col'>Descrizione</th>
+        <th scope='col'>Inserimento</th>
+        <th scope='col'>Elimina</th>
+
+      </tr>
+    </thead>
+    <tbody>
+      {% for documento in documentiUtente %}
+        <tr>
+          <td> {{ documento.documento }} </td>
+          <td> {{ documento.storage}} </td>
+          <td> {{ documento.descrizione }} </td>
+          <td> {{ documento.dataupload | date:'d/m/Y' }} </td>
+          <!-- <td> <input class='btn btn-primary' type='submit' name='Elimina' value='{{ documento.id }}'></td> -->
+          <td> <button type='button' class='btn btn-primary active' onclick="window.open('{% url "documento:finalize" documento.id uid %}')">Vedi</button>
+               <button type='button' class='btn btn-primary' data-bs-toggle='modal' data-bs-target='#ConfirmDeleteModal{{ documento.id }}' value='{{ documento.id }}'>Elimina!</button></td>
+          <td>
+
+        <!-- Modal -->
+        <div class="modal fade" id="ConfirmDeleteModal{{ documento.id }}" tabindex="-1" role="dialog" aria-labelledby="ConfirmDeleteLabel{{ document.id }}" aria-hidden="true">
+          <div class="modal-dialog" role="document">
+            <div class="modal-content">
+              <div class="modal-header">
+               <h5 class="modal-title" id="ConfirmDeleteLabel">Conferma Cancellazione</h5>
+               <button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
+                 <span aria-hidden="true">&times;</span>
+               </button>
+             </div>
+             <div class="modal-body">
+             Confermi la cancellazione di {{ documento.documento }}?<br>
+             La cancellazione del documento è definitiva,immediata e non recuperabile.
+            </div>
+            <div class="modal-footer">
+              <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
+              <form name='ConfirmDeleteModal' method='POST'>
+                {% csrf_token %}
+                <button type="submit" name="DeleteDocument" value='{{ documento.id }}' class="btn btn-primary">Conferma</button>
+              </form>
+            </div>
+          </div>
+        </div>
+      <!-- end modal -->
+        </td>
+        </tr>
+      {% endfor %}
+     </tbody>
+   </table>
+
+   <form name='fileManager' method="POST"  enctype='multipart/form-data'>
+     {% csrf_token %}
+     <div class='form-group'>
+     <input type='file' class="btn btn-primary form-control" name='allegati' id='allegati' value='{{ uf.allegati }}' accept='application/pdf' multiple>
+     </div>
+     <div class='form-group'>
+     <label  class='form-control-label' for='descrizione'>Descrizione:&nbsp;</label><input type='text' name='descrizione' id='descrizione' value=''>
+     </div>
+     <input class="btn btn-primary" type='submit' value='Inserisci'>
+   </form>
+
+   {% if listaok %}
+     <table class='table table-striped table-hover'>
+       <thead class='thead-dark'>
+       <tr>
+         <th scope='col'>Documento caricato con successo</th>
+       </tr>
+       </thead>
+       <tbody>
+         {% for l in listaok %}
+         <tr>
+           <td> {{ l }} </td>
+         </tr>
+         {% endfor %}
+       </tbody>
+    </table>
+  {% endif %}
+
+  <div><br><br></div>
+
+  {% if listanotok %}
+    <table class='table table-striped table-hover'>
+      <thead class='thead-dark'>
+      <tr>
+        <th scope='col'>Documento non caricato perche già presente</th>
+      </tr>
+      </thead>
+      <tbody>
+        {% for l in listanotok %}
+        <tr>
+          <td> {{ l }} </td>
+        </tr>
+        {% endfor %}
+      </tbody>
+    </table>
+  {% endif %}
+  
+ </div>
+

+ 23 - 182
utente/templates/utente.edit.html

@@ -14,192 +14,33 @@
 
 {% block body %}
 
-  {% if utente.errors %}
-    {{ utente.errors }}
-    {% for field in utente %}
-        {% for error in field.errors %}
-            <div class="alert alert-danger">
-                <strong>{{ error|escape }}</strong>
-            </div>
-        {% endfor %}
-    {% endfor %}
-    {% for error in utente.non_field_errors %}
-        <div class="alert alert-danger">
-            <strong>{{ error|escape }}</strong>
-        </div>
-    {% endfor %}
-  {% else %}
-    Nessun Errore rilevato
-  {% endif %}
-
-  <form name='UserEdit' method='post'>
-    {% csrf_token %}
-    <div class='form-group'>
-      <label for="codicefiscale">Codice Fiscale</label>
-      <input type='text' class='form-control' name='codicefiscale' id='codicefiscale' value='{{ utente.codicefiscale.value }}'>
-
-      <label for="nome">Nome Cognome</label>
-      <input type='text' class='form-control form-control-lg' name='nome' id='nome' value='{{ utente.nome.value }}'>
-
-      <label for="luogonascita">Luogo di nascita</label>
-      <input type='text' class='form-control' name='luogonascita' id='luogonascita' value='{{ utente.luogonascita.value }}'>
-
-      <label for="datanascita">Data di nascita</label>
-      <input type='date' class='form-control' name='datanascita' id='datanascita' value='{{ utente.datanascita.value|date:'Y-m-d' }}'>
-
-      <label for="mail" class="form-control-label">Email</label>
-      <input type='mail' class='form-control' name='mail' id='mail' value='{{ utente.mail.value }}'
-
-      <label for="pin" class="form-control-label">Pin</label>
-      <input type='text' class='form-control' name='pin' id='pin' value='{{ utente.pin.value }}'
-    </div>
-
-    <div class="form-check">
-     <input type="checkbox" class="form-check-input" name='CancellaUtente' id='CancellaUtente'>
-     <Label class="form-check-label" for='CancellaUtente'>Cancella Questo record!</label>
-   </div>
+<!-- Nav tabs -->
+<ul class="nav nav-tabs" id="myTab" role="tablist">
+  <li class="nav-item" role="presentation">
+    <button class="nav-link active" id="profile-tab" data-bs-toggle="tab" data-bs-target="#profile-pane" type="button" role="tab" aria-controls="profile-pane" aria-selected="true">Profilo</button>
+  </li>
+  <li class="nav-item" role="presentation">
+    <button class="nav-link" id="document-tab" data-bs-toggle="tab" data-bs-target="#document-pane" type="button" role="tab" aria-controls="document-pane" aria-selected="false">Documenti</button>
+  </li>
+  <li class="nav-item" role="presentation">
+    <button class="nav-link" id="logger-tab" data-bs-toggle="tab" data-bs-target="#logger-pane" type="button" role="tab" aria-controls="logger-pane" aria-selected="false">attivita</button>
+  </li>
+</ul>
+<!-- end nav tabs -->
+
+<!-- Tab panes -->
+<div class="tab-content" id='mycontent'>
+  {% include 'utente.edit.profile.html' %}
+  {% include 'utente.edit.document.html' %}
+  {% include 'utente.edit.logger.html' %}
+</div>
 
-    <div>
-      <input type='submit' class="btn btn-secondary" value='Aggiorna'>
-      <input type='submit' class="btn btn-primary" name="ritorna" value="Ritorna">
-    </td>
-  </form>
 {% endblock %}
 
 {% block bodybottom %}
-    <div><br><br></div>
-    <div class='form-outline mb-3 text-center btn-primary h3'>
-           Elenco Documenti Associati
+  {% if mailnonvalida %}
+    <div class='text-center h5'>
+           <b>Attenzione, la mail non risulta inserita/corretta.</b>
     </div>
-    <div>
-   <table class='table table-striped table-hover'>
-      <thead class='thead-dark'>
-      <tr>
-        <th scope='col'>Documento</th>
-        <th scope='col'>Storage</th>
-        <th scope='col'>Descrizione</th>
-        <th scope='col'>Inserimento</th>
-        <th scope='col'>Elimina</th>
-
-      </tr>
-      </thead>
-      <tbody>
-        {% for documento in documentiUtente %}
-        <tr>
-          <td> {{ documento.documento }} </td>
-          <td> {{ documento.storage}} </td>
-          <td> {{ documento.descrizione }} </td>
-          <td> {{ documento.dataupload | date:'d/m/Y' }} </td>
-          <!-- <td> <input class='btn btn-primary' type='submit' name='Elimina' value='{{ documento.id }}'></td> -->
-          <td> <button type='button' class='btn btn-primary active' onclick="window.open('{% url "documento:finalize" documento.id uid %}')">Vedi</button>
-               <button type='button' class='btn btn-primary' data-bs-toggle='modal' data-bs-target='#ConfirmDeleteModal{{ documento.id }}' value='{{ documento.id }}'>Elimina!</button></td>
-        </tr>
-
-        <!-- Modal -->
-       <div class="modal fade" id="ConfirmDeleteModal{{ documento.id }}" tabindex="-1" role="dialog" aria-labelledby="ConfirmDeleteLabel{{ document.id }}" aria-hidden="true">
-         <div class="modal-dialog" role="document">
-           <div class="modal-content">
-             <div class="modal-header">
-              <h5 class="modal-title" id="ConfirmDeleteLabel">Conferma Cancellazione</h5>
-              <button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
-                <span aria-hidden="true">&times;</span>
-              </button>
-            </div>
-            <div class="modal-body">
-            Confermi la cancellazione di {{ documento.documento }}?<br>
-            La cancellazione del documento è definitiva,immediata e non recuperabile.
-           </div>
-           <div class="modal-footer">
-             <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
-             <form name='ConfirmDeleteModal' method='POST'>
-               {% csrf_token %}
-               <button type="submit" name="DeleteDocument" value='{{ documento.id }}' class="btn btn-primary">Conferma</button>
-             </form>
-           </div>
-         </div>
-       </div>
-     </div>
-     <!-- end modal -->
-
-     {% endfor %}
-   </tbody>
-  </table>
-
-    <form name='fileManager' method="POST"  enctype='multipart/form-data'>
-      {% csrf_token %}
-      <td><label for='descrizione'>Descrizione:&nbsp;</label><input type='text' name='descrizione' id='descrizione' value=''>
-      <td><input type='file' class="btn btn-primary" name='allegati' id='allegati' value='{{ uf.allegati }}' accept='application/pdf' multiple></td>
-      <td><input class="btn btn-primary" type='submit' value='Inserisci'><td>
-    </form>
-    </div>
-
-  <div><br><br></div>
-
-
-  {% if listaok %}
-    <table class='table table-striped table-hover'>
-      <thead class='thead-dark'>
-      <tr>
-        <th scope='col'>Documento caricato con successo</th>
-      </tr>
-      </thead>
-      <tbody>
-        {% for l in listaok %}
-        <tr>
-          <td> {{ l }} </td>
-        </tr>
-        {% endfor %}
-      </tbody>
-    </table>
   {% endif %}
-
-  <div><br><br></div>
-  {% if listanotok %}
-    <table class='table table-striped table-hover'>
-      <thead class='thead-dark'>
-      <tr>
-        <th scope='col'>Documento non caricato perche già presente</th>
-      </tr>
-      </thead>
-      <tbody>
-        {% for l in listanotok %}
-        <tr>
-          <td> {{ l }} </td>
-        </tr>
-        {% endfor %}
-      </tbody>
-    </table>
-  {% endif %}
-
-
-    <div><br><br></div>
-
-    <div class='form-outline mb-3 text-center btn-primary h3'>
-           Elenco Azioni Registrate
-    </div>
-    <div>
-    <table class='table table-striped table-hover'>
-      <thead class='thead-dark'>
-      <tr>
-        <th scope='col'>Data</th>
-        <th scope='col'>Causale</th>
-        <th scope='col'>Utente</th>
-        <th scope='col'>Amministratore</th>
-        <th scope='col'>documento</th>
-
-      </tr>
-      </thead>
-      <tbody>
-        {% for attivita in listaAttivita %}
-        <tr>
-          <td> {{ attivita.data | date:'d/m/Y H:i' }} </td>
-          <td> {{ attivita.causale.nome }} </td>
-          <td> {{ attivita.utente.nome }} </td>
-          <td> {{ attivita.amministratore.name }}</td>
-          <td> {{ attivita.documento.documento }}</td>
-        </tr>
-        {% endfor %}
-      </tbody>
-    </table>
-    </div>
 {% endblock %}

+ 31 - 0
utente/templates/utente.edit.logger.html

@@ -0,0 +1,31 @@
+ <div class="tab-pane fade" id="logger-pane" role="tabpanel" aria-labelledby="logger-tab" tabindex="0">
+
+   <div class='form-outline mb-3 text-center btn-primary h3'>
+          Elenco Azioni Registrate
+   </div>
+
+   <div>
+   <table class='table table-striped table-hover'>
+     <thead class='thead-dark'>
+       <tr>
+         <th scope='col'>Data</th>
+          <th scope='col'>Causale</th>
+          <th scope='col'>Utente</th>
+          <th scope='col'>Amministratore</th>
+          <th scope='col'>documento</th>
+        </tr>
+      </thead>
+      <tbody>
+       {% for attivita in listaAttivita %}
+       <tr>
+         <td> {{ attivita.data | date:'d/m/Y H:i' }} </td>
+         <td> {{ attivita.causale.nome }} </td>
+         <td> {{ attivita.utente.nome }} </td>
+         <td> {{ attivita.amministratore.name }}</td>
+         <td> {{ attivita.documento.documento }}</td>
+       </tr>
+       {% endfor %}
+     </tbody>
+   </table>
+   </div>
+</div>

+ 63 - 0
utente/templates/utente.edit.profile.html

@@ -0,0 +1,63 @@
+<div class="tab-pane fade show active" id="profile-pane" role="tabpanel" aria-labelledby="profile-tab" tabindex="0">
+
+  <!-- errori utente -->
+  {% if utente.errors %}
+    {{ utente.errors }}
+    {% for field in utente %}
+      {% for error in field.errors %}
+        <div class="alert alert-danger">
+          <strong>{{ error|escape }}</strong>
+        </div>
+      {% endfor %}
+    {% endfor %}
+    {% for error in utente.non_field_errors %}
+      <div class="alert alert-danger">
+          <strong>{{ error|escape }}</strong>
+      </div>
+    {% endfor %}
+  {% else %}
+    Nessun Errore rilevato
+  {% endif %}
+  <!-- fine zona errori -->
+
+  <!-- profilo utente -->
+  <form name='UserEdit' method='post'>
+    {% csrf_token %}
+
+    <div class='form-group'>
+      <label for="codicefiscale">Codice Fiscale</label>
+      <input type='text' class='form-control' name='codicefiscale' id='codicefiscale' value='{{ utente.codicefiscale.value }}'>
+    </div>
+    <div class='form-group'>
+      <label for="nome">Nome Cognome</label>
+      <input type='text' class='form-control form-control-lg' name='nome' id='nome' value='{{ utente.nome.value }}'>
+    </div>
+    <div class='form-group'>
+      <label for="luogonascita">Luogo di nascita</label>
+      <input type='text' class='form-control' name='luogonascita' id='luogonascita' value='{{ utente.luogonascita.value }}'>
+    </div>
+    <div class='form-group'>
+      <label for="datanascita">Data di nascita</label>
+      <input type='date' class='form-control' name='datanascita' id='datanascita' value='{{ utente.datanascita.value|date:'Y-m-d' }}'>
+    </div>
+    <div class='form-group'>
+      <label for="mail" class="form-control-label">Email</label>
+      <input type='mail' class='form-control' name='mail' id='mail' value='{{ utente.mail.value }}'>
+    </div>
+
+    <div class='form-group'>
+      <label for="pin" class='form-control-label'>Pin</label>
+      <input type='text' class='form-control' name='pin' id='pin' value='{{ utente.pin.value }}'>
+    </div>
+
+    <div class='form-check'>
+      <input type="checkbox" class="form-check-input" name='CancellaUtente' id='CancellaUtente'>
+      <Label class="form-check-label" for='CancellaUtente'>Cancella Questo record!</label>
+    </div>
+
+    <input type='submit' class="btn btn-secondary" value='Aggiorna'>
+    <input type='submit' class="btn btn-primary" name="ritorna" value="Ritorna">
+  </form>
+
+</div>
+

+ 0 - 55
utente/templates/utente.welcome.html.old

@@ -1,55 +0,0 @@
-{% extends 'base.html' %}
-
-{% block top %}
-  <table class='table table-striped table-hover'>
-    <thead class='thead-dark'>
-      <tr>
-        <th scope='col'>Nome</th>
-        <th scope='col'>Codice Fiscale</th>
-        <th scope='col'>Data di Nascita</th>
-	<th scope='col'>Luogo di Nascita</th>
-	<th scope='col'>documento</th>
-	<th scope='col'>Data Documento</th>
-	<th scope='col'>Azienda</th>
-	<th scope='col'>Password</th>
-      </tr>
-    </thead>
-    <tbody>
-      {% csrf_token %}
-      {% for uu in u %}
-        <tr>
-	  <td><a href='{% url 'welcome:edit' uu.id %}'>{{ uu.nome }}</a> </td>
-	  <td> {{ uu.codicefiscale }} </td>
-	  <td> {{ uu.datanascita|date:'d/m/Y' }} </td>
-	  <td> {{ uu.luogonascita }} </td>
-	  <td> {{ uu.documento }} </td>
-	  <td> {% if uu.dataupload %} {{ uu.dataupload }} {% endif %}</td>
-	  <td> {{ uu.azienda }} </td>
-	  <td> {{ uu.password }} </td>
-	</tr>
-      {% endfor %} 
-    </tbody>
-  </table>
-  <div class='form-control'>
-    <a href='{% url 'welcome:edit' 0 %}'>Nuovo Record</a>
-  </div>
-{% endblock %}
-
-{% block body %}
-  <div>
-	  &nbsp;
-  </div>
-  <br>
-  <form name='upload' method='post' enctype='multipart/form-data'>
-    {% csrf_token %}
-    <table class='table table-striped table-hover'>
-      <tbody>
-        <tr>
-	  <td><input type='file' name='indice' id='indice' value='{{ uf.indice }}' accept='text/csv'></td>
-	  <td><input type='file' name='allegati' id='allegati' value='{{ uf.allegati }}' accept='application/pdf' multiple></td>
-	  <td><input type='submit' value='Inserisci'></td>
-        </tr>
-      </tbody>
-    </table>
-  </form>
-{% endblock %}

+ 15 - 0
utente/views.py

@@ -11,6 +11,7 @@ from documento.managefile import *
 from att.views import *
 
 from config.views import *
+import re
 
 def welcome(request):
 
@@ -180,6 +181,12 @@ def edit(request):
     print("tmp su request non valida",tmp)
     data['utente'] = formUtente(tmp)
 
+  # verifica bonta' mail.
+  regex = r'\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,7}\b'
+  if(not re.fullmatch(regex, utente.mail)):
+    print("Mail non valida")
+    data['mailnonvalida']=True
+
   return render(request,'utente.edit.html',data)
 
 def download(request):
@@ -230,4 +237,12 @@ def download(request):
       utente.save()
       print('utente aggiornato',utente.id)
 
+  # verifica bonta' mail.
+  regex = r'\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,7}\b'
+  if(not re.fullmatch(regex, utente.mail)):
+    print("Mail non valida")
+    data['mailnonvalida']=True
+  else:
+    print("Mail valida")
+ 
   return render(request,'utente.download.html',data)

+ 0 - 121
utente/views.py~

@@ -1,121 +0,0 @@
-from django.shortcuts import render
-from django.http import HttpResponse,HttpResponseRedirect,FileResponse
-from django.contrib.auth.models import User
-from django.urls import reverse
-
-from .models import *
-from .forms import *
-
-from config.views import *
-
-def welcome(request):
-
-  data = dict()
-  data['HeaderTitle'] = getConfig('HeaderTitle')
-
-  if not 'AziendaId' in request.session:
-    return HttpResponseRedirect(reverse("login:start"))
-  else:
-    data['AziendaId'] = request.session['AziendaId']
-
-  if not 'AdminId' in request.session or 'UserId' in request.session:
-    print("Non rilevo presensa UserId e AdminId in request.session")
-    return HttpResponseRedirect(reverse("login:start"))
-
-  if 'AdminId' in request.session:
-    data['AdminId'] = request.session['AdminId']
-    
-  if 'UserId' in request.session:
-    data['UserId'] = request.session['UserId']
-
-  #filtro:
-  # selezionare tutti gli utenti per AziendaId
-  data['admin'] = User.objects.get(pk=data['AdminId'])
-
-  data['azienda'] = Azienda.objects.get(pk=data['AziendaId'])
-  data['utenti'] = data['azienda'].utente_set.all()
-
-  if request.method == 'POST':
-    print('qualcuno ha premuto un id')
-    if 'scelta' in request.POST:
-      scelta = request.POST['scelta']
-      request.session['UserEditId'] = scelta
-      print('scelta effettuata',scelta)
-      return HttpResponseRedirect(reverse("utente:edit"))
-
-  return render(request,'utente.welcome.html',data)
-
-def edit(request):
-
-  data=dict()
-
-  if not 'AdminId' in request.session:
-    return HttpResponseRedirect(reverse("login:start"))
-  data['AdminId']=request.session['AdminId']
-
-  if not 'AziendaId' in request.session:
-    return HttpResponseRedirect(reverse("login:start"))
-  data['AziendaId']=request.session['AziendaId']
-
-  if not 'AdminId' in request.session or 'UserId' in request.session:
-    print("Non rilevo presensa UserId e AdminId in request.session")
-    return HttpResponseRedirect(reverse("login:start"))
-
-  if 'AdminId' in request.session:
-    data['AdminId'] = request.session['AdminId']
-    
-  if 'UserId' in request.session:
-    data['UserId'] = request.session['UserId']
-
-  if not'UserEditId' in request.session:
-    return HttpResponseRedirect(reverse("login:start"))
-  data['UserEditId'] = request.session['UserEditId']
-
-  #filtro:
-  # selezionare tutti gli utenti per AziendaId
-  data['admin'] = User.objects.get(pk=data['AdminId'])
-
-  data['azienda'] = Azienda.objects.get(pk=data['AziendaId'])
- 
-  utente = None
-  if data['UserEditId'] == 0:
-    utente = Utente()
-    utente.azienda = data['azienda']
-  else:
-    try:
-      utente = Utente.objects.get(pk=data['UserEditId'])
-    except Utente.DoesNotExist as dne:
-      print('strana richiesta, utente inesistente')
-      flagDne=True
-      utente=None
-      print("Non ci siamo, manca l'utente")
-
-  if request.method == 'POST':
-    print('request.method x edit utente')
-    fu = formUtente(request.POST)
-    if fu.is_valid():
-      print('form valida')
-      print('i dati sono grosso modo coerenti, salviamoli')
-      utente.nome = fu.cleaned_data['nome']
-      utente.codicefiscale = fu.cleaned_data['codicefiscale']
-      utente.luogonascita = fu.cleaned_data['luogonascita']
-      utente.datanascita = fu.cleaned_data['datanascita']
-      utente.mail = fu.cleaned_data['mail']
-      utente.save()
-      data['utente'] = formUtente(request.POST)
-    else:
-      print('Form non valida')
-      data['utente'] = formUtente(request.POST)
-
-  else:
-    print('Request non valida')
-    tmp = dict()
-    tmp['nome'] = utente.nome
-    tmp['codicefiscale'] = utente.codicefiscale
-    tmp['datanascita'] = utente.datanascita
-    tmp['luogonascita'] = utente.luogonascita
-    tmp['mail'] = utente.mail
-    data['utente'] = formUtente(tmp)
-
-  return render(request,'utente.edit.html',data)
-