utente.edit.html 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. {% extends 'base.html' %}
  2. {% block top %}
  3. <div class='form-outline mb-3 text-center btn-primary h3'>
  4. {{ HeaderTitle }}
  5. </div>
  6. <div class='form-outline mb-3 text-center btn-primary h3'>
  7. Azienda in elaborazione: {{ azienda.nome }}
  8. </div>
  9. <div class='form-outline mb-3 text-center btn-primary h3'>
  10. Amministratore: {{ admin.username }}
  11. </div>
  12. {% endblock %}
  13. {% block body %}
  14. {% if utente.errors %}
  15. {{ utente.errors }}
  16. {% for field in utente %}
  17. {% for error in field.errors %}
  18. <div class="alert alert-danger">
  19. <strong>{{ error|escape }}</strong>
  20. </div>
  21. {% endfor %}
  22. {% endfor %}
  23. {% for error in utente.non_field_errors %}
  24. <div class="alert alert-danger">
  25. <strong>{{ error|escape }}</strong>
  26. </div>
  27. {% endfor %}
  28. {% else %}
  29. Nessun Errore rilevato
  30. {% endif %}
  31. <form name='UserEdit' method='post'>
  32. {% csrf_token %}
  33. <div class='form-group'>
  34. <label for="codicefiscale">Codice Fiscale</label>
  35. <input type='text' class='form-control' name='codicefiscale' id='codicefiscale' value='{{ utente.codicefiscale.value }}'>
  36. <label for="nome">Nome Cognome</label>
  37. <input type='text' class='form-control form-control-lg' name='nome' id='nome' value='{{ utente.nome.value }}'>
  38. <label for="luogonascita">Luogo di nascita</label>
  39. <input type='text' class='form-control' name='luogonascita' id='luogonascita' value='{{ utente.luogonascita.value }}'>
  40. <label for="datanascita">Data di nascita</label>
  41. <input type='date' class='form-control' name='datanascita' id='datanascita' value='{{ utente.datanascita.value|date:'Y-m-d' }}'>
  42. <label for="mail" class="form-control-label">Email</label>
  43. <input type='mail' class='form-control' name='mail' id='mail' value='{{ utente.mail.value }}'
  44. <label for="pin" class="form-control-label">Pin</label>
  45. <input type='text' class='form-control' name='pin' id='pin' value='{{ utente.pin.value }}'
  46. </div>
  47. <div class="form-check">
  48. <input type="checkbox" class="form-check-input" name='CancellaUtente' id='CancellaUtente'>
  49. <Label class="form-check-label" for='CancellaUtente'>Cancella Questo record!</label>
  50. </div>
  51. <div>
  52. <input type='submit' class="btn btn-secondary" value='Aggiorna'>
  53. <input type='submit' class="btn btn-primary" name="ritorna" value="Ritorna">
  54. </td>
  55. </form>
  56. {% endblock %}
  57. {% block bodybottom %}
  58. <div><br><br></div>
  59. <div class='form-outline mb-3 text-center btn-primary h3'>
  60. Elenco Documenti Associati
  61. </div>
  62. <div>
  63. <table class='table table-striped table-hover'>
  64. <thead class='thead-dark'>
  65. <tr>
  66. <th scope='col'>Documento</th>
  67. <th scope='col'>Storage</th>
  68. <th scope='col'>Descrizione</th>
  69. <th scope='col'>Inserimento</th>
  70. <th scope='col'>Elimina</th>
  71. </tr>
  72. </thead>
  73. <tbody>
  74. {% for documento in documentiUtente %}
  75. <tr>
  76. <td> {{ documento.documento }} </td>
  77. <td> {{ documento.storage}} </td>
  78. <td> {{ documento.descrizione }} </td>
  79. <td> {{ documento.dataupload | date:'d/m/Y' }} </td>
  80. <!-- <td> <input class='btn btn-primary' type='submit' name='Elimina' value='{{ documento.id }}'></td> -->
  81. <td> <button type='button' class='btn btn-primary active' onclick="window.open('{% url "documento:finalize" documento.id uid %}')">Vedi</button>
  82. <button type='button' class='btn btn-primary' data-bs-toggle='modal' data-bs-target='#ConfirmDeleteModal{{ documento.id }}' value='{{ documento.id }}'>Elimina!</button></td>
  83. </tr>
  84. <!-- Modal -->
  85. <div class="modal fade" id="ConfirmDeleteModal{{ documento.id }}" tabindex="-1" role="dialog" aria-labelledby="ConfirmDeleteLabel{{ document.id }}" aria-hidden="true">
  86. <div class="modal-dialog" role="document">
  87. <div class="modal-content">
  88. <div class="modal-header">
  89. <h5 class="modal-title" id="ConfirmDeleteLabel">Conferma Cancellazione</h5>
  90. <button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
  91. <span aria-hidden="true">&times;</span>
  92. </button>
  93. </div>
  94. <div class="modal-body">
  95. Confermi la cancellazione di {{ documento.documento }}?<br>
  96. La cancellazione del documento è definitiva,immediata e non recuperabile.
  97. </div>
  98. <div class="modal-footer">
  99. <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
  100. <form name='ConfirmDeleteModal' method='POST'>
  101. {% csrf_token %}
  102. <button type="submit" name="DeleteDocument" value='{{ documento.id }}' class="btn btn-primary">Conferma</button>
  103. </form>
  104. </div>
  105. </div>
  106. </div>
  107. </div>
  108. <!-- end modal -->
  109. {% endfor %}
  110. </tbody>
  111. </table>
  112. <form name='fileManager' method="POST" enctype='multipart/form-data'>
  113. {% csrf_token %}
  114. <td><label for='descrizione'>Descrizione:&nbsp;</label><input type='text' name='descrizione' id='descrizione' value=''>
  115. <td><input type='file' class="btn btn-primary" name='allegati' id='allegati' value='{{ uf.allegati }}' accept='application/pdf' multiple></td>
  116. <td><input class="btn btn-primary" type='submit' value='Inserisci'><td>
  117. </form>
  118. </div>
  119. <div><br><br></div>
  120. {% if listaok %}
  121. <table class='table table-striped table-hover'>
  122. <thead class='thead-dark'>
  123. <tr>
  124. <th scope='col'>Documento caricato con successo</th>
  125. </tr>
  126. </thead>
  127. <tbody>
  128. {% for l in listaok %}
  129. <tr>
  130. <td> {{ l }} </td>
  131. </tr>
  132. {% endfor %}
  133. </tbody>
  134. </table>
  135. {% endif %}
  136. <div><br><br></div>
  137. {% if listanotok %}
  138. <table class='table table-striped table-hover'>
  139. <thead class='thead-dark'>
  140. <tr>
  141. <th scope='col'>Documento non caricato perche già presente</th>
  142. </tr>
  143. </thead>
  144. <tbody>
  145. {% for l in listanotok %}
  146. <tr>
  147. <td> {{ l }} </td>
  148. </tr>
  149. {% endfor %}
  150. </tbody>
  151. </table>
  152. {% endif %}
  153. <div><br><br></div>
  154. <div class='form-outline mb-3 text-center btn-primary h3'>
  155. Elenco Azioni Registrate
  156. </div>
  157. <div>
  158. <table class='table table-striped table-hover'>
  159. <thead class='thead-dark'>
  160. <tr>
  161. <th scope='col'>Data</th>
  162. <th scope='col'>Causale</th>
  163. <th scope='col'>Utente</th>
  164. <th scope='col'>Amministratore</th>
  165. <th scope='col'>documento</th>
  166. </tr>
  167. </thead>
  168. <tbody>
  169. {% for attivita in listaAttivita %}
  170. <tr>
  171. <td> {{ attivita.data | date:'d/m/Y H:i' }} </td>
  172. <td> {{ attivita.causale.nome }} </td>
  173. <td> {{ attivita.utente.nome }} </td>
  174. <td> {{ attivita.amministratore.name }}</td>
  175. <td> {{ attivita.documento.documento }}</td>
  176. </tr>
  177. {% endfor %}
  178. </tbody>
  179. </table>
  180. </div>
  181. {% endblock %}