utente.edit.html 8.4 KB

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