utente.welcome.html 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. {% extends 'base.html' %}
  2. {% block headersupplement %}
  3. <script language="JavaScript">
  4. function toggle(source) {
  5. checkboxes = document.getElementsByName('select');
  6. for(var i=0, n=checkboxes.length;i<n;i++) {
  7. checkboxes[i].checked = source.checked;
  8. }
  9. }
  10. </script>
  11. {% endblock %}
  12. {% block body %}
  13. <form name="inputDocumenti" method="POST">
  14. {% csrf_token %}
  15. <div class='form-control'>
  16. {% if "UTENTE.CREA" in permesso %}
  17. <button type='submit' class="btn btn-primary" name='scelta' value='Nuovo Dipendente'>Nuovo Dipendente</button>
  18. <button type='button' class="btn btn-primary" name='TastoCaricaIndici' data-bs-toggle='modal' data-bs-target='#CaricaIndiceModal'>Carica Lista Nuovi Dipendenti</button>
  19. <button type='submit' class="btn btn-primary" name='ScaricaSelezionati' value="Scarica Selezionati"/>Scarica Selezionati</button>
  20. {% endif %}
  21. <button type='submit' class="btn btn-primary" name="indietro" value="Indietro">Indietro</button>
  22. </div>
  23. <div class='form-control'>
  24. Numero di dipendenti selezionati {{ numeroRecordAttuali }} su un totale di {{ numeroRecordAzienda }}.
  25. </div>
  26. <table class='table table-striped table-hover'>
  27. <thead class='thead-dark'>
  28. <tr>
  29. {% if "UTENTE.CREA" in permesso %}<th scope='col'>*</th>{% endif %}
  30. <th scope='col' style='white-space: nowrap; width: 1%;'>Dipendente&nbsp;
  31. <button name='utDW' type="submit" class="btn btn-outline-primary btn-sm">&#x2193;</button>
  32. <button name='utUP' type="submit" class="btn btn-outline-primary btn-sm">&#x2191;</button></th>
  33. <th scope='col' style='white-space: nowrap; width: 1%;'>Codice Fiscale</th>
  34. <th scope='col' style='white-space: nowrap; width: 1%;'>Sede&nbsp;
  35. <button name='seDW' type="submit" class="btn btn-outline-primary btn-sm">&#x2193;</button>
  36. <button name="seUP" type="submit" class="btn btn-outline-primary btn-sm">&#x2191;</button></th>
  37. <th scope='col'>Data di Nascita</th>
  38. <th scope='col'>Luogo di Nascita</th>
  39. {% if "DOCUMENTO" in permesso %}
  40. <th scope='col'>documenti</th>
  41. {% endif %}
  42. {% if "UTENTE.EDIT" in permesso %}
  43. <th scope='col'>Mail</th>
  44. <th scope='col'>Pin</th>
  45. {% endif %}
  46. <th scope='col'>Inserimento</th>
  47. {% if "DOCUMENTO" in permesso %}
  48. <th scope='col'><input class="form-check-input" type="checkbox" id="selectAll" name="selectAll" value='0' onClick="toggle(this);"/></th>
  49. {% endif %}
  50. </tr>
  51. </thead>
  52. <tbody>
  53. {% for uu in utenti %}
  54. <tr>
  55. {% if "UTENTE.EDIT" in permesso %}
  56. <td> <button type='submit' class='btn btn-primary ' name='scelta' value='{{ uu.id }}'>Edit</button></td>
  57. {% endif %}
  58. <td> {{ uu.nome }} </td>
  59. <td> {{ uu.codicefiscale }} </td>
  60. <td> {{ uu.sede.nome }} </td>
  61. <td> {{ uu.datanascita|date:'d/m/Y' }} </td>
  62. <td> {{ uu.luogonascita }} </td>
  63. {% if "DOCUMENTO" in permesso %}
  64. <td> <a href='{% url 'documento:welcome' uu.id %}'>{{ uu.documenti }}</a></td>
  65. {% endif %}
  66. {% if "UTENTE.EDIT" in permesso %}
  67. <td> {{ uu.mail }} </td>
  68. <td> {{ uu.pin }} </td>
  69. {% endif %}
  70. <td> {{ uu.inserimento|date:'d/m/Y' }} </td>
  71. {% if "DOCUMENTO" in permesso %}
  72. <td>
  73. <input class="form-check-input" type="checkbox" id="select-{{ uu.id}}" name="select" value='{{ uu.id }}'/>
  74. </td>
  75. {% endif %}
  76. </tr>
  77. {% endfor %}
  78. </tbody>
  79. </table>
  80. </form>
  81. {% if "UTENTE.CREA" in permesso %}
  82. <!-- Modal -->
  83. <div class="modal fade" id="CaricaIndiceModal" tabindex="-1" role="dialog" aria-labelledby="CaricaIndiceLabel" aria-hidden="true">
  84. <div class="modal-dialog" role="document">
  85. <div class="modal-content">
  86. <form name='formCaricaIndice' method='POST' enctype='multipart/form-data'>
  87. {% csrf_token %}
  88. <div class="modal-header">
  89. <h5 class="modal-title" id="CaricaIndiceLabel">Carica Elenco Dipendenti</h5>
  90. <span aria-hidden="true">&times;</span>
  91. </button>
  92. </div>
  93. <div class="modal-body">
  94. Caricamento Lista Dipendenti<br>
  95. Formato File CSV - obbligatorio <br>
  96. Separatore: ';' - prima riga: "Nome colonna".</br>
  97. <table class='table table-striped table-hover'>
  98. <tbody>
  99. <tr>
  100. <td>Nome Cognome</td>
  101. <td>Codice Fiscale</td>
  102. <td>Data di Nascita</td>
  103. <td>Luogo di Nascita</td>
  104. <td>email</td>
  105. <td>Sede</td>
  106. </tr>
  107. </tbody>
  108. </table><br>
  109. <label for='indice'>Elenco Dipendenti:&nbsp;</label>
  110. <input type='file' name='indice' id='indice' value='' accept='text/csv'>
  111. </div>
  112. <div class="modal-footer">
  113. <button type="submit" name="CaricaIndice" value='Carica Lista' class="btn btn-primary">Carica Lista Dipendenti</button>
  114. <button type="button" class="btn btn-primary" data-bs-dismiss="modal">Annulla</button>
  115. </div>
  116. </form>
  117. </div>
  118. </div>
  119. </div>
  120. </div>
  121. <!-- end modal -->
  122. {% endif %}
  123. {% endblock %}
  124. {% block bodybottom %}
  125. <div><br><br></div>
  126. {% if listaok %}
  127. <table class='table table-striped table-hover'>
  128. <thead class='thead-dark'>
  129. <tr>
  130. <th scope='col'>Documento caricato con successo</th>
  131. </tr>
  132. </thead>
  133. <tbody>
  134. {% for l in listaok %}
  135. <tr>
  136. <td> {{ l }} </td>
  137. </tr>
  138. {% endfor %}
  139. </tbody>
  140. </table>
  141. {% endif %}
  142. <div><br><br></div>
  143. {% if listanotok %}
  144. <table class='table table-striped table-hover'>
  145. <thead class='thead-dark'>
  146. <tr>
  147. <th scope='col'>Documento non caricato perche già presente</th>
  148. </tr>
  149. </thead>
  150. <tbody>
  151. {% for l in listanotok %}
  152. <tr>
  153. <td> {{ l }} </td>
  154. </tr>
  155. {% endfor %}
  156. </tbody>
  157. </table>
  158. {% endif %}
  159. {% if listaok %}
  160. {% for i in listaok %}
  161. {{i }}
  162. {% endfor %}
  163. {% endif %}
  164. {% if listanotok %}
  165. {% for i in listanotok %}
  166. {{i }}
  167. {% endfor %}
  168. {% endif %}
  169. {% endblock %}