utente.welcome.html 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. {% extends 'base.html' %}
  2. {% block headersupplement %}
  3. <script language="JavaScript">
  4. function toggleCSV(source) {
  5. checkboxes = document.getElementsByName('MultipleCSVSelect');
  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="inputUtenti" 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='ScaricaCSVSelezionati' value="Scarica CSV Selezionati"/>Scarica CSV 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. <th scope='col'><input class="form-check-input" type="checkbox" id="selectCSVAll" name="selectCSVAll" value='0' onClick="toggleCSV(this);"/></th>
  48. </tr>
  49. </thead>
  50. <tbody>
  51. {% for uu in utenti %}
  52. <tr>
  53. {% if "UTENTE.EDIT" in permesso %}
  54. <td> <button type='submit' class='btn btn-primary ' name='scelta' value='{{ uu.id }}'>Edit</button></td>
  55. {% endif %}
  56. <td {% if not uu.enabled %} class="text-decoration-line-through" {% endif %} > {{ uu.nome }} </td>
  57. <td> {{ uu.codicefiscale }} </td>
  58. <td> {{ uu.sede.nome }} </td>
  59. <td> {{ uu.datanascita|date:'d/m/Y' }} </td>
  60. <td> {{ uu.luogonascita }} </td>
  61. {% if "DOCUMENTO" in permesso %}
  62. <td>{% if uu.documenti %}<a href='{% url 'documento:welcome' uu.id %}'>Download</a>{% else %} N/A {% endif %}</td>
  63. {% endif %}
  64. {% if "UTENTE.EDIT" in permesso %}
  65. <td> {{ uu.mail }} </td>
  66. <td> {{ uu.pin }} </td>
  67. {% endif %}
  68. <td> {{ uu.inserimento|date:'d/m/Y' }} </td>
  69. {% if "DOCUMENTO" in permesso %}
  70. <td>
  71. <input class="form-check-input" type="checkbox" id="MultipleCSVSelect-{{ uu.id }}" name="MultipleCSVSelect" value='{{ uu.id }}'>
  72. </td>
  73. {% endif %}
  74. </tr>
  75. {% endfor %}
  76. </tbody>
  77. </table>
  78. </form>
  79. {% if "UTENTE.CREA" in permesso %}
  80. <!-- Modal -->
  81. <div class="modal fade" id="CaricaIndiceModal" tabindex="-1" role="dialog" aria-labelledby="CaricaIndiceLabel" aria-hidden="true">
  82. <div class="modal-dialog" role="document">
  83. <div class="modal-content">
  84. <form name='formCaricaIndice' method='POST' enctype='multipart/form-data'>
  85. {% csrf_token %}
  86. <div class="modal-header">
  87. <h5 class="modal-title" id="CaricaIndiceLabel">Carica Elenco Dipendenti</h5>
  88. <span aria-hidden="true">&times;</span>
  89. </button>
  90. </div>
  91. <div class="modal-body">
  92. Caricamento Lista Dipendenti<br>
  93. Formato File CSV - obbligatorio <br>
  94. Separatore: ';' - prima riga: "Nome colonna".</br>
  95. <table class='table table-striped table-hover'>
  96. <tbody>
  97. <tr>
  98. <td>Nome Cognome</td>
  99. <td>Codice Fiscale</td>
  100. <td>Data Nascita</td>
  101. <td>Luogo Nascita</td>
  102. <td>email</td>
  103. <td>Sede Indentificativo</td>
  104. </tr>
  105. </tbody>
  106. </table><br>
  107. <label for='indice'>Elenco Dipendenti:&nbsp;</label>
  108. <input type='file' name='indice' id='indice' value='' accept='text/csv'>
  109. </div>
  110. <div class="modal-footer">
  111. <button type="submit" name="CaricaIndice" value='Carica Lista' class="btn btn-primary">Carica Lista Dipendenti</button>
  112. <button type="button" class="btn btn-primary" data-bs-dismiss="modal">Annulla</button>
  113. </div>
  114. </form>
  115. </div>
  116. </div>
  117. </div>
  118. </div>
  119. <!-- end modal -->
  120. {% endif %}
  121. {% endblock %}
  122. {% block bodybottom %}
  123. <div><br><br></div>
  124. {% if listaok %}
  125. <table class='table table-striped table-hover'>
  126. <thead class='thead-dark'>
  127. <tr>
  128. <th scope='col'>Documento caricato con successo</th>
  129. </tr>
  130. </thead>
  131. <tbody>
  132. {% for l in listaok %}
  133. <tr>
  134. <td> {{ l }} </td>
  135. </tr>
  136. {% endfor %}
  137. </tbody>
  138. </table>
  139. {% endif %}
  140. <div><br><br></div>
  141. {% if listanotok %}
  142. <table class='table table-striped table-hover'>
  143. <thead class='thead-dark'>
  144. <tr>
  145. <th scope='col'>Documento non caricato perche già presente</th>
  146. </tr>
  147. </thead>
  148. <tbody>
  149. {% for l in listanotok %}
  150. <tr>
  151. <td> {{ l }} </td>
  152. </tr>
  153. {% endfor %}
  154. </tbody>
  155. </table>
  156. {% endif %}
  157. {%if count %}totale record letti nel file: {{ count }}{% endif %}
  158. {% endblock %}